color(1..size). % there are "size" different colors.

1 { select(V,C) : color(C) } 1 :- vertex(V). % each vertex is assigned exactly one C such that C is a color
:- edge(U,V), select(U,C), select(V,C). % no adjacent vertices can be assigned the same color

Resource created 6 years ago, last modified 6 years ago.

file: coloring.lp


Loading...


Back to top

COMP4418 19T3 (Knowledge Representation and Reasoning) is powered by WebCMS3
CRICOS Provider No. 00098G