# Drawing large networks

Sorry, I’m very new to graphviz so this may have already been answered, but I’ve been working on graph generation using Ocaml and then converting that graph into dot to draw it (because graphviz is the best!). For the first test, I’m creating a fat-tree network up to size of around k = 10 --ideally size of k = 20 (500 nodes). But as I began testing larger k’s (greater than 4 which works well), some of the nodes got out of order(in the picture with k = 6, the pod_0 should show 12,13,14 left to right instead of 14,12,13 and the graph is very vertically compressed(as seen in the picture of size k=10. Do you have any suggestions to alleviate these two problems? The code is shown below is for k = 6. k =10 is respectively scaled up to hold the increased number of nodes:
digraph fat_tree_topology {
subgraph cluster_drew{
label = “fat-tree k = 6”
//establish core
subgraph cluster_core{
label = “core”
{ rank=same 0 1 2 3 4 5 6 7 8 }
0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 [color=grey arrowhead=none];
}
node [shape = record];
//establish nodes
0 [label = " 0 core-0 "]
1 [label = " 1 core-1 "]
2 [label = " 2 core-2 "]
3 [label = " 3 core-3 "]
4 [label = " 4 core-4 "]
5 [label = " 5 core-5 "]
6 [label = " 6 core-6 "]
7 [label = " 7 core-7 "]
8 [label = " 8 core-8 "]
9 [label = " 9 aggregation-9 "]
10 [label = " 10 aggregation-10 "]
11 [label = " 11 aggregation-11 "]
12 [label = " 12 edge-12 "]
13 [label = " 13 edge-13 "]
14 [label = " 14 edge-14 "]
15 [label = " 15 aggregation-15 "]
16 [label = " 16 aggregation-16 "]
17 [label = " 17 aggregation-17 "]
18 [label = " 18 edge-18 "]
19 [label = " 19 edge-19 "]
20 [label = " 20 edge-20 "]
21 [label = " 21 aggregation-21 "]
22 [label = " 22 aggregation-22 "]
23 [label = " 23 aggregation-23 "]
24 [label = " 24 edge-24 "]
25 [label = " 25 edge-25 "]
26 [label = " 26 edge-26 "]
27 [label = " 27 aggregation-27 "]
28 [label = " 28 aggregation-28 "]
29 [label = " 29 aggregation-29 "]
30 [label = " 30 edge-30 "]
31 [label = " 31 edge-31 "]
32 [label = " 32 edge-32 "]
33 [label = " 33 aggregation-33 "]
34 [label = " 34 aggregation-34 "]
35 [label = " 35 aggregation-35 "]
36 [label = " 36 edge-36 "]
37 [label = " 37 edge-37 "]
38 [label = " 38 edge-38 "]
39 [label = " 39 aggregation-39 "]
40 [label = " 40 aggregation-40 "]
41 [label = " 41 aggregation-41 "]
42 [label = " 42 edge-42 "]
43 [label = " 43 edge-43 "]
44 [label = " 44 edge-44 "]
//establish pods
subgraph cluster_pod_0 {
label = “pod_0”
{ rank=same 9 10 11 }
{ rank=same 12 13 14 }
}
subgraph cluster_pod_1 {
label = “pod_1”
{ rank=same 15 16 17 }
{ rank=same 18 19 20 }
}
subgraph cluster_pod_2 {
label = “pod_2”
{ rank=same 21 22 23 }
{ rank=same 24 25 26 }
}
subgraph cluster_pod_3 {
label = “pod_3”
{ rank=same 27 28 29 }
{ rank=same 30 31 32 }
}
subgraph cluster_pod_4 {
label = “pod_4”
{ rank=same 33 34 35 }
{ rank=same 36 37 38 }
}
subgraph cluster_pod_5 {
label = “pod_5”
{ rank=same 39 40 41 }
{ rank=same 42 43 44 }
}
//establish edges