We implement an AI problem formulation. In AI, a problem is defined as an {Initial state, Goal state/test, Cost function, Actions}. Some formulations can also include the notion of transition models, but in our case, it is implicit.
We use these implementations and problem formulation to solve the problem of optimally finding the shortest route from City A to City B. The example cities used are conform with the ones listed in Artificial Intelligence: A modern approach (3rd edition), and shown on the image below: