Hi Tiago,
sometimes, when delete the graph and create a new one, then plot it, the
plotted graph is shown upside down (in terms of the node text). So how could
we control the orientation of the graph? Or which parameter we should use to
always make node text shown in a correct orientation. Thanks a lot.
--
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'm suffering from the same issue mentioned in this post:
https://git.skewed.de/count0/graph-tool/issues/174
Namely, I'm trying to draw a graph that includes a lot of self-looping
edges, and my labels are being printed upside down. If I remove the
self-loops the labels are shown the right way up.
Is there a fix for it?
Thanks,
Charlie
--
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 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.

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

Hello,
I am running a script to calculate the likelihoods of certain edges being
missing edges on a filtered graph (I filter out some edges to see whether
the filtered edges are more likely to be missing than a bunch of other,
random edges that I also calculate the likelihood for).
When running this I however get an error telling me the following:
Traceback (most recent call last):
File "edge_prediction_stats_ex_+_rand_es.py", line 122, in <module>
callback=collect_edge_probs,history=True)
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/mcmc.py",
line 155, in mcmc_equilibrate
extra = callback(state)
File "edge_prediction_stats_ex_+_rand_es.py", line 15, in
collect_edge_probs
p = s.get_edges_prob([chosen_test_edges[i]],
entropy_args=dict(partition_dl=False))
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/nested_blockmodel.py",
line 345, in get_edges_prob
L += lstate.get_edges_prob(missing, spurious, entropy_args=eargs)
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/inference/blockmodel.py",
line 1147, in get_edges_prob
pos[u] = self.b[u]
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/__init__.py",
line 446, in __getitem__
k = self.__key_convert(k)
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/__init__.py",
line 424, in __key_convert
key = self.__g().vertex(key)
File
"/home/pmj27/anaconda2/lib/python2.7/site-packages/graph_tool/__init__.py",
line 1760, in vertex
raise ValueError("Invalid vertex index: %d" % int(i))
ValueError: Invalid vertex index: 2
I have told python to return the vertex IDs of the edge that is raising the
error and have checked manually in the filtered graph whether these vertex
IDs are valid IDs and they are. Can anybody reproduce this error? Tiago, is
this in any way related to the errors I have been observing with filtered
graphs in the past?
I am running version 2.23dev (commit 87abb56d, Wed Apr 5 15:21:41 2017
+0100) which I think should be the latest version on Ubuntu 16.04 and have
compiled it with GCC 5.4.0.
Here is the network used ( graph_no_multi_clean.zip
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…>
) and here is the script used ( edge_prediction_stats_ex_+_rand_es.py
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…>
) to produce the error.
--
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 everyone
I'm trying to generate a planar graph of amino acids, based on their
properties, something like this:
http://www.russelllab.org/aas/other_images/lb3.gif
I want them to be something like this (I know there is a solution already,
but this is just an example at the moment, if I can't solve this problem, I
can't move forward).
Some amino acids should be close to each other, because they are in the
same group. The problem is, that they can belong to multiple groups, so
just grouping doesn't work. I've seen the fruchterman_reingold_layout and
it's two parameters:
*a* : float (optional, default:)
Attracting force between adjacent vertices.
*r* : float (optional, default: 1.0)
Repulsive force between vertices.
The problem is, that I think I would need the opposite. Repulsive force
between the connected vertices, and attractive force between the vertices
in general. The question is, can I do that somehow? Or is there another way?
This is something I've done to play with until now, attached
Thank you
Csongor