I have this problem.
A basic wooden railway set contains the pieces shown in Figure 3.32.
The task is to connect these pieces into a railway that has no overlapping tracks and no loose ends where a train could run off onto the floor.
a. Suppose that the pieces fit together exactly with no slack. Give a precise formulation of the task as a search problem.
b. Identify a suitable uninformed search algorithm for this task and explain your choice.
I know I have to use a DFS for this problem. But how do I know all the pieces are connected. The last one and the first one are connected.
Can someone help me with some tips on how to solve this problem and implement it (in Python)?