# Questions tagged [graph-tool]

Graph-tool is an efficient Python module for manipulation and statistical analysis of graphs (a.k.a. networks). http://graph-tool.skewed.de/

**0**

votes

**1**answer

25 views

### How to get X Y coordinates of lattice graph using graph_tool

I am creating a lattice graph using graph_tool. I am trying to create a Property Map that represents X Y coordinates in the graph. For instance, if I create a lattice graph with a height of 5 and a ...

**0**

votes

**1**answer

41 views

### Conda install graph-tool failed on win-64

I've tried to install graph-tool via anaconda for python 2.7:
conda install -c kristanarmstrong graph-tool
I got the following error:
UnsatisfiableError: The following specifications were found to ...

**1**

vote

**0**answers

23 views

### graph-tool Euler circuit

I am currently using the graph-tool library with Python (3.6) and I just noticed that there is no functionality to extract a Eulerian/Hamiltonian path/circuit. Is there a particular reason for this? I ...

**0**

votes

**0**answers

30 views

### AttributeError: module 'graph_tool.draw' has no attribute 'draw_hierarchy' is returned when running my code, which is not true

I'm trying to run a script that uses graph tools, and the code returns:
/usr/lib/python3/dist-packages/graph_tool/all.py:40: RuntimeWarning: Error importing draw module, proceeding nevertheless: No ...

**0**

votes

**0**answers

18 views

### OpenMP on mac (Mojave) along with graph-tool python

I am trying to use multi-threading on mac with python graph-tool
Currently when I import graph-tool and do:
openmp_enabled() <---this returns False
I want to know what steps I need to take to be ...

**0**

votes

**0**answers

28 views

### Community detection with (nested and non-nested) stochastic block model for (weighted) bipartite networks using python package graph-tool

I'm new to Python and I would like to use the package graph-tool to estimate the optimal number of communities in my network using the stochastic block model (nested and non-nested) approach.
I read ...

**1**

vote

**0**answers

32 views

### How to generate a scale free network with a desired power law distribution and fixed average degrees via graph-tool?

I'm trying to reproduce the synthetic networks described in some
papers.
How to create scale-free networks with desired power-law degree
distributions and fixed average degrees, P(k)=k^(-λ)? The ...

**1**

vote

**0**answers

15 views

### Graph_Tool - Initialize edge properties more efficiently

I am using graph-tool to calculate some centrality measures.
from graph_tool.all import *
graph = Graph(directed=True)
Before I do that, I need to initialize the edge properties. I am doing the ...

**1**

vote

**1**answer

70 views

### Load an edge-list into graph-tool

I want to load an edge-list into graph-tool. The vertex-indices in my list are not sequential, so I would like them to be automatically added as vertex_properties. As far as I understand this should ...

**1**

vote

**0**answers

63 views

### (Python graph-tool) graph-tool search using OpenMP? Can finding all paths between a source and target vertex be made parallel?

I am currently using graph_tool.topology.all_paths to find all paths between two vertices of a specific length, but the documentation doesn't explicitly say what algorithm is used. I assume it is ...

**0**

votes

**1**answer

27 views

### (Python graph-tool) Find paths of a specific length using graph-tool?

Is there a way to find paths between two vertices in a graph of a specific length?
I know I can find the shortest path using:
graph_tool.topology.all_shortest_paths
and that I can find paths of a ...

**0**

votes

**0**answers

47 views

### Adding edges using add_edge_list (graph-tool) from Pandas dataframe in a loop writes zeros to property map

