How can i set minimun distance between nodes (so they do not overlap each other)

I am using sfdp_layout.

How can i modify it so nodes do not overlap each other alot and can show
edges?
Graph going to be huge (Millon of nodes) so what is best algorithm for it ?

below is my result and code of 70k nodes (email conversation) :

<https://lh3.googleusercontent.com/-mp9AYfKCLN8/U0WHfv93LiI/AAAAAAAAAvE/46g3j4OQHBc/s1600/test_p10.png&gt;

def draw_graph(userdict,edges):
    g = Graph()
    g.add_vertex(len(userdict))
    for edg in edges:
        g.add_edge(*edg)
        
    #pos = sfdp_layout(g, C=0.8 , K=4, cooling_step=0.69)
    pos = sfdp_layout(g,p=10, cooling_step=0.69)
    for vertex in g.vertices():
        print pos[vertex]
    return g

Thanks

Phyo.

attachment.html (1.46 KB)

I am using sfdp_layout.

How can i modify it so nodes do not overlap each other alot and can
show edges?

You should change the node size and the edge width.

Graph going to be huge (Millon of nodes) so what is best algorithm for
it ?

It probably does not matter. If your graph is so large and is not
low-dimensional like a lattice or a tree, it it is too large it almost
always will look like a huge blob with any algorithm.

Best,
Tiago

Hi all,

I would like to determine the fractal dimension of the graph. I can
assigned a "geometric distance" between each pair of vertices,
therefore, I could also assign each edge a "length". One thing I could
do is to somehow define a center and then count the the number of the
nodes within "a circle" with increasing "radius". See how the number of
the vertices scales with the increasing radius.

I wonder Is there any other ways to calculate the fractal dimension
using some features from any graph-tool functions? Can I estimate the
fractal dimension from the adjacency matrix maybe? I would appreciate
any advise.

Thanks!

Best,

Hu

There are no implementations of fractal dimension in graph-tool.

Note that this is an active area of research, and there is no
universally accepted definition of a generalized fractal dimension for graphs.
I think the most famous method is:

      http://www.nature.com/nature/journal/v433/n7024/abs/nature03248.html

But there are several issues with this approach. See e.g. the following paper
for a well-founded criticism:

    http://journals.aps.org/pre/pdf/10.1103/PhysRevE.84.066111

Best,
Tiago

Thanks for the references, I really appreciate it!

attachment.html (2.29 KB)

Hi,

I have got another question.

So I have here a graph with N vertices and M edges. Given a subset of n
vertices, I would like to count how many edges are there between these n
vertices of the subset. Is there any existing graph-tool function that
can be used for this task?

Thanks!

Hu

attachment.html (2.63 KB)

No, but you can just construct a filtered graph with a GraphView
containing only those nodes, and just call num_edges() on that.

Best,
Tiago

Ah good idea, thanks!

attachment.html (1.26 KB)

Thanks alot Tiago

I am hoping it would scale and there will be some gap if i increase
resolution like 4000 x 4000 but it dosen't .

attachment.html (1.18 KB)