Questions tagged [graph-tool]

Graph-tool is an efficient Python module for manipulation and statistical analysis of graphs (a.k.a. networks).

Graph-tool is an efficient Python module for manipulation and statistical analysis of graphs (a.k.a. networks). Contrary to most other Python modules with similar functionality, the core data structures and algorithms are implemented in C++, making extensive use of template metaprogramming, based heavily on the Boost Graph Library. This confers it a level of performance which is comparable (both in memory usage and computation time) to that of a pure C/C++ library.

Useful Links

283 questions
2
votes
4 answers

Iteratively count elements in list and store count in dictionary

I have a piece of code that loops through a set of nodes and counts the path length connecting the given node to each other node in my network. For each node my code returns me a list, b containing integer values giving me the path length for every…
P-M
  • 1,279
  • 2
  • 21
  • 35
2
votes
1 answer

How to use categorial properties of Vertices and Edges to draw colors in graph-tool?

I have a graph_tool.Graph generated as follows: import random import graph_tool.all as gt G = gt.Graph() # Add a categorical property cprop = G.new_vertex_property('string') G.vertex_properties['type'] = cprop # Add some verticies with…
bbengfort
  • 5,254
  • 4
  • 44
  • 57
2
votes
1 answer

graph_tool graph_draw vertex text box margins vertex overlaps

Im trying to output a graph created using python graph_tool library to a png file. The final result is that the drawn graph vertexes overlaps. I realized that the problem is when i put text on the vertexes or edges, is like the margins of the text…
roj4s
  • 251
  • 2
  • 8
2
votes
2 answers

common neighbour of two vertices on graph-tool

I'd like to get common neighbors of two vertices on graph-tool. According to the document, several similarity measures are available and all of them use the number of common neighbors. So, I guess it should be easy to get the common neighbors. But,…
Light Yagmi
  • 5,085
  • 12
  • 43
  • 64
2
votes
2 answers

Configure error while installing graph-tool on ubuntu 14.04

So I spent a whole day trying to find out the solution for this. I am trying to install graph-tool on my machine with 14.04 OS. Initially I was unable to succeed because I didn't have gcc 5 on my machine. After installing it, I am trying the…
Peaceful
  • 4,920
  • 15
  • 54
  • 79
2
votes
3 answers

graph-tool: How to change vertex colors?

How can I set the background color of a vertex? I know there should be a property dictionary or something but I can't find an example. I need it to color different kind of vertices in a bipartite graph: gtdraw.graph_draw(g, pos=pos, …
Stefan Falk
  • 23,898
  • 50
  • 191
  • 378
2
votes
1 answer

Python graph-tool - remove unconnected vertices

I am writing a program that uses the Python graph-tool library, and I have had luck using a radial tree layout with graph_tool.draw.radial_tree_layout(g,vertexes[0]). However, there are several segments of my graph that are cut off from the rest and…
TheDoctor
  • 1,450
  • 2
  • 17
  • 28
2
votes
2 answers

graph_draw missing from graph_tool osx?

I am trying to use the method graph_draw in graph_tool. I see references to it in the site_packages and in documentation ./cgenv/lib/python2.6/site-packages/graph_tool/draw/__init__.py: …
user1601716
  • 1,893
  • 4
  • 24
  • 53
2
votes
1 answer

How to internalize PropertyMap in graph-tool

I'm using python package graph-tool, and facing an error trying to internalize boolean PropertyMap, the way described at http://graph-tool.skewed.de/static/doc/quickstart.html#graph-views. Here is an example code: from graph_tool.all import * g =…
kurtosis
  • 1,365
  • 2
  • 12
  • 27
2
votes
1 answer

Permanently adding to DYLD_LIBRARY_PATH on MAC causes X11 errors

I am using Python 2.7 and am trying to import graph_tool, and it seems that my libboost_thread-mt.dylib is located in /opt/local/lib rather than /usr/local/lib. If I start an X11 terminal and type in export DYLD_LIBRARY_PATH='/opt/local/lib'…
user3878281
  • 21
  • 1
  • 2
2
votes
1 answer

All shortest paths using graph_tool

I was wondering if there is a built in function in graph_tool that can be used to find all shortest paths from node s to node t. If not, is there any way that I can use shortest_distance() (in module graph_tool.topology), or shortest_path() (in…
Bahar
  • 770
  • 5
  • 18
2
votes
1 answer

python graph-tool library with graph database

I would like to use some of the graph-tool functionality with data in a graph database (say neo4j, but any Blueprints enabled graph DB would be good, see Tinkerpop project). I'm aware of (and have dabbled with some of) py2neo and would like to…
user965586
  • 563
  • 5
  • 22
2
votes
1 answer

AttributeError when trying to do a block partition with graph-tool

I am getting this error: AttributeError: 'list' object has no attribute 'clear' when trying to execute the example at this page The example is: >>> g = gt.collection.data["power"] >>> bstack, mdl = gt.minimize_nested_blockmodel_dl(g,…
gc5
  • 9,468
  • 24
  • 90
  • 151
1
vote
1 answer

Do graph_tool have Communities Louvain algorithm implementation in?

I'm working on code translating from Networkx to Igraph. This code use community detection based on Louvain Community detection algorithm. I din't find it on graph_tool documentation, do someone know if it exist? I readed the documentation of graph…
BIg G
  • 316
  • 1
  • 9
1
vote
1 answer

graph_tool: how to avoid that all_circuits function block my script

I'm learning python and I'm doing some experiment with the module graph_tool. Since the function all_circuits could take a long time to calculate all the cycles, is there a way to stop the function (for example after "X" seconds or after the…
john098
  • 13
  • 2