10.6k views
1 vote
You can only walk through a door once. Walking through a door closes it. Close all the doors.

You can only walk through a door once. Walking through a door closes it. Close all-example-1

1 Answer

5 votes

Answer:

not possible

Explanation:

If we place the node of a graph in each space, the 5 rooms constitute 5 nodes, and the "outdoor" space constitutes a 6th node. There are 3 rooms with 5 doors each, and "outdoors" connects to "indoors" via 9 doors.

Hence, there are 4 nodes with an odd number of doors. The path you seek is called an Eulerian path. It is only possible if the number of odd nodes is 0 or 2.

No such path is possible.

User Glen Thompson
by
7.6k points