2

TODO: in a graph with top-down rank, specify that node "START" should be put at the top.

The graph is large (100 nodes) and there are some subgraphs (around 10). Before using subgraphs, the "START" node is at placed at top. With subgraphs, the "START" node is placed somewhere around the center.

I tried to use

Start [root=true]

Start [rank=min]

Start [rank=1]

root=Start;

{rank=min; Start;}

But none of them worked. What's your ideas (i do not want to use 'pos', 'cause the graph size is not specific)?

Thanks!

lukmac
  • 4,617
  • 8
  • 33
  • 34
  • It would be useful if you would post which layout engine you use. dot? twopi? – uvesten Jul 05 '12 at 16:00
  • Also, consider posting your complete data (or an anonymized version of it) – uvesten Jul 05 '12 at 16:01
  • yes, i use dot. The complete data is too long (500 lines, 20 subgraphs). – lukmac Jul 05 '12 at 16:07
  • It would be easier if you were able to post the graph (or a reduced example demonstrating the problem). Are there any edges from Start to any other nodes? Are there edges going back to Start? – marapet Jul 06 '12 at 11:53

2 Answers2

1

As a start, use {rank=same; subgraph_1; subgraph_n;} to make sure that all your subgraphs are ranked lower than your root node. Then check what it does to your layout, and go on grouping the subgraphs from there.

uvesten
  • 3,365
  • 2
  • 27
  • 40
1

I like the answer that was given here:

How can I control within level node order in graphviz's dot? by TomServo

Summary - Create some virtual "hidden" nodes, and use invisible edges to enforce the rank, AND ORDER.