I have a directed graph of about half a million nodes and approximately a
million edges following scale free behaviour and a power law degree
distribution. To test some of my hypothesis, I would like to generate random
smaller graphs (about 50 up to 200 nodes) representative of the big one.
When I used a sample function that samples straight away from the real
distribution of the big network, I have following problems:
- I generate unconnected nodes with both 0 in AND out degree.
- I generate small sub parts of a few nodes that are not connected to the
- If only sampling from nodes with at least 1 degree, the generated graph is
coherent, but not representative anymore as I need a big portion of nodes
with either only one in or one out degree.
Here is the part of my script I used for that, where samples are drawn from
dictionaries of the degrees:
k_in = in_degrees[a]
g=gt.random_graph(N, lambda:(sample_in(), sample_out()),
I also tried sampling from a list of tuples as you have mentioned before in
the forum, but I didn't receive any results, as the tuples randomly drawn
from my list might not be combinable.
g = gt.random_graph(4, lambda i: degs[i], directed=True)
- Is there any option I could active that would help me in those cases I
- Is there a better way how to create representative small networks?
Any help on that issue will be much appreciated.
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
I'm writing a small package that builds on graph-tool, but not on its graphics capabilities (also because I have to represent other things rather than the graph itself). Still I could use some of the functions "under the hood" for my purposes. I have a question about gt.draw.get_hierarchy_control_points(): the function returns the Bézier spline control points for edges in a given graph, but I'm having difficulties in understanding how this information is encoded. For a single edge in graph, I have dozens of values as control points (half dozens + 2), hence I suspect all splines going from node A to the root of a hierarchy and back to node B are encoded there, and control points should be taken 6 by 6 (3x2 by 3x2 coordinates?). How (x,y) for control points are encoded then: (x, x, x, y, y, y) or (x, y, x, y, x, y)? What are the 2 additiona values I have for each vector? Also, are values absolute or relative to one node in particular (A, B or root...)?
Thanks for graph-tool, really a great piece of software!
I've been experimenting with graph-tool and pypy3 (by making $PYTHON point
to the pypy interpreter), and I couldn't manage to successfully run
configure, even while setting --with-python-module-path. I don't know if
there's a correct value to put for LIBS here--maybe the directory
structures for lib directories of cpython and pypy are different?
Do you think there's a way to make these two pieces of software cooperate?
thanks a lot!
Here, the error that I get:
Could not link test program to Python. Maybe the main Python library has
installed in some non-standard library path. If so, pass it to configure,
via the LIBS environment variable.
Example: ./configure LIBS="-L/usr/non-standard-path/python/lib"
You probably have to install the development version of the Python
for your distribution. The exact name of this package varies among them.
I need to plot a 5K node/edges tree (a company directory) and after many
experiments have seen that the Reingold Tilford (RT) layouting gives the
I have tried using iGraph which has this algo but cannot manage to get nice
Also tried exporting the iGraph layout to GraphML and opening it with Gephi
but also this does not work well.
Is there a way to get a RT (linear or circular) graph layout with
Thank you VERY much.
Sent from: https://nabble.skewed.de/