Skip to main content
2 of 8
added 92 characters in body
yode
  • 27.2k
  • 4
  • 66
  • 174

As this article,I think we want to find all of the Eulerian path.But Mathematica have no such function to do this directly.So I will delete the edge 1 <-> 2 first,then use FindEulerianCycle like follow: ###Make a intermediate graph without edge 1 <-> 2:

pts = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {1/2, 1 + Sqrt[3]/2}};
g = EdgeDelete[
  Graph[{1 <-> 2, 2 <-> 3, 3 <-> 4, 1 <-> 3, 1 <-> 4, 2 <-> 4, 
    4 <-> 5, 3 <-> 5}, VertexCoordinates -> pts, 
   VertexLabels -> "Name"], 1 <-> 2]

[![enter image description here][1]][1] ###Find all of the Eulerian path

Prepend[#, 1 <-> 2] & /@ FindEulerianCycle[g, All]

[![enter image description here][2]][2]

PS:I found the vertex $3$ and $4$ is completely equivalent.So you can find another $6$ path.(Actually I think this is a bug of FindEulerianCycle which can find another $6$ path.) [1]: https://i.sstatic.net/rJScR.png [2]: https://i.sstatic.net/oBG9a.png

yode
  • 27.2k
  • 4
  • 66
  • 174