When trying to find cheap airfares, one often encounters itineraries and routes that are convoluted to say the least. Here we exploring routing through a hypothetical airline's system to locations that may be off the beaten path. Any resemblance these routes bear to itineraries suggested by on-line travel planners is purely coincidental.
The bulk of the code for this problem set can be loaded by route-finding.scm. The large data file is in airroutes_long.scm and a smaller example is in airroutes_short.scm.
The main search function is (general-search search-problem queuing-function). This function returns a node in the goal state, if one exists, that represents a single successful path from the start to the goal. It prints out the successors as nodes are expanded.
The function (solution-nodes node '()) will return the list of airports from start to goal in the path, when node is output of the general-search function. Please use this function to display the route found to your solution node.
The variables big-airport-map and little-airport-map are bound to a lists of airports. The Romanian road map example from the text is stored as *romanian-map*.
What problem you observe?
Fix the problem in expand and hand in your code and the output of a run on the above example to demonstrate that it works.
Implement a function breadth-first. Debug using the small test data set.
When your code is operational, load the big-airport-map and run (breadth-first 'newark 'san-francisco big-airport-map). Hand in your function code, and the verbose output from the run.
Implement a version of a-star search. Run your version of a-star on the above example. Consider using a hash table to implement dynamic programming.
You will probably need to modify some of the data abstractions since we are now concerned with path costs as well. We have included a function straight-line-distance to aid in your search.
What differences are there? What savings do you gain?