Computing the chromatic number for block intersection graphs of Latin squares Ed Sykes CS 721 project McMaster University, December 2004 Slide 1
A Latin square is a combinatorial structure that plays a large role in the combinatorial design theory. A Latin square is a square matrix of positive integers so that the sum of each column and each row gives the same number: Slide 2 10
Slide 3 A block of a Latin square is formed by a triple {i,j,a ij } where i is the row index, j is the column index, and a ij the entry at that position. For the purpose of creating the block intersection graph, we make sure that the set of row indexes and the set of column indexes are disjoint:
Slide 4 a b c e d A B C D E {A,a,0} {A,b,1} {A,c,2} {A,d,3} {A,e,4} {B,a,1} {B,b,3} {B,c,0} {B,d,4} {B,e,2} {C,a,2} {C,b,4} {C,c,1} {C,d,0} {C,e,3} {D,a,3} {D,b,2} {D,c,4} {D,d,1} {D,e,0} {E,a,4} {E,b,0} {E,c,3} {E,d,2} {E,e,1}
Slide 5 The block intersection graph of a Latin square is formed by the blocks as the vertices and two blocks form an edge if their intersection is non-empty.
Slide 6 {C,a,2} {C,b,4} {C,c,1} {C,d,0} {C,e,3} {D,a,3} {D,b,2} {D,c,4} {D,d,1} {D,e,0} {E,a,4} {E,b,0} {E,c,3} {E,d,2} {E,e,1} {A,a,0} {A,b,1} {A,c,2} {A,d,3} {A,e,4} {B,a,1} {B,b,3} {B,c,0} {B,d,4} {B,e,2} See some edges:
Slide 7 A complete adjacency matrix for the graph is shown here:
Slide 8 A colouring of a graph is an assignment of colours to vertices so that no two adjacent vertices get the same colour: For our block intersection graph:
Slide 9 {A,b,1} gets colour 1 {A,c,2} gets colour 2 {A,d,3} gets colour 3 {A,e,4} gets colour 4 {B,a,1} gets colour 2 {B,b,3} gets colour 4 {B,c,0} gets colour 3 {B,d,4} gets colour 5 {B,e,2} gets colour 1 {C,a,2} gets colour 4 {C,b,4} gets colour 2 {C,c,1} gets colour 5 {C,d,0} gets colour 1 {C,e,3} gets colour 0 {D,a,3} gets colour 5 {D,b,2} gets colour 3 {D,c,4} gets colour 0 {D,d,1} gets colour 4 {D,e,0} gets colour 2 {E,a,4} gets colour 3 {E,b,0} gets colour 5 {E,c,3} gets colour 1 {E,d,2} gets colour 0 {E,e,1} gets colour 6
Slide 10 The chromatic number of a graph is the smallest number of colours one can use to colour the graph. Thus computing the chromatic number of a graph is a combinatorial problem of finding the smallest colouring among all colourings. Prof. Franek asked me to design and implement a simple bound-and-branch backtracking program in C++ to compute chromatic numbers of block intersection graphs of various Latin squares.
The input into the program is a line that represents row by row format of a Latin square. Slide 11 1.The “real” Latin square is computed and displayed 2.The blocks are computed and displayed. 3.The block intersection graph is computed in the form of the adjacency matrix and displayed.
Slide 12 4.The maximum degree (=number of adjacent vertices to a given vertex) is computed, for it is well-known that the chromatic number <= max. degree. 5.The first N blocks are assigned fixed colours (for a Latin square N x N), for they must have different colours as the first N blocks are all connected by edges (form a clique). 6.A simple recursive implementation of backtracking is used for generating all possible colourings.
Slide 13 7.When the number of colours used reaches the current minimum (that starts with the max. degree), this line of search is abolished. 8.On each recursive call all so-far used colours are tried and the first new colour is tried as well. 9.When all colourings are found and the minimum is established, it is displayed and the last minimal colouring is displayed as well.
Slide 14 latin square number 1: abcde A01234 B13042 C24103 D32410 E40321 {A,a,0} {A,b,1} {A,c,2} {A,d,3} {A,e,4} {B,a,1} {B,b,3} {B,c,0} {B,d,4} {B,e,2} {C,a,2} {C,b,4} {C,c,1} {C,d,0} {C,e,3} {D,a,3}
Slide 15 {D,b,2} {D,c,4} {D,d,1} {D,e,0} {E,a,4} {E,b,0} {E,c,3} {E,d,2} {E,e,1}
Slide
Slide 17 max degree=12 chromatic number=7 minimum colouring:{A,a,0} gets colour 0 {A,b,1} gets colour 1 {A,c,2} gets colour 2 {A,d,3} gets colour 3 {A,e,4} gets colour 4 {B,a,1} gets colour 2 {B,b,3} gets colour 4 {B,c,0} gets colour 3 {B,d,4} gets colour 5 {B,e,2} gets colour 1 {C,a,2} gets colour 4 {C,b,4} gets colour 2 {C,c,1} gets colour 5 {C,d,0} gets colour 1 {C,e,3} gets colour 0 {D,a,3} gets colour 5 {D,b,2} gets colour 3 {D,c,4} gets colour 0 {D,d,1} gets colour 4 {D,e,0} gets colour 2 {E,a,4} gets colour 3 {E,b,0} gets colour 5
Slide 18 {E,b,0} gets colour 5 {E,c,3} gets colour 1 {E,d,2} gets colour 0 {E,e,1} gets colour 6 In conclusion: The program performed well for Latin squares of size 5, 6, and 7. However, for Latin squares of size 8 the combinatorial explosion occurred and to compute just one chromatic number took over 12 days. For even larger Latin squares the problem is not computationally feasible.