// // Simple graph colouring // - not DIMACS format // - uses my own dynamic variable ordering heuristic // import java.io.File; import java.io.IOException; import java.util.Scanner; import org.chocosolver.solver.*; import org.chocosolver.solver.variables.*; import org.chocosolver.solver.constraints.*; import org.chocosolver.solver.search.strategy.strategy.IntStrategy; import org.chocosolver.solver.search.strategy.selectors.values.IntDomainMin; import org.chocosolver.solver.search.strategy.assignments.*; public class GColMyDVO { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(new File(args[0])); // graph file, not in DIMACS format int n = sc.nextInt(); // number of vertices int m = Integer.parseInt(args[1]); // number of colours Solver solver = new Solver("graph colouring with MyDVO"); IntVar[] v = VF.enumeratedArray("v",n,1,m,solver); // n vertices each with m colours int[] hot = new int[n]; for (int i=1;i