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 Monday 28 October 2019, 08:38:17 AM, last modified Monday 28 October 2019, 10:59:09 AM.

file: coloring.lp


Back to top

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