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
0
votes
1 answer

Do graph_tool property maps work in GraphViews?

The GraphView object in the python graph_tool package does not seem to work as I expect when the base graph is itself a GraphView object. Here is some code that shows the issue: from graph_tool import * import numpy as np g = Graph() p1 =…
Tobias Hagge
  • 231
  • 1
  • 8
0
votes
2 answers

graph_tool: re-index vertex ids to be consecutive integers

After applying a vertex filter on a given graph, I'd like to re-index the new filtered graph so that the vertex ids are consecutive integers. For example: from graph_tool import load_graph g = load_graph("path-to-graph") # assuming there are `n`…
xiaohan2012
  • 9,870
  • 23
  • 67
  • 101
0
votes
1 answer

How to calculate centrality for a particular vertex in graph-tool?

According to graph-tool documentation (https://graph-tool.skewed.de/static/doc/centrality.html), the graph_tool.centrality module computes centrality for all vertices. However, I need to calculate the centrality score for a particular vertex. Is…
Sagar S. De
  • 160
  • 7
0
votes
1 answer

graph-tool: How to save Property maps elements in the graphml?

It is my first attempt to use graph-tools with python. I have a graph with some important information in Properties Maps (names, topics,...). When I save the graph using g.save("test.graphml"), the Property Map related information is not saved:…
Fraxœ
  • 1
  • 2
0
votes
1 answer

Sub-classing Graph, Vertex and Edge in python graph-tool at the same time

Is it feasible to sub-class, at the same time, the Graph, Vertex and Edge classes in graph-tool in order to implement the behaviour of a certain type of graphs, such as social networks? More specifically, I would like to have a class…
0
votes
1 answer

Graph tool GraphML support for coloured vertices?

I am trying to use graph-tool to graph a network graph with coloured vertices. I am trying to graph the following graphML file from here shown below. However, the colour are not showing with the following code: g = Graph() g=…
Gawnie
  • 121
  • 4
0
votes
1 answer

Closer Connected Components in Graph-Toll

I am using the python library Graph-Tool to create a network graph. There are about 6 distinct clusters/separate connected components in my graph. However, I would like them to be closer together in the graph. Basically, I don't want so much white…
Harry Baker
  • 93
  • 2
  • 9
0
votes
1 answer

Graph-tool: How to access properties of a copied graph

I created a filtered graph of the graph g and would like to use it as a new graph. As far as I know the properties are also copied, but how can I access them? If I use "weight" it would be the property map of g not sub. weight =…
Neli
  • 532
  • 1
  • 3
  • 15
0
votes
1 answer

How does graph-tool decide the number of blocks?

The documentation of minimize_blockmodel_dl says See peixoto-hierarchical-2014 for details on the algorithm. However, the paper explicitely states However, in order to perform model selection, one first needs to find optimal partitions of the…
FooBar
  • 15,724
  • 19
  • 82
  • 171
0
votes
1 answer

How to get the edge value of a graph in graph-tool library?

I am working on a project where I have to manipulate graphs. I am using graph-tool library for which I am new and I code using Python 2.7. I added a new edge property called edge_capacity. For some reason, I need to know to which edge that value…
user2567806
  • 460
  • 3
  • 7
  • 17
0
votes
1 answer

Python doesn't see a library graph_tool

I have installed the "graph-tool" library. I used am instruction from official site https://git.skewed.de/count0/graph-tool/wikis/installation-instructions (the option "Installation via package managers". I use Anaconda distributive (I included it…
AlexModestov
  • 341
  • 1
  • 3
  • 6
0
votes
1 answer

How can I visualize temporal network using graph-tool?

I have 20 directed graphs in grap-tool (Python 3.4) and all have the same node name (it is an attribute, called 'name'), but vary in terms of connections and attributes. I am trying to plot those networks across time (i.e., how the edges changed at…
amaatouq
  • 2,297
  • 5
  • 29
  • 50
0
votes
1 answer

Force g++ to look for Boost in one location ignoring other settings

I am trying to compile graph-tool from source on Ubuntu 16.04 but have the problem that it fails to pick up the correct boost libraries. I am trying to compile it against anaconda python so have to provide additional flags to ./configure. I try to…
P-M
  • 1,279
  • 2
  • 21
  • 35
0
votes
1 answer

graph-tool - 'NestedBlockState' object has no attribute 'get_nonempty_B'

I am trying to replicate a section of code from the graph-tool cookbook to find the marginal probablity of the number of groups in a graph when using hierarchical partitioning. I however get an error telling me that 'NestedBlockState' object has no…
P-M
  • 1,279
  • 2
  • 21
  • 35
0
votes
1 answer

Python argument types did not match C++ signature

I have been playing around with the inference module from graph-tool a bit and tried to replicate a section of code from the cookbook section. When running gt.mcmc_equilibrate(state, wait=1000, mcmc_args=dict(niter=10)) I however get an error…
P-M
  • 1,279
  • 2
  • 21
  • 35