# How to solve constraint satisfaction problem of two queen and two knights on a $4 \times 4$ grid?

Consider the problem of placing 2 knights and 2 queens on a $$4 \times 4$$ chessboard, each piece (knight or queen) per row (denoted by R1, R2, R3, and R4), such that no two pieces are attacking each other. One knight must be placed in row R1, the other in R2, one queen in R3, and the other queen in R4.

How can I formulate this problem as a Constraint Satisfaction problem? How can I describe the set of variables, and their domain? What is the set of constraints? How can I draw the constraint graph?

• It sounds like this might be a homework problem. What are your thoughts about what the variables might be? How about the constraints? Did you get stuck somewhere in the problem, or not know where to start? – Jonathan Moore Feb 20 '19 at 12:21