Question: Write a PROLOG program to show the path from the root to the given destination. For example, ? - path ( y ) . a
Write a PROLOG program to show the path from the root to the given destination. For example,
pathy
a c h o v y
a Define a predicate connect to list the relation between two characters.
b Define a rule called path to find the path from root to the destination.
c Define a rule called path to find all paths from a node to another node that visit a specified number of nodes.
Eg pathc
c a b;
c a d;
c g n;
c h o;
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
