link(entry, a). link(a, b). link(b, c). link(c, d). link(d, e).
link(b, e). link(e, f). link(f, c).
link(f, exit).
route(1, 2) :- member(1, [entry,a,b,c