**Puzzle:** A museum has an exhibition space of **16** rooms. There is a door between every pair of horizontally and vertically adjacent rooms. In addition, each room on the north and south side of the building has a door leading outside. In planning a new exhibition, the curator has to decide which of the doors need to be open, so that a visitor can enter the exhibition through the door on the north side, visit each and every room exactly once, and gets out through a door on the south side. Also, the number of doors open should be minimum.

- What is the minimum number of doors needed to be open for the exhibition?
- Indicate all the entrance-exit pairs that can be opened for the exhibition?

The floor plan of the museum is as shown. The top and bottom lines of the plan indicate the north and south side of the building respectively.

**Solution:**

- Since a path through the exhibition must visit each room exactly once, it will have to enter and leave each room through different doors. This implies that a minimum of
**17**doors need to be open, including one entrance and one exit door. - On coloring the rooms as squares of a
**4 x 4**chessboard, as shown it becomes obvious that any path through the exhibition, will have to pass through the squares of alternating colors.

Since the total of **16** rooms has to be visited, the first and last squares must be colored in opposite colors. So, the possible entrance-exit pairs are **(A1, B1), (A1, B3), (A2, B2), (A2, B4)** and symmetrically, **(A4, B4), (A4, B2), (A3, B3) and (A3, B1)**. Some of the paths for these entrance-exit pairs are as shown.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.