#hide. #external arc(X,Y). #show arc(X,Y). %% input #show hc(X,Y). %% output #domain node(X;Y). #options -d none. node(1..n). 2 { hc(X,Y1): node(Y1), hc(Y1,X): node(Y1) } 2. %% (*) :- hc(X,Y), not arc(X,Y). % 1 { hc(X,Y1): node(Y1) } 1. %% in the optimized version % 1 { hc(Y1,X): node(Y1) } 1. %% replacement of (*)