Implement one search algorithm for each of the problems using Python.
Five people are to be seated on five chairs that are arranged to form a circle. Due to the different personalities and closeness between different people, the comfortability of a person is different when seated next to different people. You are asked to identify the seating arrangement that allows everyone to be as comfortable as they can.
In chess, the queen may move unlimited steps in 8 directions – up, down, left, right, and all diagonals to remove other pieces. You are asked to identify (if existed) the placement of eight queens on an 8-by-8 chess board such that no queen is able to remove other queens.
The code that has been written should:
- Execute without error
- Consider different number of people for problem 1, and different number of queens for problem 2 (the number of queens and the number of rows and columns of the board are always the same)
- Provide a way for user to input the number of people for problem 1 and the number of queens/size of the board
- Provide a visualisation of the final result