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 ran mcmc_equilibrate on a nested block state model in a weighted graph. As
per instructions, I copied the initially computed state in another object
with increased hierarchy depth to 10. However, this fixed the depth to 10.
Everything computed afterwards has depth 10 even if is clear that after 3 or
4 levels the nodes converge to one.
There are many empty branches and when I try to plot it with empty_branches
= False, I get an error stating it is not a tree.
RuntimeError: Invalid hierarchical tree: No path from source to target.
Did anybody perform any similar analyses?
The hierarchy after mcmc_equilibrate:
<NestedBlockState object, with base <BlockState object with 24 blocks (24
nonempty), degree-corrected, with 1 edge covariate, for graph <Graph
object, undirected, with 230 vertices and 11230 edges, edges filtered by
(<PropertyMap object with key type 'Edge' and value type 'bool', for
Graph 0x7fc3a89f1210, at 0x7fc3a64911d0>, False), vertices filtered by
(<PropertyMap object with key type 'Vertex' and value type 'bool', for Graph
0x7fc3a89f1210, at 0x7fc3a64912d0>, False) at 0x7fc3a89f1210>, at
0x7fc3a6491950>, and 10 levels of sizes [(230, 24), (24, 5), (5, 1), (1, 1),
(1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1)] at 0x7fc3a6491590>
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/

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.

Hi Tiago and everyone else on the list
Thank you for your swift reply.
The attached png is one example of a max flow calculation result.
The flow is limited in four places in this graph.
I would like to extract the order of the edges in the four paths I drew.
The shortest path solution you described corresponds to path 3 in the drawing.
all_shortest_paths gives my path 3 and another completely different path before crashing with a memoryError.
Looking forward to hearing from you.
Best,
Alex
________________________________________
From: Tiago de Paula Peixoto [tiago(a)skewed.de]
Sent: Thursday, March 09, 2017 18:43
To: Hobé Alex
Subject: Re: Graphtool: Finding the paths that the maximum flow algorithm produces
Hi Hobé,
I'm not sure I understand what you want. Any path containing edges with
positive flow is a "flow path". There are many of them. Which one do you
want? If you just want _some_ path, just filter out the edges with zero flow
and get the shortest path. But there are many other ways to proceed...
Best,
Tiago
PS. There is a mailing list of the graph-tool project, where questions like
this can be posted. It is better to use the list than to ask me directly,
since it builds a repository of questions others can consult, and other
people can help you as well.
On 09.03.2017 17:04, Hobé Alex wrote:
> Dear Mr. de Paula Peixoto
>
> I am using the python graphtool for my master thesis and am enjoying the
> beautiful pictures it produces.
> When computing the maximum flow I would like to use other edge properties
> along the computed path for further calculations.
> I am therefore looking for a way to find an array, which contains the edges
> along a flow path, similar to the shortest_path result.
> I looked through all the pages of the online tutorial, learnt a couple of
> new tricks, but haven't found a way to solve this.
>
> I would be very thankful for any assistance you would be able to provide and
> I look forward to hearing from you.
> Best wishes,
>
> Alex Hobé
--
Tiago de Paula Peixoto <tiago(a)skewed.de>

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 All,
I am experiencing the problem that I always get Segmentation fault (core
dumped) and my program does not finish when running
state = minimize_blockmodel_dl(g, overlap=True)
When overlap=False, there is no problem.
I have the 2.24 graph-tool version installed from Ubuntu repo. I tried this
with both python2.7 and python3 -- in both cases, I get the segmentation
fault error.
Also, this is not due to the size of my graph, I tried with a toy example
with only 10 nodes, it still happens.
Any ideas what I could do are very much appreciated.
Thanks,
Sanja

Hello,
so clabel() and pclabel() serve as constraint labels: different values for
nodes mean that nodes are placed in different groups, i.e. this is an
assortative constraint (all nodes with the same label are place in one
group).
Is there a way to do a disassortative constraints: nodes with the same
label are placed in different groups?
Many thanks in advance,
Peter
--
Dr Peter Straka
Senior Research Fellow (DECRA) in Statistics
School of Mathematics & Statistics
UNSW Sydney
p.straka(a)unsw.edu.au | strakaps.github.io | @strakaps

Hello Tiago,
I finished implementing the background image in GraphWidget. I attached the
files so you can see the result. You just need to run the file named
test_window.py within an environment with graph-tool installed. I think
that it only works with PNG image files, because I used the method
cairo.ImageSurface.create_from_png()
During this development I have found some difficult to use the key press
events when the GraphWidget is inside a Gtk container. I was trying to set
a GraphWidget inside the Gtk.Overlay, which is set inside a Gtk.Notebook
page. In this configuration all the events with scroll and control key
worked perfectly, but when I press the keys 'a', 's' or 'r' nothing
happens. Do you have any idea why this occurs?
I had another problem related with the docker image when I was developing
the GUI. All the text outside the GraphWidget was shown as a undefined
character, like small squares. I thought that happened because the Arch
Linux is messing with the fonts. So I created a new Dockerfile using Ubuntu
16.04 and compiled with graph-tool. This way I had no problem with the font.
I hope this help in some way. :)
Regards,
Paulo Nascimento

Hi,
I recently upgraded to v2.22 (from v2.19) and I noticed that with the new
version when I use the roller button on the mouse to zoom in or out, the
application crashes with a segmentation fault - this was NOT the case with
v2.19.
I was wondering if anybody else has experienced similar issues or have any
ideas how to resolve the issue.
Regards,
Vaggelis
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/