v(1..6).
e(1,2). e(1,3). e(1,4).
e(2,4). e(2,5). e(2,6).
e(3,1). e(3,4). e(3,5).
e(4,1).
e(5,2). e(5,3). e(5,4). e(5,6).
e(6,2). e(6,3). e(6,5).
{ p(X,Y) } :- e(X,Y).
r(X) :- p(1,X).
r(Y) :- r(X), p(X,Y).
:- 2 {p(X,Y)}, v(X).
:- 2 {p(X,Y)}, v(Y).
:- not r(X), v(X).
#show p/2.
Resource created Monday 14 October 2019, 03:51:17 AM, last modified Monday 14 October 2019, 03:53:50 AM.
file: hamilton.lp