With many edges on a node, the 'ports' (the place where an edge connect with a node) are clustered too close together and are overlapping.
There is space to spread the ports out. Is there a way to 'justify' the spacing out of the ports?
I have read the docs but not found anything. I was hoping to either increase the number of ports, or find another solution. I already increased the margin to increase the node size and give more space for the edges:
B [label=B margin=1.6]
Example code:
digraph {
B [label=B margin=1.6]
C [label=C margin=1.6]
D [label=D margin=1.6]
F [label=F margin=1.6]
G [label=G margin=1.6]
H [label=H margin=1.6]
J [label=J margin=1.6]
K [label=K margin=1.6]
L [label=L margin=1.6]
M [label=M margin=1.6]
N [label=N margin=1.6]
P [label=P margin=1.6]
Q [label=Q margin=1.6]
R [label=R margin=1.6]
S [label=S margin=1.6]
T [label=T margin=1.6]
V [label=V margin=1.6]
W [label=W margin=1.6]
X [label=X margin=1.6]
Y [label=Y margin=1.6]
Z [label=Z margin=1.6]
B -> C [arrowhead=invdot arrowtail=dot dir=both]
B -> D [arrowhead=normal arrowtail=odot dir=both]
F -> B [arrowhead=empty arrowtail=odot dir=both]
G -> B [arrowhead=invdot arrowtail=odot dir=both]
B -> H [arrowhead=empty arrowtail=odot dir=both]
J -> B [arrowhead=normal arrowtail=dot dir=both]
B -> K [arrowhead=normal arrowtail=dot dir=both]
L -> B [arrowhead=invodot arrowtail=dot dir=both]
M -> B [arrowhead=empty arrowtail=dot dir=both]
B -> N [arrowhead=invdot arrowtail=odot dir=both]
P -> B [arrowhead=invdot arrowtail=odot dir=both]
B -> Q [arrowhead=empty arrowtail=dot dir=both]
B -> R [arrowhead=invdot arrowtail=dot dir=both]
S -> B [arrowhead=invodot arrowtail=dot dir=both]
B -> T [arrowhead=invdot arrowtail=odot dir=both]
B -> V [arrowhead=normal arrowtail=dot dir=both]
B -> W [arrowhead=invodot arrowtail=odot dir=both]
B -> X [arrowhead=invdot arrowtail=dot dir=both]
B -> Y [arrowhead=invodot arrowtail=odot dir=both]
B -> Z [arrowhead=invdot arrowtail=odot dir=both]
C -> B [arrowhead=normal arrowtail=dot dir=both]
D -> C [arrowhead=invdot arrowtail=odot dir=both]
F -> C [arrowhead=invodot arrowtail=odot dir=both]
C -> G [arrowhead=invodot arrowtail=dot dir=both]
H -> C [arrowhead=invdot arrowtail=dot dir=both]
C -> J [arrowhead=invdot arrowtail=odot dir=both]
C -> K [arrowhead=invodot arrowtail=odot dir=both]
C -> L [arrowhead=invodot arrowtail=dot dir=both]
M -> C [arrowhead=invdot arrowtail=dot dir=both]
N -> C [arrowhead=invodot arrowtail=dot dir=both]
P -> C [arrowhead=empty arrowtail=dot dir=both]
Q -> C [arrowhead=invodot arrowtail=odot dir=both]
R -> C [arrowhead=normal arrowtail=dot dir=both]
C -> S [arrowhead=invodot arrowtail=dot dir=both]
T -> C [arrowhead=invodot arrowtail=dot dir=both]
C -> V [arrowhead=invodot arrowtail=odot dir=both]
C -> W [arrowhead=normal arrowtail=odot dir=both]
X -> C [arrowhead=normal arrowtail=dot dir=both]
Y -> C [arrowhead=normal arrowtail=odot dir=both]
C -> Z [arrowhead=normal arrowtail=odot dir=both]
D -> B [arrowhead=invdot arrowtail=dot dir=both]
D -> C [arrowhead=normal arrowtail=odot dir=both]
D -> F [arrowhead=normal arrowtail=odot dir=both]
D -> G [arrowhead=normal arrowtail=dot dir=both]
D -> H [arrowhead=invodot arrowtail=odot dir=both]
J -> D [arrowhead=invdot arrowtail=dot dir=both]
K -> D [arrowhead=normal arrowtail=odot dir=both]
D -> L [arrowhead=empty arrowtail=odot dir=both]
D -> M [arrowhead=invdot arrowtail=dot dir=both]
D -> N [arrowhead=normal arrowtail=dot dir=both]
D -> P [arrowhead=invdot arrowtail=odot dir=both]
D -> Q [arrowhead=empty arrowtail=odot dir=both]
R -> D [arrowhead=invodot arrowtail=odot dir=both]
S -> D [arrowhead=empty arrowtail=dot dir=both]
D -> T [arrowhead=empty arrowtail=dot dir=both]
V -> D [arrowhead=empty arrowtail=odot dir=both]
W -> D [arrowhead=empty arrowtail=dot dir=both]
D -> X [arrowhead=empty arrowtail=dot dir=both]
Y -> D [arrowhead=invodot arrowtail=dot dir=both]
D -> Z [arrowhead=empty arrowtail=odot dir=both]
F -> B [arrowhead=normal arrowtail=dot dir=both]
C -> F [arrowhead=invodot arrowtail=odot dir=both]
F -> D [arrowhead=normal arrowtail=dot dir=both]
G -> F [arrowhead=normal arrowtail=odot dir=both]
F -> H [arrowhead=empty arrowtail=odot dir=both]
J -> F [arrowhead=empty arrowtail=dot dir=both]
K -> F [arrowhead=invodot arrowtail=odot dir=both]
F -> L [arrowhead=invodot arrowtail=odot dir=both]
F -> M [arrowhead=empty arrowtail=odot dir=both]
F -> N [arrowhead=invdot arrowtail=odot dir=both]
P -> F [arrowhead=empty arrowtail=odot dir=both]
F -> Q [arrowhead=empty arrowtail=odot dir=both]
F -> R [arrowhead=invdot arrowtail=odot dir=both]
F -> S [arrowhead=empty arrowtail=dot dir=both]
T -> F [arrowhead=normal arrowtail=odot dir=both]
V -> F [arrowhead=empty arrowtail=dot dir=both]
W -> F [arrowhead=empty arrowtail=odot dir=both]
F -> X [arrowhead=normal arrowtail=odot dir=both]
Y -> F [arrowhead=invodot arrowtail=dot dir=both]
Z -> F [arrowhead=invodot arrowtail=odot dir=both]
G -> B [arrowhead=empty arrowtail=dot dir=both]
C -> G [arrowhead=empty arrowtail=odot dir=both]
G -> D [arrowhead=empty arrowtail=odot dir=both]
F -> G [arrowhead=empty arrowtail=odot dir=both]
H -> G [arrowhead=invodot arrowtail=odot dir=both]
G -> J [arrowhead=invodot arrowtail=odot dir=both]
G -> K [arrowhead=empty arrowtail=odot dir=both]
G -> L [arrowhead=invdot arrowtail=dot dir=both]
G -> M [arrowhead=empty arrowtail=dot dir=both]
G -> N [arrowhead=empty arrowtail=odot dir=both]
G -> P [arrowhead=invdot arrowtail=odot dir=both]
Q -> G [arrowhead=invdot arrowtail=dot dir=both]
R -> G [arrowhead=invdot arrowtail=dot dir=both]
G -> S [arrowhead=invdot arrowtail=odot dir=both]
G -> T [arrowhead=empty arrowtail=dot dir=both]
V -> G [arrowhead=normal arrowtail=dot dir=both]
W -> G [arrowhead=empty arrowtail=dot dir=both]
G -> X [arrowhead=empty arrowtail=odot dir=both]
Y -> G [arrowhead=empty arrowtail=dot dir=both]
G -> Z [arrowhead=empty arrowtail=dot dir=both]
B -> H [arrowhead=invodot arrowtail=dot dir=both]
C -> H [arrowhead=invodot arrowtail=odot dir=both]
D -> H [arrowhead=invodot arrowtail=odot dir=both]
F -> H [arrowhead=invdot arrowtail=dot dir=both]
G -> H [arrowhead=normal arrowtail=dot dir=both]
J -> H [arrowhead=invdot arrowtail=odot dir=both]
K -> H [arrowhead=invdot arrowtail=dot dir=both]
L -> H [arrowhead=empty arrowtail=odot dir=both]
H -> M [arrowhead=empty arrowtail=odot dir=both]
H -> N [arrowhead=invodot arrowtail=dot dir=both]
P -> H [arrowhead=normal arrowtail=dot dir=both]
H -> Q [arrowhead=normal arrowtail=odot dir=both]
R -> H [arrowhead=empty arrowtail=odot dir=both]
S -> H [arrowhead=normal arrowtail=odot dir=both]
T -> H [arrowhead=empty arrowtail=dot dir=both]
V -> H [arrowhead=invodot arrowtail=dot dir=both]
W -> H [arrowhead=invdot arrowtail=dot dir=both]
X -> H [arrowhead=invodot arrowtail=dot dir=both]
H -> Y [arrowhead=invdot arrowtail=dot dir=both]
H -> Z [arrowhead=normal arrowtail=dot dir=both]
J -> B [arrowhead=invdot arrowtail=dot dir=both]
J -> C [arrowhead=normal arrowtail=dot dir=both]
D -> J [arrowhead=invodot arrowtail=dot dir=both]
J -> F [arrowhead=empty arrowtail=dot dir=both]
J -> G [arrowhead=normal arrowtail=dot dir=both]
J -> H [arrowhead=invdot arrowtail=odot dir=both]
J -> K [arrowhead=invdot arrowtail=odot dir=both]
L -> J [arrowhead=invdot arrowtail=dot dir=both]
J -> M [arrowhead=empty arrowtail=odot dir=both]
N -> J [arrowhead=invodot arrowtail=dot dir=both]
P -> J [arrowhead=empty arrowtail=dot dir=both]
J -> Q [arrowhead=invdot arrowtail=odot dir=both]
J -> R [arrowhead=empty arrowtail=dot dir=both]
S -> J [arrowhead=normal arrowtail=dot dir=both]
J -> T [arrowhead=invodot arrowtail=dot dir=both]
V -> J [arrowhead=normal arrowtail=dot dir=both]
W -> J [arrowhead=invdot arrowtail=odot dir=both]
J -> X [arrowhead=invdot arrowtail=odot dir=both]
Y -> J [arrowhead=empty arrowtail=odot dir=both]
J -> Z [arrowhead=normal arrowtail=dot dir=both]
B -> K [arrowhead=invdot arrowtail=odot dir=both]
C -> K [arrowhead=invdot arrowtail=dot dir=both]
K -> D [arrowhead=invodot arrowtail=dot dir=both]
F -> K [arrowhead=empty arrowtail=odot dir=both]
K -> G [arrowhead=invodot arrowtail=dot dir=both]
K -> H [arrowhead=empty arrowtail=dot dir=both]
K -> J [arrowhead=invdot arrowtail=dot dir=both]
L -> K [arrowhead=invdot arrowtail=odot dir=both]
M -> K [arrowhead=empty arrowtail=dot dir=both]
K -> N [arrowhead=invdot arrowtail=odot dir=both]
P -> K [arrowhead=normal arrowtail=dot dir=both]
Q -> K [arrowhead=normal arrowtail=odot dir=both]
R -> K [arrowhead=normal arrowtail=odot dir=both]
K -> S [arrowhead=empty arrowtail=dot dir=both]
K -> T [arrowhead=invdot arrowtail=odot dir=both]
K -> V [arrowhead=invodot arrowtail=odot dir=both]
W -> K [arrowhead=empty arrowtail=dot dir=both]
X -> K [arrowhead=invdot arrowtail=odot dir=both]
K -> Y [arrowhead=normal arrowtail=odot dir=both]
K -> Z [arrowhead=invdot arrowtail=odot dir=both]
L -> B [arrowhead=invodot arrowtail=odot dir=both]
C -> L [arrowhead=invdot arrowtail=dot dir=both]
D -> L [arrowhead=invdot arrowtail=dot dir=both]
F -> L [arrowhead=invdot arrowtail=odot dir=both]
G -> L [arrowhead=normal arrowtail=odot dir=both]
H -> L [arrowhead=invdot arrowtail=odot dir=both]
J -> L [arrowhead=normal arrowtail=dot dir=both]
K -> L [arrowhead=empty arrowtail=odot dir=both]
M -> L [arrowhead=normal arrowtail=odot dir=both]
N -> L [arrowhead=normal arrowtail=dot dir=both]
L -> P [arrowhead=normal arrowtail=odot dir=both]
Q -> L [arrowhead=invodot arrowtail=odot dir=both]
L -> R [arrowhead=invodot arrowtail=odot dir=both]
L -> S [arrowhead=empty arrowtail=dot dir=both]
L -> T [arrowhead=empty arrowtail=odot dir=both]
L -> V [arrowhead=invdot arrowtail=odot dir=both]
L -> W [arrowhead=normal arrowtail=odot dir=both]
L -> X [arrowhead=invdot arrowtail=dot dir=both]
L -> Y [arrowhead=empty arrowtail=odot dir=both]
Z -> L [arrowhead=empty arrowtail=dot dir=both]
M -> B [arrowhead=invdot arrowtail=dot dir=both]
M -> C [arrowhead=invdot arrowtail=dot dir=both]
M -> D [arrowhead=invdot arrowtail=dot dir=both]
F -> M [arrowhead=normal arrowtail=odot dir=both]
M -> G [arrowhead=empty arrowtail=dot dir=both]
M -> H [arrowhead=normal arrowtail=odot dir=both]
J -> M [arrowhead=invdot arrowtail=dot dir=both]
M -> K [arrowhead=invdot arrowtail=odot dir=both]
M -> L [arrowhead=invodot arrowtail=dot dir=both]
N -> M [arrowhead=invdot arrowtail=odot dir=both]
P -> M [arrowhead=invodot arrowtail=odot dir=both]
Q -> M [arrowhead=invodot arrowtail=odot dir=both]
R -> M [arrowhead=normal arrowtail=odot dir=both]
M -> S [arrowhead=invodot arrowtail=dot dir=both]
M -> T [arrowhead=normal arrowtail=dot dir=both]
V -> M [arrowhead=invdot arrowtail=odot dir=both]
W -> M [arrowhead=normal arrowtail=dot dir=both]
X -> M [arrowhead=invodot arrowtail=dot dir=both]
M -> Y [arrowhead=invdot arrowtail=dot dir=both]
M -> Z [arrowhead=invodot arrowtail=odot dir=both]
N -> B [arrowhead=normal arrowtail=dot dir=both]
C -> N [arrowhead=normal arrowtail=dot dir=both]
N -> D [arrowhead=invdot arrowtail=dot dir=both]
F -> N [arrowhead=invodot arrowtail=odot dir=both]
N -> G [arrowhead=invodot arrowtail=dot dir=both]
H -> N [arrowhead=invodot arrowtail=odot dir=both]
N -> J [arrowhead=empty arrowtail=odot dir=both]
N -> K [arrowhead=invodot arrowtail=odot dir=both]
L -> N [arrowhead=invdot arrowtail=dot dir=both]
M -> N [arrowhead=invodot arrowtail=odot dir=both]
P -> N [arrowhead=invdot arrowtail=dot dir=both]
Q -> N [arrowhead=invdot arrowtail=odot dir=both]
R -> N [arrowhead=empty arrowtail=dot dir=both]
S -> N [arrowhead=invodot arrowtail=dot dir=both]
N -> T [arrowhead=normal arrowtail=dot dir=both]
N -> V [arrowhead=normal arrowtail=odot dir=both]
W -> N [arrowhead=normal arrowtail=dot dir=both]
X -> N [arrowhead=invodot arrowtail=dot dir=both]
N -> Y [arrowhead=invodot arrowtail=odot dir=both]
Z -> N [arrowhead=empty arrowtail=odot dir=both]
B -> P [arrowhead=invdot arrowtail=odot dir=both]
C -> P [arrowhead=invdot arrowtail=dot dir=both]
D -> P [arrowhead=empty arrowtail=dot dir=both]
F -> P [arrowhead=invodot arrowtail=odot dir=both]
P -> G [arrowhead=invdot arrowtail=odot dir=both]
H -> P [arrowhead=invodot arrowtail=odot dir=both]
P -> J [arrowhead=invdot arrowtail=odot dir=both]
K -> P [arrowhead=invodot arrowtail=dot dir=both]
P -> L [arrowhead=invodot arrowtail=odot dir=both]
P -> M [arrowhead=invdot arrowtail=odot dir=both]
N -> P [arrowhead=invdot arrowtail=dot dir=both]
P -> Q [arrowhead=invdot arrowtail=dot dir=both]
R -> P [arrowhead=invdot arrowtail=odot dir=both]
S -> P [arrowhead=invodot arrowtail=dot dir=both]
P -> T [arrowhead=normal arrowtail=odot dir=both]
P -> V [arrowhead=normal arrowtail=odot dir=both]
W -> P [arrowhead=invdot arrowtail=dot dir=both]
X -> P [arrowhead=empty arrowtail=odot dir=both]
Y -> P [arrowhead=normal arrowtail=odot dir=both]
Z -> P [arrowhead=invdot arrowtail=odot dir=both]
B -> Q [arrowhead=invodot arrowtail=odot dir=both]
Q -> C [arrowhead=normal arrowtail=odot dir=both]
D -> Q [arrowhead=invodot arrowtail=dot dir=both]
Q -> F [arrowhead=normal arrowtail=odot dir=both]
G -> Q [arrowhead=invodot arrowtail=odot dir=both]
Q -> H [arrowhead=invdot arrowtail=odot dir=both]
J -> Q [arrowhead=empty arrowtail=dot dir=both]
Q -> K [arrowhead=invodot arrowtail=odot dir=both]
Q -> L [arrowhead=normal arrowtail=dot dir=both]
Q -> M [arrowhead=empty arrowtail=odot dir=both]
N -> Q [arrowhead=normal arrowtail=dot dir=both]
P -> Q [arrowhead=normal arrowtail=odot dir=both]
Q -> R [arrowhead=empty arrowtail=dot dir=both]
Q -> S [arrowhead=invdot arrowtail=dot dir=both]
T -> Q [arrowhead=normal arrowtail=dot dir=both]
V -> Q [arrowhead=empty arrowtail=dot dir=both]
W -> Q [arrowhead=empty arrowtail=odot dir=both]
X -> Q [arrowhead=invdot arrowtail=odot dir=both]
Q -> Y [arrowhead=invdot arrowtail=odot dir=both]
Z -> Q [arrowhead=invdot arrowtail=odot dir=both]
B -> R [arrowhead=normal arrowtail=dot dir=both]
C -> R [arrowhead=empty arrowtail=odot dir=both]
R -> D [arrowhead=normal arrowtail=odot dir=both]
R -> F [arrowhead=empty arrowtail=odot dir=both]
G -> R [arrowhead=empty arrowtail=dot dir=both]
R -> H [arrowhead=invodot arrowtail=odot dir=both]
J -> R [arrowhead=empty arrowtail=odot dir=both]
R -> K [arrowhead=invodot arrowtail=odot dir=both]
R -> L [arrowhead=invdot arrowtail=dot dir=both]
M -> R [arrowhead=empty arrowtail=odot dir=both]
N -> R [arrowhead=invdot arrowtail=dot dir=both]
P -> R [arrowhead=empty arrowtail=dot dir=both]
R -> Q [arrowhead=normal arrowtail=odot dir=both]
R -> S [arrowhead=empty arrowtail=dot dir=both]
R -> T [arrowhead=invdot arrowtail=dot dir=both]
R -> V [arrowhead=normal arrowtail=odot dir=both]
W -> R [arrowhead=invodot arrowtail=odot dir=both]
X -> R [arrowhead=normal arrowtail=odot dir=both]
R -> Y [arrowhead=invodot arrowtail=odot dir=both]
R -> Z [arrowhead=invdot arrowtail=odot dir=both]
S -> B [arrowhead=invodot arrowtail=dot dir=both]
C -> S [arrowhead=invodot arrowtail=dot dir=both]
D -> S [arrowhead=empty arrowtail=odot dir=both]
S -> F [arrowhead=empty arrowtail=dot dir=both]
S -> G [arrowhead=empty arrowtail=odot dir=both]
H -> S [arrowhead=invodot arrowtail=odot dir=both]
S -> J [arrowhead=invodot arrowtail=odot dir=both]
S -> K [arrowhead=empty arrowtail=odot dir=both]
S -> L [arrowhead=normal arrowtail=odot dir=both]
M -> S [arrowhead=invodot arrowtail=odot dir=both]
S -> N [arrowhead=invdot arrowtail=dot dir=both]
P -> S [arrowhead=invdot arrowtail=dot dir=both]
S -> Q [arrowhead=normal arrowtail=odot dir=both]
S -> R [arrowhead=empty arrowtail=dot dir=both]
T -> S [arrowhead=normal arrowtail=dot dir=both]
S -> V [arrowhead=invodot arrowtail=odot dir=both]
S -> W [arrowhead=empty arrowtail=odot dir=both]
X -> S [arrowhead=invdot arrowtail=dot dir=both]
S -> Y [arrowhead=invodot arrowtail=odot dir=both]
Z -> S [arrowhead=empty arrowtail=dot dir=both]
B -> T [arrowhead=normal arrowtail=dot dir=both]
C -> T [arrowhead=empty arrowtail=odot dir=both]
T -> D [arrowhead=invdot arrowtail=dot dir=both]
T -> F [arrowhead=invodot arrowtail=odot dir=both]
T -> G [arrowhead=invodot arrowtail=odot dir=both]
H -> T [arrowhead=normal arrowtail=odot dir=both]
T -> J [arrowhead=empty arrowtail=dot dir=both]
K -> T [arrowhead=normal arrowtail=odot dir=both]
T -> L [arrowhead=normal arrowtail=dot dir=both]
T -> M [arrowhead=invdot arrowtail=odot dir=both]
N -> T [arrowhead=empty arrowtail=dot dir=both]
P -> T [arrowhead=normal arrowtail=dot dir=both]
T -> Q [arrowhead=invdot arrowtail=odot dir=both]
R -> T [arrowhead=normal arrowtail=dot dir=both]
T -> S [arrowhead=invdot arrowtail=dot dir=both]
V -> T [arrowhead=normal arrowtail=odot dir=both]
W -> T [arrowhead=normal arrowtail=dot dir=both]
T -> X [arrowhead=invdot arrowtail=odot dir=both]
Y -> T [arrowhead=invodot arrowtail=odot dir=both]
Z -> T [arrowhead=normal arrowtail=dot dir=both]
V -> B [arrowhead=invodot arrowtail=dot dir=both]
V -> C [arrowhead=invdot arrowtail=dot dir=both]
V -> D [arrowhead=empty arrowtail=dot dir=both]
V -> F [arrowhead=invdot arrowtail=odot dir=both]
G -> V [arrowhead=invdot arrowtail=dot dir=both]
V -> H [arrowhead=invdot arrowtail=odot dir=both]
J -> V [arrowhead=invodot arrowtail=odot dir=both]
K -> V [arrowhead=invdot arrowtail=odot dir=both]
V -> L [arrowhead=empty arrowtail=dot dir=both]
M -> V [arrowhead=invodot arrowtail=dot dir=both]
N -> V [arrowhead=empty arrowtail=dot dir=both]
P -> V [arrowhead=normal arrowtail=dot dir=both]
Q -> V [arrowhead=empty arrowtail=dot dir=both]
V -> R [arrowhead=normal arrowtail=odot dir=both]
V -> S [arrowhead=invodot arrowtail=odot dir=both]
V -> T [arrowhead=invodot arrowtail=odot dir=both]
W -> V [arrowhead=empty arrowtail=dot dir=both]
V -> X [arrowhead=invdot arrowtail=odot dir=both]
V -> Y [arrowhead=invodot arrowtail=odot dir=both]
Z -> V [arrowhead=normal arrowtail=odot dir=both]
W -> B [arrowhead=normal arrowtail=odot dir=both]
C -> W [arrowhead=invdot arrowtail=odot dir=both]
D -> W [arrowhead=invdot arrowtail=dot dir=both]
F -> W [arrowhead=normal arrowtail=dot dir=both]
W -> G [arrowhead=invdot arrowtail=odot dir=both]
H -> W [arrowhead=normal arrowtail=odot dir=both]
W -> J [arrowhead=normal arrowtail=dot dir=both]
W -> K [arrowhead=normal arrowtail=odot dir=both]
W -> L [arrowhead=invdot arrowtail=odot dir=both]
M -> W [arrowhead=normal arrowtail=odot dir=both]
N -> W [arrowhead=normal arrowtail=odot dir=both]
W -> P [arrowhead=normal arrowtail=odot dir=both]
Q -> W [arrowhead=normal arrowtail=odot dir=both]
R -> W [arrowhead=invdot arrowtail=dot dir=both]
W -> S [arrowhead=empty arrowtail=odot dir=both]
T -> W [arrowhead=invdot arrowtail=dot dir=both]
W -> V [arrowhead=invodot arrowtail=dot dir=both]
W -> X [arrowhead=invodot arrowtail=odot dir=both]
Y -> W [arrowhead=invdot arrowtail=dot dir=both]
W -> Z [arrowhead=invdot arrowtail=dot dir=both]
X -> B [arrowhead=normal arrowtail=dot dir=both]
C -> X [arrowhead=empty arrowtail=odot dir=both]
X -> D [arrowhead=normal arrowtail=dot dir=both]
X -> F [arrowhead=empty arrowtail=dot dir=both]
X -> G [arrowhead=invdot arrowtail=odot dir=both]
H -> X [arrowhead=invodot arrowtail=odot dir=both]
J -> X [arrowhead=normal arrowtail=odot dir=both]
K -> X [arrowhead=empty arrowtail=dot dir=both]
X -> L [arrowhead=invdot arrowtail=dot dir=both]
M -> X [arrowhead=invdot arrowtail=odot dir=both]
X -> N [arrowhead=empty arrowtail=odot dir=both]
X -> P [arrowhead=invodot arrowtail=dot dir=both]
Q -> X [arrowhead=normal arrowtail=odot dir=both]
R -> X [arrowhead=empty arrowtail=dot dir=both]
X -> S [arrowhead=invodot arrowtail=dot dir=both]
X -> T [arrowhead=invodot arrowtail=dot dir=both]
X -> V [arrowhead=invodot arrowtail=dot dir=both]
X -> W [arrowhead=invdot arrowtail=odot dir=both]
Y -> X [arrowhead=normal arrowtail=dot dir=both]
X -> Z [arrowhead=invdot arrowtail=dot dir=both]
Y -> B [arrowhead=normal arrowtail=odot dir=both]
Y -> C [arrowhead=invodot arrowtail=odot dir=both]
D -> Y [arrowhead=empty arrowtail=odot dir=both]
F -> Y [arrowhead=normal arrowtail=dot dir=both]
Y -> G [arrowhead=empty arrowtail=odot dir=both]
Y -> H [arrowhead=invodot arrowtail=dot dir=both]
Y -> J [arrowhead=invodot arrowtail=dot dir=both]
Y -> K [arrowhead=invdot arrowtail=odot dir=both]
L -> Y [arrowhead=invdot arrowtail=dot dir=both]
M -> Y [arrowhead=empty arrowtail=odot dir=both]
N -> Y [arrowhead=invdot arrowtail=dot dir=both]
Y -> P [arrowhead=invodot arrowtail=dot dir=both]
Q -> Y [arrowhead=invodot arrowtail=dot dir=both]
R -> Y [arrowhead=invodot arrowtail=dot dir=both]
S -> Y [arrowhead=invodot arrowtail=odot dir=both]
T -> Y [arrowhead=empty arrowtail=dot dir=both]
Y -> V [arrowhead=invodot arrowtail=dot dir=both]
W -> Y [arrowhead=invdot arrowtail=dot dir=both]
X -> Y [arrowhead=normal arrowtail=dot dir=both]
Y -> Z [arrowhead=invdot arrowtail=dot dir=both]
Z -> B [arrowhead=normal arrowtail=dot dir=both]
C -> Z [arrowhead=empty arrowtail=dot dir=both]
D -> Z [arrowhead=normal arrowtail=odot dir=both]
Z -> F [arrowhead=invdot arrowtail=dot dir=both]
G -> Z [arrowhead=empty arrowtail=dot dir=both]
H -> Z [arrowhead=invodot arrowtail=odot dir=both]
Z -> J [arrowhead=empty arrowtail=odot dir=both]
Z -> K [arrowhead=invdot arrowtail=odot dir=both]
Z -> L [arrowhead=invodot arrowtail=dot dir=both]
M -> Z [arrowhead=normal arrowtail=odot dir=both]
Z -> N [arrowhead=invdot arrowtail=odot dir=both]
P -> Z [arrowhead=normal arrowtail=dot dir=both]
Q -> Z [arrowhead=empty arrowtail=odot dir=both]
R -> Z [arrowhead=normal arrowtail=odot dir=both]
S -> Z [arrowhead=invdot arrowtail=dot dir=both]
T -> Z [arrowhead=invodot arrowtail=odot dir=both]
Z -> V [arrowhead=normal arrowtail=dot dir=both]
Z -> W [arrowhead=empty arrowtail=odot dir=both]
Z -> X [arrowhead=empty arrowtail=odot dir=both]
Y -> Z [arrowhead=normal arrowtail=odot dir=both]
}
Graphviz defines 8 port locations on a node, based on points on a compass (n,s,e,w,ne,se,sw,nw) (https://graphviz.org/docs/attr-types/portPos/). This helps, but your nodes seem to "need" more than 8 positions.
e.g. B:ne -> D [arrowhead=normal arrowtail=odot dir=both]
Maybe you could try a mixture of explicit ports and implicit ports
Related
I want to separate the rectangles like this
or (3 items per line)
You were quite close. Most of the changes are just for (my) clarity. rank=same and dir=back
// https://stackoverflow.com/questions/72449201/how-to-sort-by-levels-in-graphviz
digraph {
{rank=same; a -> b -> c}
{rank=same; edge [dir=back] f -> e -> d }
{rank=same; g -> h -> i}
{rank=same; edge [dir=back] l -> k -> j }
c -> d
f -> g
i->j
}
Giving:
With respect to the following tree:
What is the correct inorder traversal?
U S T X C P Y R B A I G J F N H V T E D L
U S T X C P Y R B A D E I G J F N H V T L
What is the correct postorder traversal?
U T S X P R Y C B D I J G N V T H F E L A
U T S X P R Y C B I J G N V T H F E D L A
I evaluated both pairs. But some are saying 1-1 and 2-1 are correct, while others say 1-2 and 2-2 are correct. I'm confused. Which ones are actually correct?
inorder:
B U S T X C P Y R A D E I G J F N H V T L
postorder (2.2 is correct):
U T S X P R Y C B I J G N V T H F E D L A
I am a beginner in Mathematica and learning from Google.
I was trying to find the determinant of a 4*4 matrix.
TT = {{ap, b, c, d}, {e, fp, g, h}, {i, j, kp, l}, {m, n, o, pq}}
TT // MatrixForm
After it, I applied determinant command.
Det[TT]
I am getting result as follow,
d g j m - c h j m - d fp kp m + b h kp m + c fp l m - b g l m - d g i n + c h i n + d e kp n - ap h kp n - c e l n + ap g l n + d fp i o - b h i o - d e j o + ap h j o + b e l o - ap fp l o - c fp i pq + b g i pq + c e j pq - ap g j pq - b e kp pq + ap fp kp pq
I want above expression as a polynomial in p, want to collect coefficients separately. I have tried various command such as Collect, Factor etc. But each time I get the answer as the same polynomial as above.
I assume you have a*p, f*p, k*p, p*q, instead of ap, fp, kp and pq.
Mathematica needs either space or multiple sign to treat them as a separate multiplier and not as a variable.
t = {{a p, b, c, d}, {e, f p, g, h}, {i, j, k p, l}, {m, n, o,
p q}};
Collect[Det[t], p]
(* d g j m - c h j m - b g l m - d g i n + c h i n - c e l n -
b h i o - d e j o + b e l o + a f k p^4 q +
p (b h k m + c f l m + d e k n + a g l n + d f i o + a h j o +
b g i q + c e j q) +
p^2 (-d f k m - a h k n - a f l o - c f i q - a g j q - b e k q) *)
I got this dot graph and want the nodes A and D, B and E and C and F to be aligned. Here is the related dot code:
digraph{
A
B
C
D
E
F
{rank = same; B; C}
{rank = same; E; F}
A -> B [label="2", weight=2]
A -> C [label="0", style=dashed, weight=2]
B -> C [label="0", style=dashed, weight=2]
B -> D [label="2", style=dashed, weight=2]
C -> D [label="0", weight=2]
D -> E [label="1", style=dashed, weight=2]
D -> F [label="0", weight=2]
E -> F [label="0", weight=2]
F -> A
}
As you can see I already tried to apply weights to the edges, but that didn't work out
It is possible to use the group attribute of the nodes to suggest aligning the edges between nodes of the same group in a straight line.
Declare the nodes with the group attribute:
A [group=g1]
{rank = same; B[group=g2]; C[group=g3]}
D [group=g1]
{rank = same; E[group=g2]; F[group=g3]}
Then make sure all of those nodes have an (invisible) edge between them:
edge[style=invis];
A -> D
B -> E
C -> F
Everything together:
digraph G {
A [group=g1]
{rank = same; B[group=g2]; C[group=g3]}
D [group=g1]
{rank = same; E[group=g2]; F[group=g3]}
A -> B [label="2", weight=2]
A -> C [label="0", style=dashed, weight=2]
B -> C [label="0", style=dashed, weight=2]
B -> D [label="2", style=dashed, weight=2]
C -> D [label="0", weight=2]
D -> E [label="1", style=dashed, weight=2]
D -> F [label="0", weight=2]
E -> F [label="0", weight=2]
F -> A
edge[style=invis];
A -> D
B -> E
C -> F
}
It seems this must be a common scheduling problem, but I don't see the solution or even what to call the problem. It's like a topological sort, but different....
Given some dependencies, say
A -> B -> D -- that is, A must come before B, which must come before D
A -> C -> D
there might be multiple solutions to a topological sort:
A, B, C, D
and A, C, B, D
are both solutions.
I need an algorithm that returns this:
(A) -> (B,C) -> (D)
That is, do A, then all of B and C, then you can do D. All the ambiguities or don't-cares are grouped.
I think algorithms such as those at Topological Sort with Grouping won't correctly handle cases like the following.
A -> B -> C -> D -> E
A - - - > M - - - > E
For this, the algorithm should return
(A) -> (B, C, D, M) -> (E)
This
A -> B -> D -> F
A -> C -> E -> F
should return
(A) -> (B, D, C, E) -> (F)
While this
A -> B -> D -> F
A -> C -> E -> F
C -> D
B -> E
should return
(A) -> (B, C) -> (D, E) -> (F)
And this
A -> B -> D -> F
A -> C -> E -> F
A -> L -> M -> F
C -> D
C -> M
B -> E
B -> M
L -> D
L -> E
should return
(A) -> (B, C, L) -> (D, E, M) -> (F)
Is there a name and a conventional solution to this problem? (And do the algorithms posted at Topological Sort with Grouping correctly handle this?)
Edit to answer requests for more examples:
A->B->C
A->C
should return
(A) -> (B) -> (C). That would be a straight topological sort.
And
A->B->D
A->C->D
A->D
should return
(A) -> (B, C) -> (D)
And
A->B->C
A->C
A->D
should return
(A) -> (B,C,D)
Let G be the transitive closure of the graph. Let G' be the undirected graph that results from removing the orientation from G and taking the complement. The connected components of the G' are the sets you are looking for.