welcome: please sign in
location: attachment:Graph-Colouring-ENCODING.txt of OfficialProblemSuite

Attachment 'Graph-Colouring-ENCODING.txt'

Download

   1 % Guess colours.
   2 chosenColour(N,C) | notChosenColour(N,C) :- node(N), colour(C).
   3 
   4 % At least one color per node.
   5 :- node(X), not colored(X).
   6 colored(X) :- chosenColour(X,Fv1).
   7 
   8 % Only one color per node.
   9 :- chosenColour(N,C1), chosenColour(N,C2), C1!=C2. 
  10 
  11 % No two adjacent nodes have the same colour. 
  12 :- link(X,Y),  X<Y, chosenColour(X,C), chosenColour(Y,C).

Attached Files

You are not allowed to attach a file to this page.