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?