Attachment 'maximal-monochrome-paths.core.asp.txt'
Download 1 % guess
2 in(X) v out(X) :- node(X).
3
4 % enforce condition 1
5 :- in(X), in(Y), monochrome_path(X,Y,C).
6
7 % auxiliary predicate
8 monochrome_path(X,Y,C) :- edge(X,Y,C).
9 monochrome_path(X,Y,C) :- monochrome_path(X,Z,C), edge(Z,Y,C).
10
11
12 % enforce condition 2
13 connected(X) :- edge(X, A, B), in(Y), monochrome_path(X,Y,C), X != Y.
14 :- out(X), not connected(X).
Attached Files
You are not allowed to attach a file to this page.