Re: A simple (?) graph algorithm

From: pimko (profesorpimko_at_wp.pl)
Date: 05/10/04


Date: 10 May 2004 04:50:14 -0700

Hi
Sorry it's so late but I've been very busy recently. It goes like this:

connected(X,Y):-e(X,Y).
connected(X,Y):-e(X,Z),connected(Z,Y).

allconnected(X,[X]):- \+ connected(_,X).
allconnected(X,List):- setof(Y,connected(Y,X),List1),append(List1,[X],List).

Hope it's right

Best regards
pimko