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 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.

Hello,
I have recently started working with graph-tool, and was wondering if we
can try to view any of the data provided in the repo as a pandas Dataframe?
This would be helpful, because I would like to analyze a few things with a
custom dataset.
For example, gt.collection.data["celegansneural"], can it be displayed as a
dataframe? Or any other way?
I would like to see the all the content in it.
Warm regards,
Rachit Saluja

Hi,
I have a question regarding the implementing partial constraints during
blockmodel minimization. By partial constraints I mean that I have a
group of vertices V1 that are pre-labeled into k clusters i.e. vertices
from V1 that are in different clusters should not mix. Then there is a
second set of vertices V2 that should be able to mix freely with
vertices from both V1 and V2.
I have tried defining a corresponding vertex property and passing it to
clabel argument but have always ended up with partitions in which V1 and
V2 don't mix in the final state.
Best regards,
Anatol

Sir,
I have three doubts to clarify which I list here
1.) I am trying to use the following function for my graph:
*class graph_tool.inference.nested_blockmodel.NestedBlockState(g, bs,
base_type=<class 'graph_tool.inference.blockmodel.BlockState'>,
state_args={}, hstate_args={}, hentropy_args={}, sampling=False, **kwargs)*
I am not able to understand what do I need to provide for *'bs'* values in
the arguments.
The tutorial mentions that it is a *Property Map Hierarchical node
partition*.
What I understand it is asking for a prior hierarchical information about
the nodes which can be done using hierarchical clustering. If this is the
case then how does hierarchical partition help me ? because it is mentioned
in the tutorial that to overcome the limit of BlockState function to
identify smaller communities in very large graph this function was
implemented. My graph is very large and I didn't keep any hierarchical
information along with it.
If not then what do I need to pass to the argument 'bs' in this function ?
2.) Suppose I have a network myG with N nodes and E edges , undirected and
no value specifically assigned in the edge, vertex or graph property map.
I want to do the nested block model partition with mcmc equilibrate to get
the best partition. Then are these steps to do so correct.
a) Import graph_tool.inference and graph_tool.all
b) define your graph myG as *"NestedBlockState"*
c) minimize your NestedBlockState using the
*minimize_nested_blockmodel_dl(myG)* function
d) run mcmc_equilibrate function on minimized nested block state to find the
best partitions in n iterations.
3.) While using LayeredBlockState function, you mentioned in one of your
mailing list reply, one should collapse the graph as a single graph with
multiple edges.
What I understood by trying some random code is that i can add multiple
edges between two nodes but pass a different property map for each edge
defining the corresponding layer. Finally use this Property Map in
LayeredBlockState function by passing it to 'ec' parameter. Am I right on
this ?
4.) Which draw/plot function should be used to plot very large graphs. My
graph has 6500 nodes and 95000 edges. The calling of function draw() gives
memory error (for SVG format), PDF format fails to load for a very long time
and PNG format is of very low resolution. GraphViz doesn't work due to error
related to libv which I saw is a bug in the mailing list due to the libv
library.
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/

Hi everyone,
I am not sure if I have to post this discussion here or on Arch Linux's
forums, so sorry if this is not the right place.
As far as I understood, this library is written in C++ and wrapped with
Python. So it is similar to other high-performance libraries (like Numpy) in
such sense. Other libraries, like Numpy itself, are available trough
precompiled packages for almost every main distribution (including Arch).
Currently precompiled (I think) graph-tool packages are available just for
Debian and Ubuntu, while Arch has only an AUR package which "unfortunately"
require compilation.
I think this library is awesome and should have a precompiled Arch package
to make it immediate to install on such systems, so that way, for example,
we can just treat it like a normal package dependency to other packages
simplifing developement and distribution of other software who require
graph-tool and ask less expert users just to type a bunch of simple commands
to install the package instead of compile it.
Is it possible to do such a thing? If yes, do you plan to do it? Should I
ask on Arch forums instead?
I understand C++ makes thigs difficult for portability, but the majority of
linux libraries are written in C and have a precompiled package on major
distributions. But, as i sayed, graph-tool it is similar (I think) to a lot
of neat C++/Python libraries which have an Arch precompiled package.
Does create an Arch package ask too much effort for graph-tool developers in
order maintain the software?
Please, tell me if I am wrong on something and thanks in advance for your
reply.
One of the coolest libraries I ever seen! Even the documentation is awesome
(love the fact thath you specify types even in a weak-typed language, the
notes on complexity of the algorithms...) and today is a rare thing :)
--Daniele
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/