prolog (and a given library as helper)kissat) to optimize solutions to the problemdownload all the files at Pràctica 4: Optimizació en SAT including the Makefile
we use minColoring.pl as an example
before looking at the code let’s understand the problem
Given G=(V,E) an undirected graph,
a function c : V\to \{1,\dots, k\} is a proper coloring (with k colors) of G if for every edge \{u,v\}\in E, c(u)\neq c(v). In other words, adjacent vertices must have assigned different colors (among the k available).
The chromatic number of G (\chi(G)) is the minimum number of colors needed to color G properly.
minColoring.pl (let’s look at it together)supermarket.pltowers.pl