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
3 answers

How to install graph-tool using pip?

I am trying to use graph-tool, but am unable to find it in pip or pypi How can I get it when not using conda? Please notice I am NOT refering to graph-tools
Gulzar
  • 23,452
  • 27
  • 113
  • 201
1
vote
1 answer

`graph-tool` edge bundling circular layout graph from weighted adjacency block matrix

I am trying graph-tool by Tiago Peixoto to build a graph (either directed or undirected) from a given weighted adjacency matrix with a block structure. So far, unsuccessfully. My question partly overlaps with this thread on SO, which, however,…
maurizio
  • 745
  • 1
  • 7
  • 25
1
vote
1 answer

Generating incorrect graphs from adjacency matrices using graph-tool on Python

I am trying to generate a graph from an adjacency matrix. I know it is something that has already been asked here but I can't get to generate one correctly. My code is import numpy as np import graph_tool.all as gt L = 10; p = 0.6 Adj =…
Pablo
  • 87
  • 5
1
vote
1 answer

Troubles with graph-tool installations in Google Colab

Literally yesterday all my colab notebooks using graph-tool library were working correctly. All I needed to do was to add the following lines at the beginning: !echo "deb http://downloads.skewed.de/apt bionic main" >> /etc/apt/sources.list; !apt-key…
1
vote
0 answers

Contracting Vertices in graph_tool

I'm trying to switch over from using networkx to graph_tool for python, however there doesn't seem to be a feature in graph_tool to contract nodes. For the purposes of my graph this is also equivalent to edge contraction. Does anyone know if such a…
frog1944
  • 245
  • 5
  • 13
1
vote
0 answers

Transforming hierarchical bipartite graph into a circular graph using graph-tool

I have been using graph-tool to create hierarchical topic models with excellent results using a hierarchical stochastic block model (hSBM). The approach is described here: https://github.com/martingerlach/hSBM_Topicmodel The library creates a…
1
vote
1 answer

Using graph6 format with graph-tool

I have downloaded a bunch of graphs from http://users.cecs.anu.edu.au/~bdm/data/graphs.html and I want to do some analysis. I want to use the graph-tool Python module for this but I cant find a convenient way to convert from graph6 format to a…
BenedictWilkins
  • 1,173
  • 8
  • 25
1
vote
1 answer

How to run SBM algorithm in graph-tool package in parallel mode with OpenMP?

I've been using the SBM algorithm, implemented in the graph-tool package. I need to process a huge amount of data and need to run it in parallel. I know that OpenMP is activated by default in this package and used in the specific and compatible…
1
vote
2 answers

Read Pajek .net files using Graph-tool

I have a Pajek network file (undirected network with weighted edges), for which an example is provided here: *Vertices 5 1 apple 2 cat 3 tree 4 nature 5 fire *Edges 1 3 14 2 4 1 Node labels are provived without quoting. Edges are specified…
Forinstance
  • 413
  • 4
  • 17
1
vote
1 answer

In graph-tool, is ordering of vertices() and vertex_properties the same?

I've created a graph using graph-tool library and added string labels to nodes using vertex_properties. However, when I'm reading the graph, getting the labels from the vertices became an issue, since I also want in-degree's and out-degree's of the…
1
vote
1 answer

Better way to extract vertices from connected components?

The following graph, with edges [(0,1),(1,2),(3,3),(3,4),(1,1),(5,5),(5,6)], should have connected component vertex sets as follow: [0, 1, 2], [3, 4], [5, 6]. graph setup import graph_tool as gt from graph_tool.topology import label_components edges…
Ian
  • 3,605
  • 4
  • 31
  • 66
1
vote
1 answer

Distance map returned from shortest_distance function misses entries of certain vertices

I have a network present in a postgres database, where I can route with the pgrouting extension. I've read this into mem, and now want to calculate the distance of all nodes within 0.1 hours from a specific starting node: dm = G.new_vp("double",…
1
vote
1 answer

Ontologies and Graph-tool Python

Is there a way to create a graph from an ontology file using Graph-tool library in Python? I've done some research and what I've found is: Graph Tool doesn't support .owl and .rdf files. There is no obvious way to convert an ontology to a graph…
1
vote
1 answer

Python's graph tool - computing ego net with multiprocessing

I'm trying to compute ego-nets for 250k special nodes residing inside a relatively big network (8M nodes and 17M edges). Since the cutting process takes 3 seconds for each special node, I decided to use multiprocessing: from graph_tool import Graph,…
balkon16
  • 1,338
  • 4
  • 20
  • 40
1
vote
2 answers

After graph-tool installation on mac I get ValueError: Namespace Gtk not available

I have installed graph-tool using this line on mac 10.14: conda create --name graphtool -c conda-forge graph-tool However, when I try to use on of the example codes on graph-tool website I got an error message regarding gtk: ----> 1 from…
Ohm
  • 2,312
  • 4
  • 36
  • 75