I am curious what is being used to calculate the standard deviation of the
average in gt.vertex_average and gt.edge_average
>>> t2=gt.Graph()
>>> t2.add_vertex(2)
>>> t2.add_edge(t2.vertex(0), t2.vertex(1))
>>> gt.vertex_average(t2, "in")
(0.5, 0.35355339059327373)
Now, shouldn't std be σ(n)=sqrt(((0-0.5)^2+(1-0.5)^2)/2)=0.5 ?
also q(n-1)=sqrt((0.5^2+0.5^2)/(2-1))~=0.70710
0.3535 is sqrt(2)/4 which happens to be σ(n-1)/2, so it seems there is some
relation to that.
A little bigger graph.
>>> t3=gt.Graph()
>>> t3.add_vertex(5)
>>> t3.add_edge(t3.vertex(0), t3.vertex(1))
>>> gt.vertex_average(t3, "in")
(0.2, 0.17888543819998318)
Now, we should have 0,1,0,0,0 series for vertex incoming degree.
So Windows calc gives σ(n)=0.4 and σ(n-1)~=0.44721, so where does 0.1788854
come from ?
Reason, I am asking because, I have a large graph, where the average looks
quite alright but the std makes no sense, as going by the histogram, degree
values are quite a bit more distributed than the std would indicate.
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

Hi,
I was wondering if there is any way to assign vertex properties while
adding edges to the graph. for example using "add_edge_list" I can assign
edge properties but later I have to iterate through all vertices again to
assign their properties.
I know this is not a problem when the vertex property is of the type "int"
or "float" because then one can use "vprop.a = values", but in case of
"string" and "object" this method doesn't work
What would be the best/fastest way to handle this situation.
I guess it would be very helpful to extend the "add_edge_list" function to
accept vertex property in some way.
cheers,
--
Mohsen

I'd like to use the "add_edge_list" function to add edges to my graph, and
simultaneously assign a value for an edge property map for each of the added
edges.
When I try the following example (with no edge property map information)
works fine:
elist1 = np.array([[0,1], [1, 2]]) #edge list with no value for edge
property map data (only the source and target for the edges)
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist)
But with the following example, I get the error below:
elist2 = np.array([[0,1, 1], [1, 2, 0]]) #edge list with edge property map
value in 3rd column
g = gt.Graph()
my_eprop = g.new_edge_property('bool')
g.add_edge_list(elist2, eprops=my_eprop)
Error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-48-6a949ea52c9b> in <module>()
----> 1 g.add_edge_list(elist2, eprops=my_eprop)
/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in
add_edge_list(self, edge_list, hashed, string_vals, eprops)
1969 eprops = ()
1970 else:
-> 1971 convert = [_converter(x.value_type()) for x in eprops]
1972 eprops = [_prop("e", self, x) for x in eprops]
1973 if not isinstance(edge_list, numpy.ndarray):
/usr/lib/python2.7/dist-packages/graph_tool/__init__.pyc in
__getitem__(self, k)
534 kt = "Graph"
535 raise ValueError("invalid key '%s' of type '%s',
wanted type: %s"
--> 536 % (str(k), str(type(k)), kt) )
537
538 def __setitem__(self, k, v):
ValueError: invalid key '0' of type '<type 'int'>', wanted type: Edge
---------------------------------------------------------------------------
Please help!
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

I tried the following command in Python and ipython prompt (2.7 version)
---------------------------------------------------------------------------
In [1]: from graph_tool.all import *
---------------------------------------------------------------------------
Its giving the following error. How can we solve it?
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-100bbe2bc9d9> in <module>()
----> 1 from graph_tool.all import *
/usr/lib/python2.7/dist-packages/graph_tool/__init__.py in <module>()
103
104 from .dl_import import *
--> 105 dl_import("from . import libgraph_tool_core as libcore")
106 __version__ = libcore.mod_info().version
107
/usr/lib/python2.7/dist-packages/graph_tool/dl_import.pyc in dl_import(import_expr)
55
56 try:
---> 57 exec(import_expr, local_dict, global_dict)
58 finally:
59 sys.setdlopenflags(orig_dlopen_flags) # reset it to normal case to
<string> in <module>()
ImportError: /usr/lib/python2.7/dist-packages/graph_tool/libgraph_tool_core.so: undefined symbol: _ZN5boost9iostreams4zlib6finishE
---------------------------------------------------------------------------
Thanks

