# Encoding hierarchical-clustering_chk.lp

Name hierarchical-clustering_chk.lp [Root]    Miscellaneous (45)    ASP Contest 09 (45) Martin Gebser Martin Gebser and Roland Kaminski 2009-03-13 21:35 2009-03-13 21:43 No #hide. #show levelvtx/2. #show parentedge/2. :- parentedge(P,U), not vtx(P). :- parentedge(P,U), not vtx(U). :- parentedge(P,U), not uedge(P,U), P < U. :- parentedge(P,U), not uedge(U,P), P > U. :- parentedge(P,U), levelvtx(1,U). :- levelvtx(L,U), not vtx(U). :- levelvtx(L,U), not levels(L). % normalize graph uedge(U,V) :- edge(U,V), U < V. uedge(U,V) :- edge(V,U), U < V. % every vertex is exactly on one level :- not 1 { levelvtx(L,U) : levels(L) } 1, vtx(U). % a vertex U on level L>1 has exactly one parentedge :- not 1 { parentedge(P, U) : uedge(P, U), parentedge(P, U) : uedge(U, P) } 1, levelvtx(L,U), L > 1. % the parentedge vertex must have level L-1 :- levelvtx(L,V),parentedge(P,V), not levelvtx(L-1,P). % every cluster has at most b elements :- not { parentedge(P,U) : vtx(U) } B, vtx(P), bound(B). % level one is handled specially :- not { levelvtx(1,U) : vtx(U) } B, bound(B). % every cluster is a clique :- parentedge(P,U), parentedge(P,V), U < V, not uedge(U,V). % level one is handled specially again :- levelvtx(1,U), levelvtx(1,V), U < V, not uedge(U,V).