Are these graphs isomorphic ? Why?

46 Views Asked by At

enter image description here

Are these 5 vertex 5 edge graphs isomorphic ? Why ?

1

There are 1 best solutions below

0
On BEST ANSWER
g1 = Graph[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 1, 4 -> 5},
  DirectedEdges -> False];

enter image description here

    g2 = Graph[{"a" -> "b", "b" -> "c", "c" -> "d", "d" -> "a", 
   "d" -> "e"},
  DirectedEdges -> False,
  VertexCoordinates -> {{0, 0}, {1, 1}, {0, 1}, {1, 0}, {2, 1}}]

enter image description here

IsomorphicGraphQ[g1, g2]

True

Why? Because there is a mapping from each vertex in g1 to a vertex in g2 that preserves all edges.