Skip to content

preeti276/Tower-of-Hanoi-Search-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Tower Of Hanoi

Solving the Tower of Hanoi problem using search algorithms

We will solve the famous Tower of Hanoi problem by creating an efficient representation of the problem to be used with the search algorithms. The search algorithms used are A* search and Breadth-first search. A* search algorithm will be implemented with different hueristics, including the pattern database hueristic. The details of each hueristic and corresponding results are presented in report. Furthermore, the algorithms are created for a general n-disc problem and the corresponding results with different values of n are also presented in report.

How to run the code

To run the code, the following command needs to be run on the console/command line with the necessary arguments:
python -m < m-value > --heuristic < Heuristic name > < n-value > Tower_of_Hanoi.py

--help can be used to access values of arguments : "Number of discs" "--heuristic": :'disksNotOnRightmost','distancefromlastpeg','Blind','PDB', default="disksNotOnRightmost" "-m" : : m<=n, default=0 , This argument is only needed for PDB

The core concept of off-the-shelf solver used in the algorithm is demonstarted through my linkedIn article: https://www.linkedin.com/pulse/exploring-off-the-shelf-solvers-classic-search-problems-preeti-sethi/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages