Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Shira Zucker Ben-Gurion University of the Negev Advisors: Prof. Daniel Berend Prof. Ephraim Korach Anticoloring for Toroidal Grids.

Similar presentations


Presentation on theme: "1 Shira Zucker Ben-Gurion University of the Negev Advisors: Prof. Daniel Berend Prof. Ephraim Korach Anticoloring for Toroidal Grids."— Presentation transcript:

1 1 Shira Zucker Ben-Gurion University of the Negev Advisors: Prof. Daniel Berend Prof. Ephraim Korach Anticoloring for Toroidal Grids

2 2 The Problem  Anticoloring of a graph: A coloring of some of the vertices in which no two adjacent vertices are colored in distinct colors.  Input: A graph G, positive integers B 1,…,B k.  Output: Yes – if there exists an anticoloring of G such that B j vertices are colored in color j, j=1,…,k. No – otherwise.

3 3 Black and White Coloring (BWC)  Example:  The Anticoloring Problem is NP-complete, even for two colors.

4 4 BWC problem  We usually refer to the optimization version of the BWC problem.  We are given a graph G and a positive integer B, and have to color B of the vertices in black, so that there will remain as many vertices as possible which are non-adjacent to any of the B vertices (These vertices are to be colored in white).  W - the maximum possible number of such vertices.

5 5 History  Hansen, Hertz and Quinodoz proved that the BWC problem is NP-complete.  They also gave an O(n ) algorithm for trees.  Kobler, Korach and Hertz gave a polynomial algorithm for partial k-trees with fixed k (bounded tree width). 3

6 6 Berge’s Problem: Queens  Berge suggested a special instance of the problem:  Given positive integers n and B, place B black and W white queens on an n × n chessboard, so that no black queen and white queen attack each other, and with W as large as possible.  The complexity of the queens problem is still open.

7 7 The Rooks Problem  Yahalom investigated an analogous problem to that suggested by Berge, using rooks instead of queens.  She gave a sub-linear algorithm to this problem.  For special cases, in which the ratio between the sides of the board is an integer or close to an integer, she derived an explicit formula for the optimal solution.

8 8 The Kings Problem  Problem: Given positive integers m, n and B, place B black and W white kings on an m × n toroidal chessboard, so that no black king and white king attack each other, and with W as large as possible.

9 9 The kings problem – Cont. Remember that we are talking of a toroidal board.

10 10 Definitions  A black-white coloring (BWC) of a graph G is a function C: V {black, white, uncolored} such that there is no edge between a black and a white vertex.  Notice: C is uniquely determined by the set of vertices colored in black.

11 11 Definitions – Cont.  Completely full row (column): A row (column) all of whose vertices are black.  Almost completely full row (column): A row (column) all of whose vertices but one are black.  The rows of the toroidal board are enumerated by 1,2,…,n.  The columns are enumerated by 1,2,…,m (m ≥ n).

12 12 Definitions – Cont.  N(C) – the number of uncolored vertices of a coloring C.  Notice: The problem of maximizing W is equivalent to the problem of minimizing N(C).

13 13 Theorem – Part 1 An optimal solution may be constructed, depending on the size of B, as follows: : Let Color in black the set

14 14 Theorem – Part 2 : Let Color in black the set

15 15 Theorem – Part 3 : Let Color in black the set

16 16 Before we prove the theorem…  In order to prove the theorem, we will use several auxiliary lemmas.  The lemmas indicate changes which can be performed in order to achieve a better coloring C’, i.e., with N(C’) ≤ N(C).  The idea: In order to prove the optimality of C, it is enough to consider only the “good candidates” exist. Those candidates are to be found by the following lemmas.

17 17 Lemma 1  Given any coloring C, there exists a coloring C’, which is obtained from C by a permutation of rows (resp. columns), such that all completely and almost completely full rows (resp. columns) are placed in a single block and N(C’) ≤ N(C).

18 18 Lemma 1 – Example

19 19 Lemma 2  Given any coloring C with an almost completely full row (resp. column), by replacing the uncolored vertex at that row (resp. column) with any black vertex, we get a new coloring C’ with N(C’) ≤ N(C).

20 20 Lemma 2 - Proof  There is only one vertex which may become uncolored. On the other hand, the original uncolored vertex which became black, reduced the number of uncolored vertices by 1. Hence, N(C’) = N(C) or N(C’) = N(C) –1.

21 21 Lemma 3  For any coloring C, if row k contains b k black vertices and row k+1 contains b k+1 black vertices, where max{b k+1,1}≤ b k ≤ m-2, then row k+1 contains at least b k –b k+1 +2 uncolored vertices.

22 22 Lemma 4  Suppose that a coloring contains black vertices, and that rows n-f+1,…,n are completely full, where f ≤ n-2, but no other rows are such. Let r 1 and r 2 be the rows with the minimal numbers of black vertices where, say, b r 1 ≤ b r 2. Then b r 1 ≤ m-f-2-d and b r 2 ≤ m-f- 2+d for some d ≥ 0.

23 23 Lemma 4 - Explanation n = m = 10 f = 2 B = 39 ≤ 62 1 ≤ m-f-2 2 ≤ m-f-2

24 24 Lemma 5  If a coloring C with contains a completely full column, then N(C) ≥ 2n.  The idea of the proof: If each row contains at most m-2 black vertices, then it contains at least 2 uncolored vertices, and altogether we have at least 2n. Otherwise…

25 25 Lemma 6  If a coloring C with contains an almost completely full column, then N(C) ≥ 2n.  The idea of the proof: Replace the uncolored vertex of an almost completely full column with any black vertex from another column.

26 26 Lemma 7  If a coloring C with contains a completely or an almost completely full row, then N(C) ≥ 2n.

27 27 Lemma 7 - Proof  If C contains a completely or an almost completely full column, then, according to Lemmas 5 and 6, N(C) ≥ 2n, and we are done.  Otherwise, C contains no completely or almost completely full column. Since C contains a completely or an almost completely full row, each column of C contains at least two uncolored vertices. Therefore, N(C) ≥ 2m ≥ 2n.

28 28 Lemma 7 – Proof – Cont.

29 29 Corrollary 8  If a coloring C with contains less than 2n uncolored vertices, then each of its non-empty rows and columns contains at least two uncolored vertices.

30 30 Lemma 9  If a coloring C with contains no three adjacent empty columns (or rows), then N(C) ≥ 2n.

31 31 Lemma 9 - Proof  If C contains a completely or an almost completely full column, then, by Lemmas 5 and 6, N(C) ≥ 2n and we are done.  Assume, therefore, that C contains no completely or almost completely full column.

32 32 Lemma 9 – Example Two adjacent empty columns

33 33 Lemma 9 – Proof – Cont.  If C contains no three adjacent empty columns, then each empty column is adjacent to a non-empty column and therefore, contains at least three uncolored vertices.  According to Corollary 8, each non-empty column contains at least two uncolored vertices.  Denote by x the number of non-empty columns in C.  We get that N(C) ≥ 2x + 3(m-x) ≥ 2m ≥ 2n.

34 34 Lemma 10  Suppose a coloring C contains three empty columns (rows, resp.), of which two are adjacent, say columns j, m-1, m (rows i, n-1, n, resp.). The coloring C’, obtained from C by moving columns j + 1, j +2, …, m-2 (rows i+1, i+2, …, n-2 resp.) one place to the left (up, resp.), and column j immediately to their right (row i immediately under them, resp.), satisfies N(C’) ≤ N(C).

35 35 Lemma 10 – Cont.

36 36 Lemma 11 Three kinds of changes in a coloring C, which do not increase N(C).

37 37 Lemma 12  If a coloring C contains exactly c non-empty columns, which are all adjacent, and exactly r non-empty rows, which are also adjacent, where 1≤ c≤ m-2 and 1≤ r≤ n-2, then N(C) ≥ 2c+2r+4.

