I need a program (written in prolog) which outputs THE SHORTEST path through oriented graph (all points) which are defined like this:
conn(a,b,3). <- you can travel only from a to b but not from b to a
conn(a,c,10). conn(c,a,10).<- this means that you can travel in both directions between a and c
etc... (program naturally has to work with larger amount of points - let's say about 100 different points). Path should start and end in same point.
connections are defined as
No need to optimize the program to run fast so I would appreciate the simpliest possible solution so I can understand and modify it then (I'm not very good in prolog programming)
I would appreciate output something like this (in this case):
where length is the distance we travelled and path is the order of points we visited. In this case we travel only through points in alphabetical order. But program has to work also let's say with following set of points:
Thanx for any help!