stackoverFlow Error for some Shortest Path
Posted: 21 Feb 2014 12:53
hi
i write a simple program to show the path in node
it's working for node who is direct connected but i have Error when it's connected by another node
i write a simple program to show the path in node
it's working for node who is direct connected but i have Error when it's connected by another node
Code: Select all
connected(Window,X,Z):-edge(X,Z,L),L>"0",
nVal:=nVal+toterm(L),
stdio::write(X, " to ",Z," by weight ", L," all ",nVal,"\n"),!.
connected(Window,X,Z):-edge(X,Y,L),L>"0",
connected(Window,Y,Z),nVal:=nVal+toterm(L),
stdio::write(X, " to ",Y," by weight ", L," all ",nVal,"\n"),!.
connected(_Window,_X,_Y).