graph-tool

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

泄露秘密 提交于 2019-12-09 23:14:23
问题 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 random. #include <boost/graph/adjacency_list.hpp> #include <boost/graph/erdos_renyi_generator.hpp> #include <boost/random/mersenne_twister.hpp> #include <boost/random/variate_generator.hpp> #include <boost/graph/random.hpp> #include <boost/random/linear

Linker trouble with MacPorts installation of graph-tool

这一生的挚爱 提交于 2019-12-08 13:33:11
问题 I've installed graph-tool via Mac Ports. Some days ago, I ran $ sudo port selfupdate $ sudo port upgrade outdated Graph-tool was compiled anew (which took around 30 hours(!)) Now, when I want to include graph-tool in python I get the following error: Python 2.7.6 (default, Nov 22 2013, 13:39:24) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import graph_tool dyld: lazy symbol binding

Activating cairo-dependent features of graph_tool

余生长醉 提交于 2019-12-07 19:16:47
问题 I have been using the graph-tool library for a while now, thus far I hadn't really been using most of its drawing features. Today when trying to use graph_tool.draw.graph_draw I realised that I had configured graph-tool initially without cairo, ./configure --disable-cairo and this is exactly the graphics library that graph_draw uses. If I install cairo now, is there a way to activate the features of graph_tool that rely on cairo without having to remove and reinstall the whole graph_tool

All shortest paths using graph_tool

只谈情不闲聊 提交于 2019-12-06 09:29:14
I was wondering if there is a built in function in graph_tool that can be used to find all shortest paths from node s to node t. If not, is there any way that I can use shortest_distance() (in module graph_tool.topology), or shortest_path() (in module graph_tool.topology) somehow (or any other built-in function)to compute all the shortest path instead of only one of them, efficiently (I am working with a graph that has around half a million nodes). There is no such function in graph-tool. Note that in general finding all shortest paths on a large graph will probably be unfeasible, since the

Activating cairo-dependent features of graph_tool

陌路散爱 提交于 2019-12-06 06:19:06
I have been using the graph-tool library for a while now, thus far I hadn't really been using most of its drawing features. Today when trying to use graph_tool.draw.graph_draw I realised that I had configured graph-tool initially without cairo , ./configure --disable-cairo and this is exactly the graphics library that graph_draw uses. If I install cairo now, is there a way to activate the features of graph_tool that rely on cairo without having to remove and reinstall the whole graph_tool module? This would spare a few hours of re-installation. (the make process takes about 3 hours on my

python graph-tool access vertex properties

倖福魔咒の 提交于 2019-12-06 04:13:21
For my current project I want to use the graph-tool library since they claim being the fastest: https://graph-tool.skewed.de/performance . I have some algorithms (shortest path, etc.) to run on really large networks, so the faster the better! First question: Is this claim 'being the fastest' true? ;) While trying to build a graph-tool graph fitting my needs, I figured out that its not possible to access vertex properties in a efficient way. Maybe I missed something? My question is now, can the function "getVertexFromGraph(graph, position)" be written in a more efficient way? Or more in general

Explicit vertex position in python graph-tool

烈酒焚心 提交于 2019-12-05 06:57:53
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 = g.new_vertex_property("vector<double>") where g is my graph. I am not sure if it is the right way to do it. There is one code snippet which you might find helpful. pos = gt.random_layout(g, shape=shape, dim=3) >>> pos[g.vertex(0)].a array([ 86.59969709, 1.31435598, 0.64651486]) graph_draw(g, pos=pos, output="graph-draw-random.pdf") What should I do if I were to define my

Basic questions about nested blockmodel in graph-tool

只愿长相守 提交于 2019-12-04 23:19:10
问题 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 labels of its vertices. The hierarchical visualization is rather difficult to understand for amateurs in network theory, e.g. are the squares with directed edges that are drawn meant to implicate the main direction of the underlying edges between two

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

眉间皱痕 提交于 2019-12-04 19:32:56
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 random. #include <boost/graph/adjacency_list.hpp> #include <boost/graph/erdos_renyi_generator.hpp> #include <boost/random/mersenne_twister.hpp> #include <boost/random/variate_generator.hpp> #include <boost/graph/random.hpp> #include <boost/random/linear_congruential.hpp> int main(int argc, char* argv[]) { typedef boost::adjacency_list<boost::setS,boost::vecS

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

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:47:20
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 "conda info <package>" to see the dependencies for each package. Digging through the dependencies led to a dead-end at gobject-introspection So I tried another approach: Installed boost with conda, then tried to ./configure, make, and make install graph-tool... which got about as far as ./configure: =========================== Using python version: 3.5.2