Download presentation
Presentation is loading. Please wait.
1
Anticoloring Problems on Graphs
Ben-Gurion University of the Negev Faculty of Natural Sciences Department of Computer Science Anticoloring Problems on Graphs By: Orly Yahalom Advisors: Prof. Daniel Berend Dr. Ephraim Korach
2
Foreword The Anticoloring Problem – Version 1
The Anticoloring Problem – Additional Versions. Version 1 - Rooks on a Chessboard Semi-Queens
3
Anticoloring Anticoloring of a graph G : Coloring of some of the vertices of G, such that no two neighboring vertices are colored in different colors. Black-and-white coloring: Anticoloring which uses 2 colors.
4
Anticoloring Example black white uncolored illegal legal
5
The Anticoloring Problem – Version 1 (Decision problem formulation)
Input: Graph G, positive integers B1, ..., Bk . Question: Does G admit an anticoloring of Bj vertices in color j, j=1, ..., k. For k=2: The BWC problem. The decision and optimization problems are polynomially equivalent.
6
An Application Storing chemical products, where certain pairs of places cannot contain different products.
7
Past Research – BWC Version 1
Berge introduced the problem of placing black and white queens on an n x n chessboard, such that no black queen threatens a white queen. The complexity of this problem is still open.
8
Past Results - BWC Version 1
Introduction of the general problem and proof of its NP-completeness [1] Polynomial algorithm for trees [1] Polynomial algorithm for partial k-trees with fixed k.[2] _______________________________________________________ [1] P. Hansen, A. Hertz and N. Quinodoz, Splitting trees, Disc. Math. 165/167 (1997), [2] D. Kobler, E. Korach and A. Hertz, On black-and-white colorings, anticolorings, and extensions, submitted
9
Integer Linear Programming (ILP) Formulation of BWC – Version 1
Denote the graph vertices by 1,...,n. For each vertex i we assign binary variables bi and wi, such that
10
Integer Linear Programming (ILP) Formulation of BWC – Version 1
Assuming B is given and W is to be maximized: max s.t. (1) bi + wi ( 1 i n) (2) bi + wj (i, j are neighbors) (3) (4) 0 bi , wi 1 and integers ( 1 i n)
11
BWC – Additional Versions
Input: Graph G with an initial BWC. Problem: Extend the initial BWC, such that the number of colored vertices – in both colors – is maximized.
12
Weighted Versions of Version 2
Input: Graph G with an initial BWC, positive cost function on G’s vertices. Problem: Extend the initial BWC, such that the total cost of colored vertices is maximized. Version 3’ Same as Version 3’, but with cost function on the colors.
13
Remark: Versions 2, 3 are trivial unless the initial BWC includes both colors. Version 3’ is trivial unless the initial BWC include vertices colored in the color of lower cost. 3 4 c(black) = 1 c(white) = 3
14
Weighted Versions of Version 2
Input: Graph G=(V,E) with an initial BWC, positive cost function on V x {black, white}. Problem: Extend the anticoloring, such that the total cost of colored vertices is maximized.
15
Remark: Version 4 is non-trivial even if the initial anticoloring is empty. A B C 3 1 A B C 5 6 5
16
Past Research – Version 3
Version 3 of the BWC problem is polynomially equivalent to the 2-terminal node cut problem, which is polynomial. t s
17
Past Research – Version 3
The k-terminal node-cut problem is NP-complete for k 3, even for a constant cost function.[3] ______________________________________________________ [3] W. H. Cunningham, The optimal multiterminal cut problem, DIMACS Series in Disc. Math. and Theor. Comput. Sci 5 (1991), 105 – 120. The extension of Version 2 for three colors or more is NP-complete.
18
ILP Formulation of the BWC Problem – Version 4
max s.t. (1) bi + wi ( 1 i n) (2) bi + wj (i, j are neighbors) (3.1) bi = 1, i Vb, (3.2) wi = 1, i Vw, (4) 0 bi , wi 1 and integers ( 1 i n) cib (ciw) – Cost of coloring vertex i in black (white). Vb (Vw)- Vertices initially colored in black (white).
19
Linear Programming Background
A linear program (LP) is a program of the form: max/min cTx s.t Ax b where: A is a given matrix, b, c are given vectors, x is a vector of decision variables. An ILP whose integrality constraint is relaxed is an LP. The LP version of an ILP program is called linear programming relaxation. LP’s are easy to solve, unlike ILP’s.
20
Linear Programming – Solution Space
The solution space of a linear program is defined by a polyhedron. The extreme points (“corners”) of the polyhedron are called basic solutions. An LP with non-empty solution space is called feasible. An LP with a bounded solution space is called bounded.
21
Linear Programming – Basic Solutions
For any feasible bounded linear program, there exists an optimal solution which is a basic. Khachiyan[4]: There is a polynomial LP algorithm that finds an optimal basic solution, if exists (“The Ellipsoid Method”). _______________________________________ [4] L. G. Khachiyan, A polynomial-time algorithm for linear programming, Soviet Math. Dokl. 20/1 (1979),
22
Totally Unimodular Matrices
A matrix A is called totally unimodular (TUM) if every square submatrix of A is of determinant 0, 1, or –1. Ghouila-Houri[5]: A matrix A is totally unimodular Every subset C of columns of A has a partition C = C1 C2 such that for each row i of A. _____________________________________________________________ [5] A. Ghouila-Houri, Caracterisation des matrices totalementunimodulaires, C. R. Acad. Sci. Paris 254 (1962),
23
Totally Unimodular Matrices and LP
Hoffman and Kruskal[6]: A system Ax b (A, b have integer-valued elements) have only integer basic solutions A is totally unimodular. _________________________________________ [6] A. Schrijver, Theory of Linear and Integer Programming, Wiley, Chichester, 1986.
24
Polynomiality of Version 4
Theorem 1: There is a polynomial algorithm for solving Version 4. Proof: We show that the matrix of constraints in the LP relaxation of Version 4 is TUM. Then Applying Khachiyan’s algorithm for the LP relaxation gives an integral optimal solution – a feasible solution for Version 4
25
Polynomiality of Version 4
Proof (cont.) Take: C1 = Coefficients of bi’s C2 = Coefficients of wi’s Then for each row (constraint), there is at most a single 1 in each subset of columns. Thus, the matrix of constraints of the LP relaxation of Version 4 is totally unimodular.
26
Version 4 – Polymonial Combinatorial Algorithm
Polynomial-time reduction to the Independent Set problem in a bipartite graph, which is polynomially solvable.[7] _______________________________________ [7] G. L. Nemhauser and L. E. Trotter, Jr., Vertex packings: Structural properties and algorithms, Mathematical Programming 8 (1975),
27
Version 4 – Polymonial Combinatorial Algorithm
Polynomial-time reduction to the Independent Set problem in a bipartite graph, which is polynomially solvable.[7] _______________________________________ [7] G. L. Nemhauser and L. E. Trotter, Jr., Vertex packings: Structural properties and algorithms, Mathematical Programming 8 (1975),
28
Reduction From Version 4 to IS in A Bipartite Graph
w1 v1 b2 w2 v2 v6 v3 b3 w3 b4 w4 v4 b5 w5 v5 b6 w6 (a) (b)
29
Reduction From Version 4 to IS in A Bipartite Graph
w1 v1 b2 w2 v2 v6 v3 b3 w3 b4 w4 v4 b5 w5 v5 b6 w6 (a) (b)
30
Reduction From Version 4 to IS in A Bipartite Graph
w4 v4 b5 w5 v5 b6 w6 (a) (b)
31
Reduction From Version 4 to IS in A Bipartite Graph
w4 v4 b5 w5 v5 b6 w6 (a) (b)
32
Reduction From IS in Bipartite Graphs
to Min-Cut-Max-Flow
33
Reduction From IS in Bipartite Graphs
to Min-Cut-Max-Flow v c(v) u s c(u) t
34
Reduction From IS in Bipartite Graphs
to Min-Cut-Max-Flow v c(v) u s c(u) t Min Cut -> Min Co-IS -> Max IS
35
Special Graphs: Rooks on a chessboard
Given B black rooks, place them on the chessboard such that W - the potential number of unthreatened white rooks - is maximized. The graph: Vertex for each position on the board. Edge between 2 vertices that represent points on the same row or column.
36
Rooks on an m x n Chessboard
Assume m n. r – number of rows containing rooks c – number of columns containing rooks Number of white rooks: W(r, c) = (m – r)(n – c) c r m m = 9, n = 10, B = 15, r = 4, c = 6, W = 20. n
37
Rooks on an m x n Chessboard (cont.)
For a given r, c should be as small as possible. One-variable function: W(r) = (m – r)(n – B/r ) B/r r m m = 9, n = B = 15, r = 4, B/r = 6, W = 30. n
38
Rooks on an m x n Chessboard (cont.)
Our problem: max W(r) = (m – r)(n – B/r ) s.t. 0 < r min(B, m) and integer Without loss of generality r c = B/r , thus r min(B , m) r1 – optimal solution.
39
Rooks on an m x n Chessboard – Continuous Version
Relaxing the integrality constraints on r and c: max W(r) = (m – r)(n –B/r ) s.t. B/n r min(B, m) Optimal solution: where r0 /c0 = m /n c0 r0 m n
40
Discrete vs. Continuous Solution
(r1, c1) – Discrete solution(s). (r0, c0) – Continuous solution. Proposition 1 For each d, there exist m, n, and B for which |r1 – r0| d. Proof For a = (d+1)2 +1, m = a2 –2a + 2, n = B = a2 - a +1 we have r0 > a-1 but r1 = a – 1 – d.
41
Discrete vs. Continuous Solution
We have found upper bound on |r1 – r0| for various cases. An upper bound U on |r1 – r0| give rise to a search algorithm for r0: Compute W(r) for each integer r in the interval [r0 – U, r0 + U]. Choose the solution r for which W(r) is maximal. Time complexity: 2U. We give a tight upper bound for the general case and constant or small for special cases.
42
Proposition 2. The optimal solution for an n x n chessboard is:
Rooks Problem – Closed-Form Solutions Proposition 2. The optimal solution for an n x n chessboard is: a a + 1 a a An a x (a+1) rectangle for a2 < B a(a+1) ( a = B = r0 ) An a x a square for a(a-1) < B a2 (a = B = r0 ) In both cases r1 = round(r0)
43
Proposition 3. The optimal solution for an m x km chessboard is:
Rooks Problem – Closed-Form Solutions Proposition 3. The optimal solution for an m x km chessboard is: ro = a-1 ka ro = a k(a-1) a For ka(a-1) < B ka2 r1 = a = r0
44
Rooks Problem – Closed-Form Solutions
Proposition 3 (cont.) k(a+1) ro = a+1 ro = a ka a For ka2 < B ka(a+1) r1 = a = r0
45
Rooks Problem – Special Cases
Proposition 4. Let , where p and q are integers and l is rational. Then Without loss of generality p < q. Thus q is not significant.
46
Rooks Problem – Special Cases
Proposition 4 – Intuition n/m = q/p. Assume r1 < r0 – p. Take (r1 + p, c1 – y). To improve (m-r)(n-c), we need to have y > q. yr1 ~ p(c1 – y) and thus y ~ qc1/((q/p)r1 + q ). Since r1 + p < r0, (q/p)r1 + q < c0 < c1 and thus y < q.
47
Rooks Problem - Special Cases
Proposition 5 (i) For each m, n, and B such that r0 2 we have r1 = 1. (ii) This upper bound is tight.
48
Rooks Problem – General Case
Theorem 2 (i) For each m, n, and B (ii) The above bound is tight up to an additive constant. More specifically, the best possible upper bound U satisfies
49
Rooks Problem – General Case
Proof of Theorem 2 The upper bound: Upper bound on W(r) as a function of = r - r0. Lower bound on the max W(r). Using the fact that W(r) maxr W(r). The tightness of the upper bound: Using the case of Proposition 1.
50
Multi-Colored Rooks on a Square Board
Proposition 6 Given an n x n chessboard and integers B1,...,Bk it is possible to place Bj non-attacking rooks from each color j if and only if where
51
Semi-Queens A semi-queen on a square board is a piece that threatens its row, column and one of its extended diagonal. The board may be viewed as toral. The problem is complex.
52
Semi-Queens Proposition 7
Optimal solution for n = pq, q > 2 and B = p2. Example: p = 3, q = 5
53
Semi-Queens Example: Proposition 7 does not work for q = 2.
54
Thank you.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.