Drawing graphs with dot p. 16 they draw a separate chaining hash table. "Records sometimes look better if their input height is set to a small value."
nodesep=0.05;
node [width=.1, height=.1];
I would like to draw an open addressing scheme type graph that has one node and different ports to represent items in the hash table; the ports have interconnections based on their closed address.
digraph {
node [shape=plain, style=filled, fillcolor="Gray95"];
edge [arrowsize=0.5];
set [label=<<TABLE BORDER="0">
<TR><TD BGCOLOR="Gray90" PORT="0">0x0</TD></TR>
<TR><TD>0x1</TD></TR>
<TR><TD BGCOLOR="Gray90" PORT="2">0x2</TD></TR>
<TR><TD PORT="3">0x3</TD></TR>
<TR><TD BGCOLOR="Gray90" PORT="4">0x4</TD></TR>
<TR><TD PORT="5">0x5</TD></TR>
<TR><TD BGCOLOR="Gray90" PORT="6">0x6</TD></TR>
<TR><TD ALIGN="RIGHT" PORT="7">0x7</TD></TR>
</TABLE>>];
set:2:e -> set:3:e;
set:3:e -> set:4:e;
set:6:e -> set:7:e;
set:0:e -> set:5:e;
}
Which results in the following graph. It's loops are much to big, and overlapping with other loops that makes it very difficult to read.
It appears that the spline strongly wants to leave the node and spend a certain amount of time out before re-entering. So I thought these might work. However, the ones that looked promising don't appear to work with edges that loop back to the same shape. Related question.
splines=none; // doesn't draw edges
splines=ortho; // draws concentric circles around node?
splines=curved; // draws one nice and gives up
splines=true; // default; draws a huge mess
splines=polyline; // angled, auto-edges no different
splines=false; // straight, auto-edges no different
I tried overlap, maybe the edges to be drawn more relaxed?
overlap=true; // no effect
graph [overlap=true]; // no effect
mclimit=6; // no effect
Maybe if I make the size bigger or the arrows smaller it will give more space?
node [fontsize=48]; // big, but no effect on the edges
edge [arrowsize=0.5]; // small, but otherwise no effect
edge [weight=3, minlen=3]; // again, there is only one shape
I tried compass ":c" (for centre?) and ":_" (appears to be similar to north) and ":e" and ":w" in alternation, but no luck. Is there something that could make these loops smaller in size?
Gave up on a single node & packed in multiple nodes.
digraph {
rankdir=LR
nodesep=".02"
splines=true //line //false //curved
node [shape=rect, style=filled, fillcolor="Gray95", height=0 width=0 margin=".01,.01"];
edge [arrowsize=0.5 constraint=false];
N0 [label="0x0"]
N1 [label="0x1"]
N2 [label="0x2"]
N3 [label="0x3"]
N4 [label="0x4"]
N5 [label="0x5"]
N6 [label="0x6"]
N7 [label="0x7"]
N2:e -> N3:e
N3:e -> N4:e
N6:e -> N7:e
N0:e -> N5:e
// following edges keep nodes in order
edge [weight=200 style=invis]
N0 -> N1
N1 -> N2
N2 -> N3
N3 -> N4
N5 -> N6
N6 -> N7
}