Hi,
I have installed the package python3-graph-tool and when I use
graph_tool.search.dfs_iterator I got the error:
Traceback (most recent call last):
File "/home/steph/bin/superGraph.py", line 160, in <module>
gg.create_revdep(gg.getPackage('umda'))
File "/home/steph/bin/superGraph.py", line 88, in create_revdep
for e in bfs_iterator(self.graph, node):
File "/usr/lib/python3/dist-packages/graph_tool/search/__init__.py", line
345, in bfs_iterator
return libgraph_tool_search.bfs_search_generator(g._Graph__graph,
int(source))
RuntimeError: This functionality is not available because boost::coroutine
was not found at compile-time
Ubuntu: 14.04
python3-graph-tool version 2.12-1 (from deb
http://downloads.skewed.de/apt/trusty trusty universe)
There is a way to install python3-graph-tool binaries compiled with boost ?
Of course I can compile myself graph-tool, but it is not my goal.

I am trying to install graph-tool on a Trusty Ubuntu virtualbox being hosted on a Mac. I've added the requisite lines
deb http://downloads.skewed.de/apt/trusty trusty main
deb-src http://downloads.skewed.de/apt/trusty trusty main
to my /etc/apt/sources.list, but when I run a sudo apt-get update, I get the following errors:
W: Failed to fetch http://downloads.skewed.de/apt/trusty/dists/trusty/Release Unable to find expected entry 'main/source/Sources' in Release file (Wrong sources.list entry or malformed file)
E: Some index files failed to download. They have been ignored, or old ones used instead.
I have the main, universe, and multiverse repositories available. If any one has come across this problem before, please let me know how to fix it. Thanks.
Andy_

Running `make` on the github version of graph-tool returns an error stating
(it runs for a while first):
graph_triangulation.cc:55:61: fatal error:
CGAL/Periodic_3_Delaunay_triangulation_traits_3.h: No such file or directory
compilation terminated.
make[4]: *** [graph_triangulation.lo] Error 1
make[4]: Leaving directory `/home/pmj27/git/graph-tool/src/graph/generation'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/pmj27/git/graph-tool/src/graph'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pmj27/git/graph-tool/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pmj27/git/graph-tool'
make: *** [all] Error 2
Does anybody know what this is caused by?
Best,
Philipp
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

Hello,
I'm using graph_tool in a scenario, in which the meaning of a vertex
cannot be easily be explained by a label or a text. To get a meaningful
graph I would need to display a image inside the vertices. Has anyone an
idea, how could this be achieved?
Thanks
Soraltan

I'm currently building two-type random graphs of 100 vertices using the
traditional_blockmodel feature of the random_graph/random_rewire functions.
The degree_sampler I'm using is just lambda: poisson(5), which means that my
graphs have about 250 edges. My blocks contain 15 vertices and 85 vertices
respectively.
When I tune the correlation function in the following way:
def corr(a,b):
if a==b:
return 20
else:
return 1
I would expect, based on the documentation, that the following is
approximately true:
250 edges = (15*85)*(1*p_baseline) + (15 choose 2)*(20*p_baseline)+(85
choose 2)*(20*p_baseline). Solving this equation gives an approximate value
of p_baseline = .0033, given the degree_sampler I started with.
If p_baseline = .0033, then p_acrossblocks = .0033*1 = .0033 as well. Since
there are 85*15=1275 possible edges across the two blocks, I would expect an
average of .0033*1275=4.2 edges across the blocks in the entire network.
Despite this, I am continually seeing the minority block being, on average,
highly centralized in the overall network, with many more edges reaching
from it to the other block than would be predicted.
What has gone wrong here? Have I misunderstood the vertex_corr feature? Any
help would be greatly appreciated.
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.