I am trying to create a directed graph from a very large data-set (200 million edges) using graph-tool. I am using chunksize in Pandas to work with the data because of memory constraints.
The data (...

**0**

votes

**2**answers

73 views

### Efficient shortest path in DAG with Python's graph-tool

Task: I want to compute a shortest path between a source and target node in a DAG (directed acyclic graph) using Python's graph-tool efficiently. My DAG has negative weights.
In theory, this is a ...

**1**

vote

**0**answers

47 views

### MacOS Sierra - brew installs graph-tool with openmp disabled

Running brew install graph-tool on MacOs 10.13.4 does install graph-tool but openmp seems disabled.
Am I missing a brew option to have openmp enabled?
I did run brew install libomp prior to ...

**0**

votes

**1**answer

32 views

### How to I display a figure using graph-tool without the program blocking?

I am trying to write a program which dynamically updates a graph visualization as the state of the graph changes. Currently, the graph_draw method in graph-tool causes the program to halt until the ...

**0**

votes

**0**answers

60 views

### conda error when installing geopandas and graph-tool

I'm trying to import geographic data using geopandas and process it with graph-tool, however when I try to install both of these packages with conda, when I import geopandas, I get libgdal.so.20: ...

**0**

votes

**0**answers

48 views

### A node's contribution to its Katz centrality

Let G be n x n adjacency matrix of a weighted directed graph. Define the vector of Katz centralities by c = (I- a G)^{-1}.b where I is identity matrix, a is a positive scalar, b is a column vector, ...

**0**

votes

**1**answer

45 views

### python graph-tool: Fastest way to add edges without duplicates?

What's the fastest/most performant way to add edges without duplicates to a digraph in Python's graph-tool?
The naive solution would be to call g.edge(u, v) before adding edges, but that seems like ...

**1**

vote

**1**answer

94 views

### How to attach graph-tool to Django using Docker

I need to use some graph-tool calculations in my Django project. So I started with docker pull tiagopeixoto/graph-tool and then added it to my Docker-compose file:
version: '3'
services:
db:
...

**0**

votes

**0**answers

66 views

### graph visualization: graph-tool package python

I have a high order graph that draw by graph-tool package python. but I need a graph visualization that make a better form. is it possible that draw the graph-tool graph by graphviz package? or some ...

**0**

votes

**1**answer

76 views

### How can I calculate the girth of a graph using graph-tool?

Graph-tool offers a lot of tools for assessing a graph: https://graph-tool.skewed.de/static/doc/topology.html. However, I can't find any method for calculating the girth, i.e., the shortest cycle in ...

**0**

votes

**0**answers

151 views

### python - computing weighted betweenness centrality for nodes of a huge graph

I have a huge graph (say for example 300,000 nodes and 1,000,000 edges) which I'm analyzing using Python on an Ubuntu machine with 32GB of RAM and 4 CPU cores.
I found graph-tool to be a very ...

**1**

vote

**1**answer

244 views

### Graph-tool installed, Import.all does not work

I have installed graph-tool:
brew --prefix graph-tool
'/usr/local/opt/graph-tool
but when trying to import it:
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible ...

**0**

votes

**0**answers

67 views

### Graph-tool: Dijkstra search with multiple weights constraints

I am using graph-tool library for python to find the shortest path between two vertex. I have multiple weights for the edges and based on the certain conditions the appropriate wight values is chosen ...

**0**

votes

**1**answer

34 views

### minimize_blockmodel_dl with weighted graph

I am trying to use minimize_blockmodel_dl to identify communities in a weighted (undirected) graph.
I found out that this method once supported a eweight parameter, but it doesn't anymore.
Is there ...

**0**

votes

**0**answers

66 views

### implementing Girvan-Newman in graph-tool

I'm trying to implement the Girvan-Newman algo in graph-tool and using igraph to cross-check the number of clusters. The problem is I'm getting more clusters, around 460, than the igraph version, 23. ...

**0**

votes

**1**answer

30 views

### has_path equivalent in Graph-Tool

Does graph-tool have any equivalent function to NetworkX's has_path? I'd like to return True if there's a valid path between any given nodes.

**1**

vote

**2**answers

138 views

### Finding all paths between source and target in graph-tool, return edges instead of vertices

Stack Overflow!
I have a directed graph and need to find all paths between a source and target vertex. Between several vertices, there are multiple edges. Using graph-tool, one may suggest using ...

**-1**

votes

**1**answer

46 views

### Connecting subgraphs programmatically

I am looking for a graph theory package in Python or C++ that enables me to create edges between subgraphs/clusters and their nodes at will, as depicted in the accepted answer to this question, to ...

**0**

votes

**0**answers

150 views

### How to check OpenMP usage in python graph-tool

I am using python graph-tool for this algorithm in order to find min-cut in a large graph. My algorithm needs several calls to this function, and it seems to be the bottleneck. So I want to ensure if ...

**2**

votes

**2**answers

62 views

### BGL: Get initial direction of edge in undirected graph

In an undirected BGL graph: Can I get the information whether an edge (u,v) == (v,u) was initially added as (u,v) or as (v,u)?
Background:
I created a graph using Pythons graph-tool library which ...

**0**

votes

**1**answer

61 views

### graph-tool: How do I maintain an ordered set of vertices?

I am working on a network using graph-tool.
Within the set of all vertices, there are specific groups of vertices with a well defined order that I would like to keep track of. Until now, I have been ...

**0**

votes

**1**answer

87 views

### Draw only biggest connected subgraph in graph-tool

In graph-tool, is there a way to only draw the biggest connected subgraph? I'm currently having one big connected subgraph and a few smaller connected subgraphs I'm not particularly interested in. I'm ...

**0**

votes

**0**answers

46 views

### Multiple subplots using graph-tool

I'm currently trying to plot several graphs on the same figure using graph-tool, but I'm confronted with a weird bug.
I'm using the fact that the graph_draw() function allows to specify a container ...

**0**

votes

**0**answers

42 views

### Issue with python graph-tool TSP tour

I'm relatively new to Hamiltonian path and Travelling Salesman Problem (TSP). Particularly for my application, I was attracted to use graph-tool because of its built-in tsp_tour function that "returns ...

**0**

votes

**1**answer

162 views

### Setting up graph-tool on Docker Toolbox for WIndows

I followed the graph-tool docker installation instructions here. I've set up Docker Toolbox (can't use Docker for Windows, not on Pro), and I've gotten jupyter running with the Docker image.
However, ...

