# Graph3D - Double Arrow in 3rd Dimension

Bug introduced in 10.0 and fixed in 11.3.0.
Graph3D is new in 10.0

I tried to visualize a simple graph and unexpectedly Graph3D produced a double arrow for multi-edges in the 3rd dimension:

Graph3D[
{0,1,2,3},
DirectedEdge@@@{{0,1},{1,0},{0,2},{2,0},{1,3},{3,1},{2,3},{3,2}},
VertexLabels->"Name",VertexLabelStyle->White,
VertexCoordinates->{{0,0,0},{0,0,1},{0,1,0},{0,1,1}},
Background->Black
]


Multi-edges in the 1st and 2nd dimension are rendered correctly with two separate arrows

Graph3D[
{0,1,2,3},
DirectedEdge@@@{{0,1},{1,0},{0,2},{2,0},{1,3},{3,1},{2,3},{3,2}},
VertexLabels->"Name",
VertexCoordinates->{{0,0,0},{0,1,0},{1,0,0},{1,1,0}},
Background->Black
]


Please help me understand this behavior. I would like my graph to have seperate arrows for all multi-edges.

• This may be a bug. The edges are definitely there, but MMA put them on top of each other. It works fine if you do NOT specify the VertexCoordinates. Jun 29, 2017 at 9:37

A workaround: Use a custom EdgeShapeFunction to modify the shapes of selected edges (0->1 and 2->3) using SetProperty:

edgeShape = Module[{g = #, vs = VertexList[{#2}], p},
pos = N[PropertyValue[{g, #}, VertexCoordinates]&/@vs];
Cases[Show[g][[1]], ar : Arrow[Tube[BezierCurve[{p[[1]], a_, p[[2]]}]],___] :>
(ar/. a->({-1, 1, 1}a)), Infinity]]&;

g0 = Graph3D[{0,1,2,3},
DirectedEdge @@@ {{0, 1}, {1, 0}, {0, 2}, {2, 0}, {1, 3}, {3, 1}, {2, 3}, {3, 2}},
VertexLabels -> "Name", VertexLabelStyle -> White,
VertexCoordinates->{{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}}, Background->Black]

Fold[Module[{es = edgeShape[##]},
SetProperty[{##}, EdgeShapeFunction -> (es&)]]&,
g0, {DirectedEdge[1, 0], DirectedEdge[2, 3]}]