38 38 Lemma 12 Sketch of the proof We build C’ with K rectangles of sizes c i × r i. ∑ c i ≥ c ∑ r i ≥ r

39 39 Conclusion of the Proof for Small B  Consider.  C 0 – the square configuration of the theorem.  Suppose there exists a coloring C with N(C) < N(C 0 ) (and with the same B).  N(C 0 ) =.  Therefore, according to Lemmas 5, 6 and 7, C does not contain any completely or almost completely full column or row.

40 40 Small B – Cont.  According to Lemma 9, C contains at least 3 adjacent empty columns and at least 3 adjacent empty rows.  By Lemma 10, we can combine all empty columns and rows into one block, thus get a c × r rectangle, where c ≤ m-3, r ≤ n-3, and each row and column contains at least one black vertex.

41 41 Small B – Cont.  By Lemma 12, we have N(C) ≥ 2c+2r+4.  Since cr ≥ B, we get which contradicts our assumption.

42 42 The idea of the Proof for Intermediate B  Consider.  Most lemmas we used in the proof for small B were of the type: if…. then N(C) ≥ 2n.  Here we use the same lemmas, in a similar way, but with N(C) ≥ 2n + “something”, where “something” is equal to 0, 1 or 2.  The proof is more complicated and divided into some parts.

43 43 Proposition  N(B) – the minimal possible number of uncolored vertices for B black vertices in a graph G.  Proposition: Given a graph G=(V,E) and a number 0 ≤ B ≤ |V|, we have N(|V|-B-N(B)) ≤ N(B).

44 44 Conclusion of the Proof for Large B  Consider.  C 0 – the co-square configuration of the theorem.  Suppose there exists a coloring C with N(C) < N(C 0 ) (and with the same B).  N(C 0 ) =. Denote B’:=mn-B-N(B).  0 ≤ B’ ≤ mn-B <.  By the proposition, N(B’) ≤ N(B).

45 45 Large B – Cont.  Assume first that We showed that for those B', N(B') ≥ 2n.  Now,

46 46 Large B – Cont.  Therefore, and we have a contradiction.

47 47 Large B – Cont. If then we compare N(B) to N(B’) and get to a contradiction by using the same principle as before, this time with the ‘square configuration’.

48 48 Union of Components  Input: A graph G=(V,E) where and. A number 1 ≤ B ≤ |V| and an optimal anticoloring C k for each connected component G k with 1 ≤ b ≤ B black vertices.  Output: An optimal anticoloring C For G with B black vertices.

49 49 Union of Components – Cont.  N(G,B) - the minimal number of uncolored vertices of a graph G with B black vertices.  Our algorithm use a dynamic programming.

50 50 Basic Algorithm for finding N(G,B) union(G,B) for l=2 to n by l l*2 for i=1 to n-l+1 by i i+l j i+l-1 for b=0 to B for bb=0 to b q m[i,k,bb]+m[k+1,j,b-bb] if q<m[i,j,b] then m[i,j,b] q

51 51 Complexity of union(G,B)  O(B n), where 1 ≤ B,n ≤ |V|.  Notice: For a constant B, the algorithm is linear. 2

52 52 Improving the Algorithm  If B ≥ √ (log n), then before calling our algorithm, we sort the components of G by their size.  The complexity of familiar Sort Algorithms is O(nlog n).  The advantage of sorting the components is that, in case where B is greater than the size of some of the connected components, finding a solution for two small components will cost less than B. (In this case, the cost will be the product of the components size.) 2

53 53 Algorithm for finding an optimal Anticoloring color(B,i,j,num,m[][][]) if j>i for b=0 to B for bb=0 to b if m[i,k,bb]+m[k+1,j,b-bb]=num color(bb,i,k,m[i,k,bb],m) color(B-bb,k+1,j,m[k+1,j,b-bb],m) Where num is equal to N(G,B) that we already have.


Download ppt "1 Shira Zucker Ben-Gurion University of the Negev Advisors: Prof. Daniel Berend Prof. Ephraim Korach Anticoloring for Toroidal Grids."

Similar presentations


Ads by Google