750 likes | 1.01k Views
Coloration des graphes de reines . michel.vasquez@mines-ales.fr LGI2P Ecole des Mines d’Alès. Outline. About the Queen Graph Coloring Problem Definition Conjecture ? A Complete Algorithm Reformulation of the coloring problem Efficient filtering A Geometric Based Heuristic
E N D
Coloration des graphes de reines michel.vasquez@mines-ales.fr LGI2P Ecole des Mines d’Alès
Outline • About the Queen Graph Coloring Problem • Definition • Conjecture ? • A Complete Algorithm • Reformulation of the coloring problem • Efficient filtering • A Geometric Based Heuristic • Geometric Operators • Results synthesis • Coloring Extension
Rule for moving the queen on the chessboard • Each queen controls: • 1 column • 1 row • 2 diagonals
Graph definition • 1 square of the chessboard vertex • 2 squares controlled by the same queenedge
Graph definition: from chessboard to queen graph a queen graph instance G(V,E) with :V n2 vertices and E n3 edges
The QueenGraph Coloring Problem: definition Given a chessboard, what is the minimum number of colors required to cover it without clash between two queens of the same color ?
The Queen Graph Coloring Problem: what we know The chromatic number of Queen-72is 7 : (7) 7 (and (n) n if n is prime with 2 and 3)
Conjecture ? The chromatic number of the Queen Graph is equal to n if and only if n is prime with 2 and 3 • M. Gardner,1969 : The Unexpected Hanging and Other Mathematical Diversions, Simon and Schuster, New York.
Conjecture ? The chromatic number of the Queen Graph is equal to n if and only if n is prime with 2 and 3 The chromatic number of the Queen Graph is equal to n if and only if n is prime with 2 and 3 • E. Y. Gik,1983 : Shakhmaty i matematika, Bibliotechka Kvant, vol. 24, Nauka, Moscow.
Until 2003 no result are available for the queen graph chromatic number when n is greater than 9 and n is multiple of 2 or 3
Outline • About the Queen Graph Coloring Problem • A Complete Algorithm • Reformulation of the coloring problem • Efficient filtering • A Geometric Based Heuristic • Geometric Operators • Results synthesis • Coloring Extension
Property (1) • The n rows, the n columns and the 2 main diagonals are cliques with n verticesof the Queen-n2 graph • (n) n
Question (1) For a given n, is (n) equal to n ? saying it differently Is there a partition of the Queen-n2 graph in n independent sets ?
Property (2) • A stable set cannot contain more than n vertices To answer yes to question (1) and cover nn squares : each independent set must contain at least n vertices
Question (2) • Are there n independent sets with exactly n vertices which do not cover themselves ?
General Algorithm Step 1) Enumerate the independent sets with n vertices (n queens that do not attack themselves) Step 2) Findn among them which do not intersect (solve the CSP)
Avoiding many equivalent coloring permutations n squares belonging to a same clique are colored once for all:
Computing IS by backtracking • Enumeration : backtracking
A CSP with n variables (corresponding to a n squares) • Spreading of the independent sets for Queen-102
Branching on the smallest domain variable • Non overlapping constraints propagation • The search space size is decreasing geometrically
First result n = 10 : no solution 7000 seconds (10) = 11
Filtering (principle) • Consider the cliques of the graph constituted by the uncolored vertices • If such a clique contains k vertices then you need at least k colors (i.e. k independent sets) to complete the process
Efficient Filtering (computationally) • Diagonals constitute cliques (and are easy to handle): • for a given diagonal there is at most one vertex that can come from a specific stable set, • at level k of the search tree, diagonals must contain less than n-k empty squares Delete all the independent sets that do not verify this condition
Efficient Filtering (experimentally) • At the root of the search tree this independent set is excluded from the search space
Efficient Filtering (experimentally) • Search space reduction
Efficient Filtering (experimentally) • At each level : 4 more constraints
First Results : complete method • (10) no solution 1second (maximum depth of backtrack in the search tree : 5 rather than 10) • (12) 12 454 solutions 6963seconds (exhaustive search) • (14) 14 1 solution en 142 hours (search aborted after one week)
Interest of filtering • Comparative results on n=12
Outline • About the Queen Graph Coloring Problem • Definition • Intox/Conjecture ? • A Complete Algorithm • Reformulation of the coloring problem • Efficient filtering • A Geometric Based Heuristic • Geometric Operators • Results synthesis • Coloring Extension
Exact but incomplete method • Assumption on the distribution of the colors on the chessboard • Enumerate several independent sets at the same time
Geometric operator (1) n = 2 p symmetry H Search tree depth: n/2 (22) 22
Geometric operator (1) n = 2 p symmetry H Search tree depth: n/2 (22) 22
Geometric operator (1) n = 2 p symmetry H Search tree depth: n/2 (22) 22
Geometric operator (2) n = 3 p central symmetry Search tree depth: (n/2) - 1 (15) 15
Geometric operator (2) n = 3 p central symmetry Search tree depth: (n/2) - 1 (15) 15
Geometric operator (2) n = 3 p central symmetry Search tree depth: (n/2) - 1 (15) 15
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (3) n = ( 4 p ) + 1 /2 rotations: R, R2 et R3 Search tree depth: (n/4) - 1 (21) 21
Geometric operator (4) n = ( 4 p ) symmetries H & V Search tree depth: (n/4) (32) 32
Geometric operator (4) n = ( 4 p ) symmetries H & V Search tree depth: (n/4) (32) 32