For every move from one configuration to another, connect the corresponding dots with an edge. If the move is not reversible, the edge must be directed . Otherwise, it's a plain curve connecting the two dots. If no such path exists the problem is unsolvable. In the Tower of Hanoi puzzle, disks stacked on one peg are to be moved to another with, perhaps an intermediate stop at a third, auxiliary peg.
Disks are all of different sizes and it's forbidden to place a bigger disk on top of a smaller one.
Number the pegs 1,2, and 3. A puzzle configuration is completely defined by a list of such peg numbers associated with every disk. To avoid ambiguity the disks are ordered according to their sizes, with the smallest being the first. For a puzzle with two disks, there are 9 possible configurations. We'll tacitly focus on the legitimate disks positions.