Rank nodes on multiple lines

Hi,
I am generating large graphs with graphviz and i can have a lot of nodes on the same rank.
Is this possible to split the rank in several lines ?

For exemple, if i have 100 nodes in a rank, if i could tell graphviz that a rank should contain at max 25 nodes, the rank should be split in 4 lines (4 * 25 = 100).

Thanks

Besides the fact that you

Besides the fact that you want the nodes to split into 4 lines you did not make any requirement.

This is sample solution for spliting up 10 nodes into 2 rows -- the only drawback is you have to tell which nodes onto which row.

Click here in order to work with the soultion in GraphvizFiddle tool, this is .svg drawing:

rank-level.dot.svg

 

digraph G {
{rank=same A B C D E} -> {rank=same F G H I J} [style=invis]
0 -> {A B C D E F G H I J} -> 1
}

Hermann.

In my situation i have a set

In my situation i have a set of nodes and a set of dependencies between these nodes and i just want to visualise that.

I let dot calculate the ranks and do the layout, i don't need to reproduce a particular graph, all i want is node dependencies visualisation.

The problem is that a lot of nodes have similar dependencies and end up with the same rank. It makes the graph very large for some ranks and difficult to read.

If i could tell dot to create a new line for a rank when the number of nodes exceeds a given threshold, it would help to balance the resulting graph.

I'm not sure if it is possible though.

 

Thanks.

- LION

OK, so your problem is more

OK,

so your problem is more like this:

digraph G {
  size="4,4"
  0 -> {A B C D E F G H I J} -> 1
}

 

"mindist" on some edges can help, infortunately not for "dot" layout.

You can simulate by adding invisible nodes and edges like here:

digraph G {
  size="4,4"
  invis1 [shape=none label=""]
  0 -> {A B C D E F G H I J} -> 1

  0 -> invis1 -> A [style=invis]
}

 

Hermann.

 

 

Recent comments