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
1
vote
2 answers

python ImportError: cannot import name 'multiarray'

I have scoured all of google's available links to address this issue, yet it still remains unsolved for me... I get the following error when trying to import graph_tool in python3. I have both python 2.7 and 3.6 and anaconda installed. I install…
tamtam
  • 641
  • 9
  • 24
1
vote
1 answer

graph tool edge text not working

I am trying to create an interactive finite state automata in python using graph-tool, but I can't get edge labels to work. Here is the python file: from graph_tool.all import * g = Graph() edge_labels = g.new_edge_property("string") a =…
user2248525
  • 51
  • 1
  • 2
1
vote
1 answer

removing edge from undirected edge graph-tool doesn't work when I swap vertices

I'm new to graph-tool python library and I'm just trying the basics. I have a problem with remove_edge command. let's get to the code: import graph_tool.all as…
sepante
  • 15
  • 7
1
vote
2 answers

How to add properties to edges when using add_edge_list in graph_tool?

I am trying to use add_edge_list instead of inserting edges one by one using add_edge in order to make the graph creation faster. But I can't find how I can create these edges at once and associate a weight property to them without looping over the…
Amine Kerkeni
  • 914
  • 3
  • 14
  • 29
1
vote
0 answers

Auto scaling of graph-tools output

I am using graph-tools to produce network graphs automatically from data on a webserver. Some of these graphs have many nodes (10 to 100) and some have 1000's. I would like to produce a consistently sized PNG output, where the nodes are…
Gawnie
  • 121
  • 4
1
vote
1 answer

How can I use graph-tool to calculate katz centrality for a graph which contain 2 million vertex

The code is very simple: centrality = graph_tool.centrality.katz(Graph) but there are some warnings: /usr/lib/python3/dist-packages/numpy/linalg/linalg.py:2056: RuntimeWarning: overflow encountered in multiply return sqrt(add.reduce((x.conj() *…
SunWJ
  • 55
  • 5
1
vote
1 answer

The basic usage in the Graph-tool: how to delete vertex and related edges in the Graph-tool?

I am new to Graph-tool and learning the basic operation on the Graph. The below command confused me a lot. Python 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more…
zhfkt
  • 2,415
  • 3
  • 21
  • 24
1
vote
2 answers

graph-tool graphviz_draw: how to set vertex height and width

I'd like to set different heights and widths for the vertices. It's easy with graph_draw: graph_draw(DG, ... vertex_aspect=1.6, ... ) But vertex_aspect doesn't exist for graphviz_draw and setting height and width has no…
Neli
  • 532
  • 1
  • 3
  • 15
1
vote
0 answers

graph_tool: transitive closure of undirected graphs

I was wondering what the best way to compute the transitive closure of an undirected graph in the python library graph_tool is. My solution so far is to create a directed graph from the original one and use the transitive_closure method on that: …
1
vote
1 answer

Compute betweenness centrality on a (1M,3M)-graph using graph-tool

I am trying to compute betweenness centrality on a 1M nodes 3M edges graph. I am using graph-tool and the following lines of code: from graph_tool.all import * g = load_graph("youtube.graphml") scores = graph_tool.centrality.betweenness(g) In its…
Aalto
  • 99
  • 10
1
vote
1 answer

Removing a internal PropertyMap from a Graph in graph-tool

For the purpose to save a graph without a specific PropertyMap (added with g.vp.foo = vprop) we need to remove it from a Graph g. The PropertyMap is already present after the loading of the Graph from file. How can I either remove a PropertyMap from…
loomi
  • 2,936
  • 3
  • 25
  • 28
1
vote
1 answer

graph-tools ValueError with graph_union for filtered graphs

Here's my code: import graph_tool.all as gt print gt.__version__ g1 = gt.Graph() g1.add_vertex(5) g1.add_edge_list([(0,1),(1,2),(2,3),(3,4)]) g2 = gt.Graph() #g2.add_vertex(3) #g2.add_edge_list([(0,1),(1,2)]) g1.vp['prop'] = g1.new_vp('int',…
Tim
  • 171
  • 2
  • 12
1
vote
2 answers

Subclassing Graph from the graph_tool package

I am attempting to sub-class Graph from the graph_tool package for some graph analysis in Python (so that I can generate some of my own functions, but still use Graph_Tool's functions as well), and I cannot seem to use graph_tool's graph generator…
Tim
  • 171
  • 2
  • 12
1
vote
2 answers

Graph to draw community structure with graph-tool

I need to draw community structure of a brain network. Similar to the attached images. I am using graph-tool python tool box. Any help to create this would be highly appreciated. .
ssm
  • 620
  • 6
  • 24
1
vote
1 answer

Random access (or otherwise fast access) of edges in boost graph library

I want to run Monte Carlo edge swaps, i.e., picking two existing edges in a graph uniformly at random and then (if some conditions are met) swap their end points. I am currently using boost::random_edge for selecting edges uniformly at…
Alice Schwarze
  • 559
  • 7
  • 21