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
135
votes
14 answers

Python equivalent of D3.js

Can anyone recommend a Python library that can do interactive graph visualization? I specifically want something like d3.js but for python and ideally it would be 3D as well. I have looked at: NetworkX - it only does Matplotlib plots and those…
Eiyrioü von Kauyf
  • 4,481
  • 7
  • 32
  • 41
20
votes
2 answers

how to remove positive infinity from numpy array...if it is already converted to a number?

How does one remove positive infinity numbers from a numpy array once these are already converted into a number format? I am using a package which uses numpy internally, however when returning certain arrays, certain values are returned as the…
songololo
  • 4,724
  • 5
  • 35
  • 49
15
votes
1 answer

Graph-tool surprisingly slow compared to Networkx

After looking at the impressive performance comparison, I decided that I would give a try to graph-tool. So for comparison, I wrote codes to generate a random tree using both packages. The graph-tool code: import numpy as np import graph_tool.all…
Peaceful
  • 4,920
  • 15
  • 54
  • 79
10
votes
3 answers

How to let python3 import graph-tool installed by Homebrew?

I tried to use Homebrew to install graph-tool, but the python3 cannot find it. brew tap homebrew/science brew install graph-tool It is said that the package is installed in homebrew/science/graph-tool-2.22_1, where I only found…
Kevin
  • 197
  • 2
  • 11
10
votes
4 answers

Create a weighted graph from an adjacency matrix in graph-tool, python interface

How should I create a graph using graph-tool in python, out of an adjacency matrix? Assume we have adj matrix as the adjacency matrix. What I do now is like this: g = graph_tool.Graph(directed = False) g.add_vertex(len(adj)) …
adrin
  • 4,511
  • 3
  • 34
  • 50
7
votes
2 answers

How to install graph-tool for Anaconda Python 3.5 on linux-64?

I'm trying to install graph-tool for Anaconda Python 3.5 on Ubuntu 14.04 (x64), but it turns out that's a real trick. I tried this approach, but run into the problem: The following specifications were found to be in conflict: - graph-tool Use…
geofurb
  • 489
  • 4
  • 13
7
votes
1 answer

Basic questions about nested blockmodel in graph-tool

Very briefly, two-three basic questions about the minimize_nested_blockmodel_dl function in graph-tool library. Is there a way to figure out which vertex falls onto which block? In other words, to extract a list from each block, containing the…
user6039682
7
votes
1 answer

Adding edge weights and scaling drawn edge lengths in graph_tool

I'm using the graph-tool, and I can't find a way to define weights for the edges. How do I add edge weights to my graph? Additionally, I would like that when I use graph_draw, the graph will be plotted with the edge distances in accordance to the…
EyalItskovits
  • 116
  • 1
  • 9
6
votes
1 answer

graph-tool: how to access properties?

I would like to store instances of a class in a graph-tool graph, one object per node (or 'vertex' as graph-tool calls them). I am trying to use a vertex property as that seems to the be the way to do this. class MyClass(object): def…
ssc
  • 9,528
  • 10
  • 64
  • 94
6
votes
1 answer

Explicit vertex position in python graph-tool

I am using python graph-tool. To draw graphs, it uses graph_draw function. I want to send vertex positions explicitly to dot engine. It turns out that I can pass a property map named pos. I tried defining it as v_pos =…
Dilawar
  • 5,438
  • 9
  • 45
  • 58
6
votes
1 answer

What is the optimal way to create a graph with add_edge_list() method?

I am trying to create large graph via graph-tool library (near 10^6 - 10^7 vertices) and fill vertex property with vertex name or use names instead of vertex indexes. I have: list of names: ['50', '56', '568'] set of edges, but instead of vertex…
6
votes
1 answer

Graph-tool: subgraphs as new Graph objects

I find graph-tool documentation extremely obscure and much more cryptic than other analogous libraries. I really can't figure out how to "extract" components (aka connected components) from a graph in graph-tools. I would like to save subgraphs in…
Marco Necci
  • 329
  • 4
  • 12
6
votes
1 answer

ImportError: libboost_iostreams.so.1.61.0: cannot open shared object file: No such file or directory

I am using Anaconda as my main python distribution (though also have the system's default python installed) so have to compile graph-tool from source to get it to work with Anaconda. I am using Ubuntu 14.04 so also have to compile boost from source…
P-M
  • 1,279
  • 2
  • 21
  • 35
5
votes
0 answers

What is the most efficient library to work with Multilayer networks in Python or R?

Question: Which libraries/packages are the most efficient (in terms of memory use and speed) to analyze multilayer networks? Desired answer: Ideally, the answer to this question would involve using each of these libraries to create a pre-defined…
rafa.pereira
  • 13,251
  • 6
  • 71
  • 109
5
votes
2 answers

Stop vertices from overlapping each other when drawing using graph-tool

I am using graph-tool on Python 3.5.1. I have a graph of words, with edges between words that rhyme. When I use graph-tool's draw function, it causes all the vertices to overlap if I make the vertices too large, but if they are too small, I must…
Bretsky
  • 423
  • 8
  • 23
1
2 3
18 19