Question: In prolog how do I just output only the shortest list. Please give me a newbie friendly code in prolog, ?- path(0,2,Path). Path = [0,

In prolog how do I just output only the shortest list. Please give me a newbie friendly code in prolog, ?- path(0,2,Path). Path = [0, 1, 2] ; Path = [0, 3, 2] ; Path = [0, 1, 4, 2] ; Path = [0, 3, 4, 2] ; Path = [0, 1, 4, 5, 3, 2] ;

I want the output as

?- path(0,2,Path). Path = [0, 1, 2] ; Path = [0, 3, 2] ; false.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!