I'm fond of the default vertex and edge layout for a directed graph:
edges = {1 -> 2, 0 -> 2, 0 -> 4, 0 -> 1, 0 -> 3, 2 -> 4, 1 -> 2,
2 -> 3, 1 -> 4, 3 -> 4, 1 -> 3, 0 -> 1, 1 -> 2, 1 -> 3, 1 -> 4,
2 -> 3, 2 -> 4, 3 -> 4, 0 -> 1, 0 -> 1, 0 -> 2, 1 -> 2};
Graph[edges]
I want to use this layout for an "equivalent" undirected graph, or at least one with no arrows drawn. The default layout however is different:
Graph[UndirectedEdge @@@ edges]
There is no GraphLayout
option (in v11.2
) that yields the same layout, possibly due to the undirected edges being weighted different than directed ones in the layout algorithms. Can I force Mathematica to use the directed graphs embedding? I only need the ultimate Graphics
from Show[graph]
.
g
already, you can do something likeDirectedGraph[g, "Acyclic", GraphLayout -> "LayeredDigraphEmbedding", EdgeShapeFunction -> "Line"]
$\endgroup$