Question: 3 Searching using Prolog 3 . 1 Finding a path Consider the plan of a house as shown in Fig. 1 . Write a Prolog
Searching using Prolog
Finding a path
Consider the plan of a house as shown in Fig. Write a Prolog description of this plan that allows a Prolog program search for paths between locations indicated on the plan. For example, if one is Outside and wishes to find a path to the WC then a possible answer can be: Outside Porch Kitchen Leaving Room Corridor WC Your program should
Figure : Top view of a two bedroom house showing how different locations in and out of the house are connected.
avoid loops and be as general as possible, in that, given any two locations representing an origin and a destination it returns:
a path from to if it exists;
every possible path from to if there are more than one;
meaningful error messages, if the wrong input is provided for and
Comment the code submitted for this part to contain the name of the search algorithm that you selected to find the path.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
