Problem 1.1 (Gac)
Input: A graph , a set of positive integers .
Output: 1 If it is possible coloring vertices of with color such that, for each , and have the same color or at least one is uncolored.
If we limit , we have the Black and White Coloring Problem(BWC), defined as follows:
Problem 1.2 (Bwc)
Input: A graph , and two positive integers.
Output: 1 If it is possible coloring vertices of with color black and vertices of with color white, such that, for each , and have the same color or at least one is uncolored.
Problem 1.3 (BWC-chessboards)
Input: A chessboard, black chessboard pieces and white chessboard pieces, with the same piece type.
Output: 1 If it is possible to place black pieces and white pieces in chessboard, without attacking each other, 0 otherwise.
Lipton and Tarjan solved the Problem 1.3 with rook pieces. Hansen et al. showed that the BWC is NP-complete for general graphs in . Until this work the complexity of Problem 1.3 with knights and queens remained open.
In our case we deal with knight chessboards. One way to answer the Problem 1.3 with knights is to fix the value of and maximize the size of white knights set. This problem is named Optimization Black and White Coloring Problem for Knights (OBWC-Knights). In  Berend et al., proposed the Problem 1.4 over chessboards with each original piece of chess since this special case is the most difficult one. They solved the cases of kings, bishops and towers, as well they proposed two conjectures, one for the case of knights and one for queens. In this work we give a proof for knights case on chessboards.
Problem 1.4 (Balanced BWC)
Input: A chessboard and a type of piece of chess.
Output: , of the specified piece.
2 The knights case
First, we model the Problem 1.4 as an integer program. Given a chessboard. For each position on the board we define the following variables:
where and are the number of blacks and whites respectively and is the closed neighborhood of the vertex . Now we define as the optimal result of the integer program (1 – 7) for the piece . In  Berend et al. proposed the Conjecture 1 for the value of . The left side of Figure 1 shows the case of even where Conjecture 1
it is fulfilled and the right side shows the case of oddwhere the conjecture is not fulfilled.
Given a chessboard. The value of is:
Conjecture 1 is not true because it is not fulfilled when is odd and we have a better solution for this case, also the value of does not work with values of . In the Figure 2 we show a solution for chessboard with 10 black and 10 white knights. The solution provided by the Conjecture 1 gives . The difference is because on chessboard there are some positions that can not be reached by knights in one movement.
We can proof a general version of this conjecture in Theorem 1.
Given a chessboard, , , . The value of is:
The values of and are and respectively and their proofs are trivial. In the case of the value of have a few pathological cases for small values of and the rest can be solved by the application of Theorem 1 with a few modifications. For example in the case of , must be greater equal than 7 due with there are zones that knights can not reach in one movement.
Given a chessboard with , then
Proof: We assume that , now we proof that the optimal number of white knights is . By the size of exists at least one column on the chessboard with 2 black knights and this column is the one that more black knights have, the other columns have at most 2 black knights, by this fact the number of non empty columns are at least and the number of uncolored vertices is at least . If we fill all the two knights columns we have at least or uncolored vertices depending on the parity of , decreases the number of non-empty columns and the number of uncolored vertices. We have a solution with exactly or uncolored vertices depending on parity of . We calculate the optimal number of white knights with the following equation.
For the proof of Theorem 1 we use plenty of lemmas, which some of them are easy to verify and their proofs will be omitted.
2.1 Auxiliary Lemmas
A full column (row) is a column (row) with a black knight on each of its vertices.
An empty column (row) is a column (row) with all of their uncolored vertices.
An empty vertex is a position on chessboard that should not have a knight.
A vertex is covered by a black knight if is uncolored and can be reached by in one movement.
A full column (row) covers completely the columns and for any i. e. columns and can not be white.
An almost full column (row) is a column (row) with 1 or 2 uncolored vertices.
An almost full column (row) covers at least vertices in columns and ( in the case of rows).
Proof: The proof of this lemma uses the fact that each vertex in columns and is covered twice by the knights of column except for the topmost and bottommost vertices of column , which are covered only one time. Now if we remove two blacks from column we can uncover up to 4 vertices in columns and .
Let be the number of vertices that must be uncolored in a coloring .
A block is a set of columns (rows) with no intermediate empty columns (rows).
An empty block is a set of contiguous empty columns (rows).
Given a coloring with black knigths, there is a coloring , which is obtained by permutation of its rows (or columns) such that only all full rows and almost full rows (or columns) are in a single block and .
Proof: Without loss of generality. Suppose we have a coloring with all full and almost full columns in two blocks. The columns in the first block are labeled as and columns in second block as , with . The left side of first block has at least covered vertices. The right side of the same block has at least covered vertices. The right side of the first block and the left side of the second block may share covered vertices. If the second block is placed next to the first one some potential white vertices between first and second blocks may become uncolored. In the worst case we loss only 4 potential white vertices but release columns and , then .
If a coloring has at least one almost full row (column) and we move a black knight to the uncolored vertex in the almost full column , the new coloring satisfy .
Proof: There are two cases in this proof:
If the almost full column has a black knight in column or . Due to Lemma 2 in columns and we must have at least uncolored vertices. On the other hand the isolated black knight could share uncolored vertices with almost full column in its left side but has at least uncolored vertices in column or . Therefore, the new coloring has the same number of uncolored vertices or less.
If the isolated black knight is on the column or is similar to previous case. If the black knight is in column, the isolated black knight has more uncolored vertices. Therefore, if we fills the almost full column with the isolated black knight, the new coloring is better.
Let the number of black knights on the column (row) .
A compact column (row) is a non empty column (row) with its black knights in rows (columns) .
Given a coloring with black knights. There is a coloring obtained by compacting the all non empty columns and satisfy .
Proof: We only proof the case where is even. We suppose that the coloring does not have full or almost full columns because in this case is trivial because of the Lemmas 3 and 4. On the other hand, we choose the column with more black knights, this column must have more than black knights because the size of . If there was no column with at least that number of knights would have non-empty columns. In this case the coloring could have more uncolored vertices since .
Now by choosing the column with more black knights, this column produces in the left side at least uncolored vertices and in the right side , Therefore . If we compact the columns like in the Figure 3 the number of uncolored vertices does not increase and .
A compact coloring is a coloring where all its columns are compact.
Given a compact coloring with black knights. There is a compact coloring such that all non empty columns are in descending order and satisfy .
Proof: Given a compact coloring with black knights. Now we can choose the largest for . This produces . If we put the biggest column on the leftmost of block like in the Figure 4, the number of uncolored vertices in new coloring is , therefore .
Given a compact and ordered coloring with black knights. there is a coloring obtained by filling all non empty columns, such that where is the column with more black knights and is the last non-empty column in new coloring . The new coloring satisfy .
Proof: Without loss of generality we can place the column with more black knights in the first column of chessboard, by Lemma 6 we can place all non-empty columns in descending order and we have at least .
By filling and completing all columns such that , like in the Figure 5. The differences , for all , in coloring . Some of that differences are strictly positive. The new coloring has at least the same number of uncolored vertices .
Lemma 8 (Berend, et al.)
Given a coloring with black knights, if has full empty columns (rows), we can put all the full empty columns (rows) next to non empty columns (rows) in a single empty block. New coloring satisfy .
Given a coloring with black knights. It exists a coloring with at least one full column such that .
Proof: By the application of Lemmas 3, 4, 5, 6 and 7 a solution is built with a block with where and are the column and the row with more black knights. Now . If we fill at least one column the number of uncolored vertices remains equal or decreases until exactly , therefore the new coloring has uncolored vertices and .
Given a coloring with at least one full column then or .
Proof: In this case there are two possibilities like in the Figure 6. Let the last non empty column on chessboard and the number of black knights in that column.
Case 1: Columns and has at least uncolored vertices.
Case 2: Columns and has at least uncolored vertices.
The second case is only possible when and are odd. Due to the Lemma 8 it is possible to put the column next to a full column and satisfy . Column has uncolored vertices, column has at least uncolored vertices and column has uncolored vertices. In total . In the second case the column has uncolored vertices, in column has uncolored vertices and column has at least uncolored vertices, in total , for this particular case then .
Given a coloring with black knights. It satisfies or .
2.2 Minimum uncolored set
3 The value of
Now we are enabled to write a formula for the optimal number of white knights under the condition that the number of black knights is the same as in the Theorem 1.
3.1 Conclusion of proof of the Theorem 1
In this section we only show case 1. The proof is similar for other cases. We can calculate the optimal number of white knights since our solution is a thigh lower bound in the number of uncolored vertices.
By definition of balanced BWC we need since . We also need the greatest value of all minimum values. We increase the value of by units. If is not optimal, the value of will be increased. Let the optimal number of whites with black knights with .
4 Conclusions and future work
The balanced BWC problem with knights and queens remained unsolved until this work. We shown a proof of a generalization of the Conjecture proposed by Berend et al. for knight case, also we shown that the second part of the conjecture is not fulfilled and we have provided a better solution in this case. The next step is a proof of not balanced case and what happens in the case of toroidal chessboards. In the case of queens the problem remains open.
- Berend et al.  D. Berend, E. Korach, and S. Zucker. Anticoloring of a family of grid graphs. Discrete Optimization, 5(3):647–662, 2008.
- Hansen et al.  P. Hansen, A. Hertz, and N. Quinodoz. Splitting trees. Discrete Mathematics, 165:403–419, 1997.
- Lipton and Tarjan  R. J. Lipton and R. E. Tarjan. A separator theorem for planar graphs. SIAM Journal on Applied Mathematics, 36(2):177–189, 1979.