Search code examples
algorithmgraphtowers-of-hanoi

How to represent a Towers of Hanoi problem using a graph?


I am not able to figure out how the graphs shown here are constructed?

For example, what does this graph represent?

alt text
(source: wikimedia.org)

"Nodes are distribution of discs", but I will only have one disc of size a. So, what does node aa represent?

I know the answer would be simple, but I cannot figure it out at the moment.


Solution

  • a, b and c are the three pegs. So aa means that the two discs are on peg a.