**0**

votes

**0**answers

160 views

### graph-tool: How do I find vertices that fit a certain property value?

I have a class Node that I set as a property for a graph using graph-tool.
from graph_tool.all import *
class Node(object):
def __init__(self, name, age):
self.symbol = name
self....

**-2**

votes

**1**answer

90 views

### How do I access Class fields in Python Graph-Tool property maps?

I'm trying to draw a graph with a class as a vertex property. How do I draw the graph with the vertex_text set to the name field of the classes they contain?
from graph_tool.all import *
class Node(...

**0**

votes

**1**answer

249 views

### Graph-tool: compile and connect to local CGAL library, in Linux? (no sudo)

[Ubuntu]
I have compiled CGAL locally:
/path/to/cgal/
/lib/
libCGAL_Core.so libCGAL_Core.so.13.0.2
libCGAL_ImageIO.so.13 libCGAL.so libCGAL.so.13.0.2
...

**0**

votes

**0**answers

54 views

### Installing graph-tool with local BOOST

In order to install graph-tool, I must install dependencies with autoconf.
Some of these dependencies use boost, and I link my local boost install to these dependencies with:
export BOOST_ROOT=/my/...

**0**

votes

**1**answer

420 views

### Installing graph-tool library on conda installed python 3.5, Mac OS

Precisely the same as here, which hasn't been resolved.
Followed the sequential directions here; all channels added.
Tried:
Adding to .bash_profile export PKG_CONFIG_PATH=$PKG_CONFIG_PATH://...

**0**

votes

**1**answer

63 views

### Is there a way to add a title or a caption to the drawing using graph_tool

At least some workaround would be appreciated. I am trying to save the figures as pdfs and then use it with latex as an animation. If there is a way to automatically add captions that will be really ...

**0**

votes

**0**answers

54 views

### best library or framework to build heavy weight graph based interactive applications

My company asked me to start working on a project that needs to work(interactively) with graphs. It needs to handle creating and maintaining couple of thousands of graph nodes in a way that user can ...

**2**

votes

**2**answers

56 views

### How can I retrieve a selected vertex in graph-tool?

I would like to be able to retrieve the vertex_index of a currently selected vertex (the vertex currently having the mouse over it). I have not found this question asked in StackOverflow, nor this ...

**0**

votes

**1**answer

37 views

### graph-tool - Edges between separate graphs?

In graph-tool, I have a forest of graphs and I want to add special edges across the graphs from/to specific nodes without encapsulating all the graphs into a new bigger multi-graph. Is there a way to ...

**0**

votes

**0**answers

75 views

### joblib parallel for with graph-tool filtering?

With graph-tool and joblib working together, do we need to send graph.copy() in the "Parallel" call like in the code below when using graph vertex filtering with .set_vertex_filter?
graph.copy() makes ...

**1**

vote

**0**answers

165 views

### How to compile graph-tool in ubuntu

I am trying to compile and install graph-tool version 2.26 in ubuntu using
./configure but I am getting following error
checking for boostlib >= 1.55.0 (105500)... yes
checking whether the Boost::...

**0**

votes

**1**answer

67 views

### Align the node labels radially in draw_hierarchy

How is it possible to align the labels of nodes to oriente radially toward center using "draw_hierarchy"? The text file which contains my dataset about my network, in each row has the labels of two ...

**1**

vote

**1**answer

202 views

### What installation dependencies/options are needed for graph-tool to include draw_hierarchy?

I've installed graph-tool 2.26 on ubuntu 14.04, python 3.5.4.
I can use graph-tool, but it seems incomplete.
For example I've seen this error:
AttributeError: module 'graph_tool.draw' has no ...

**0**

votes

**1**answer

62 views

### graph-tool draw function cannot show Chinese text

I am using graph-tool and trying to draw graphs with node property of Chinese words.
However, when I draw it using
# coding=utf-8
from graph_tool.all import *
# English string as vertex name
g = ...