Skip to main content
4 of 8
added 516 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 ###Find all of the Eulerian path

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

enter image description here

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 cannot find another $6$ path.)

yode
  • 27.2k
  • 4
  • 66
  • 174