Skip to content

A* search for 3-disk Tower of Hanoi (inspired by ai-class.com exam question)

Notifications You must be signed in to change notification settings

yassam/a_star_tower_of_hanoi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

A* search for the Tower of Hanoi using 3 rods.

I wrote this to work out how many steps needed for the optimal solution for
the 4 disk case. This was part (c) of Q1 on the final of ai-class.com
(Dec 2011).

This is my first implementation of A* search and although it seems to work for
this particular case (solving the 3-rod Tower of Hanoi game) it could have
bugs.

Amazingly, everything I needed to solve this was given in one algorithm which
I copied from a video lesson given by Peter Norvig given from the AI class.
I didn't need to look at other code or anything else - it's all in the lessons!

TO RUN
------
Works on Python 2.7 (should work on earlier versions of Python - but haven't
tested on them).

Just type 'python astar_search.py' and enter the number of disks.

It will calculaute the number of steps for the optimal solution.

You can also display the list of steps needed to solve it.



Yasir Assam

About

A* search for 3-disk Tower of Hanoi (inspired by ai-class.com exam question)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages