% c-colorability by Ilkka Niemelä % % requires the graph as facts vertex(.) and arc(.,.) % Usage, e.g., % UNIX> cat color.lp graphs/p100 | lparse -1 -c c=4 -d none | smodels % Facts color(V,C) in the stable model provide a coloring of the graph. color(V,C):- vertex(V), col(C), not othercolor(V,C). othercolor(V,C) :- vertex(V), col(C), col(C1), C != C1, color(V,C1). :- arc(V1,V2), col(C), color(V1,C), color(V2,C). col(1..c).