程序代写代做代考 database graph algorithm html • The web pages

• The web pages
https://www.cpp.edu/~jrfisher/www/prolog_tutorial/2_15.html,
https://www.cpp.edu/~jrfisher/www/prolog_tutorial/2_16.html, and https://www.cpp.edu/~jrfisher/www/prolog_tutorial/5_1.html
discuss how to represent graphs in Prolog and how to implement graph search and the A* algorithm.

If we take a look at the road search example in Lecture 3, we could represent information about distances between towns as, e.g.

road_distance(‘Arad’, ‘Zerind’, 75).

and information about air distances to Bucharest as our lower-bound heuristic, e.g.

air_distance(‘Arad’, 366).

Create a program that will implement both greedy and A* search on this database in Prolog and return the path members and total distance of the shortest route between any town and Bucharest under either algorithm, e.g.

greedy(‘Timisoara’).

would return the value of the shortest path between Timisoara and Bucharest under the greedy algorithm and

a_star(‘Timisoara’).

would return the equivalent under A*.

Your program should be called navigator.pl.