Hi Tiago,
I am trying to calculate the shortest distances of a graph after applying a
filter. I have a code that looks like this:
g=gt.load_graph("myGraph.xml",format="xml")
#for later use
distances = gt.shortest_distance(g)
#extract the components of the graph
comp = g.label_components(g)
#This splits the graph in several components
#I want to calculate the shortest distances
#for the component 2 for example
filtering = g.new_vertex_property("boolean")
for v in g.vertices():
if comp[v]==2:
filtering[v]=True
else:
filtering[v]=False
#set the vertex filter
g.set_vertex_filter(filtering)
distances_comp=gt.shortest_distance(g)
The last line of code rises a segmentation fault. I have plotted the graph
with the filtered graph and its correct, also I can calculate the
local_clustering_coefficient without problems. Am I doing something wrong?
Is there any other way to filter the graph and calculate the shortest
distances? Is this a bug?
Thanks so much,
Juan

I want to use graph-tool using the multiprocessing library in Python 2.6. I
keep running into issues though with trying to share a full graph object. I
can store the graph in a multiprocessing.Namespace, but it doesn't keep the
dicts of properties. Example:
def initNS( ns ):
_g = Graph( directed = False)
ns.graph = _g
ns.edge_properties = {
'genres': _g.new_edge_property("vector<string>"),
'movieid': _g.new_edge_property("int"),
}
ns.vertex_properties = {
'personid': _g.new_vertex_property("int32_t")
}
"""
Build property maps for edges and vertices to hold our data
The graph vertices represent actors whereas movies represent edges
"""
# Edges
_g.edge_properties["genres"] = ns.edge_properties['genres']
_g.edge_properties["movieid"] = ns.edge_properties['movieid']
# Vertices
_g.vertex_properties["personid"] = ns.vertex_properties['personid']
ns.graph = _g
##########
This initializes 'ns', which is a multiprocessing.Namespace. The problem is
that for example, ns.edge_properties[ * ] tells me that the type isn't
pickle-able. I tried to just skip that and use the _g.edge_properties to
access it, but those dicts aren't carried over to the different process in
the pool. Presumably b/c they aren't pickle-able.
Any thoughts about how to fix this?
(For those interested, I'm attempting to use the IMDbPy library to do some
graph analysis on the relationships among actors and movies. Each process
has it's own db connection and trying to populate the graph with actor and
movie information in parallel since it's a pretty large and dense graph.
Somewhere in the neighborhood of 250,000+ vertices for just a depth of three
relationships)
Thanks,
--
Derek

Is it possible to write the code for graph traversal in C++ rather than using
the Python wrappers? I need the graph search to be as fast as possible.
I tried something simple like this: http://pastebin.com/m2pwFQKy
It looks like the typedefs for 'graph_graph_t' don't appear until after the
support code: http://pastebin.com/itT73DxT
Is there an example of how to achieve something similar?
Thanks Tiago Peixoto for developing/maintaining this great library!
--
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,
Thank you again for this great library.
First, could you please describe more details about using remove_vertex_if
and find_vertex?
and how to deal with the returned of those functions?
also, I have a simulation scenario where I have to remove nodes with the 10
% highest degrees. thus, I tried to use the following code as initial
attempt
*prop = gt.find_vertex(g,"total",6)
gv = gt.GraphView(g, vfilt=prop, efilt=None, directed=False, reversed=False)
*
but it shows me the following error
Traceback (most recent call last):
File "test-failure.py", line 57, in <module>
gv = gt.GraphView(g, vfilt=gt.find_vertex(g,"total",6), efilt=None,
directed=False, reversed=False)
File "/usr/local/lib/python2.6/dist-packages/graph_tool/__init__.py", line
1525, in __init__
vmap[v] = vfilt(v)
TypeError: 'list' object is not callable
any help to do my scenario would be greatly appreciated
Thank you in advance :)
--
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 it is possible to overlay two drawings of the same graph where I use different color-coded vertex sizes? Theses colors would need to be transparent and the graph layout must match in each drawing. Is there an easy way of doing so with graph-tool?
Thanks!
Regards,
--
Sebastian Weber
Group of Cell Communication and Control
Freiburg Institute for Advanced Studies - FRIAS
School of Life Sciences - LIFENET
Albert-Ludwigs-Universität Freiburg
Albertstr. 19
79104 Freiburg
T.: +49-761-203-97237
Fax:+49-761-203-97334

Hi all,
I would like to know if somebody has already coded functions for creating
some small-world / scale free / ER networks with the following parameters
(similar to networkx):
small-world -> n : The number of nodes , k : Each node is connected to k
nearest neighbors in ring topology , p: The probability of rewiring each
edge
scale-free -> n : Number of nodes, m : Number of edges to attach from a new
node to existing nodes
ER -> n : The number of nodes , p : Probability for edge creation.
Cheers!
Mehdi
--
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.