Lab 3: Uniform-Cost Search
Objective
To create Python script to execute uniform cost search algorithm.
Problem to be solved
We will revisit Nick’s route-finding problem in Romania, starting in Arad to reach Bucharest, and implement uniform-cost search to solve the problem.
Uniform cost search changes the sorting of the frontier by ordering it with its path cost up to the leaf node and expanding the leaf node with the lowest cost.
-
Based on the code from previous lab, add the code to sort the frontier following the path cost up to the leaf node.
-
If a latter-found node has the same state as a previous node and the previous node has been expanded, what should be done?
-
What happens when a latter-found node has the same state as a previous node and have a shorter path cost? How do we implement this in our code?
-
Note also, the goal test should be applied during expansion, not generation.
Execute the program and investigate if the program is working correctly.