reset password
Author Message
rabbott
Posts: 1649
Posted 14:07 Sep 01, 2019 |

The current version (fifteen_puzzle.py or fifteen_puzzle.ipynb)) of the A* system uses all three search approaches: A*, DFS, and BFS.  The code also allows a specified starting point.

A starting point is included that has these properties.

# A* search    <=========== Fast and a short path.
# Expanded nodes: 20
# Elapsed time: 0.0 sec
# Path length: 16.

# Depth-first search    <=========== Fast, but a very(!) long path.
# Expanded nodes: 2631
# Elapsed time: 0.22 sec   <============  
# Path length: 2632.   <============

# Breadth-first search   <============  Very(!) slow, but a short path
# Expanded nodes: 116361   <==============
# Elapsed time: 84.49 sec   <============ 
# Path length: 16.   <============

Try it.

 

Last edited by rabbott at 21:00 Sep 01, 2019.