This chapter considers how can one find the exit out of a labyrinth without ending up walking in a cycle or walking multiple times along the same path. The authors show that this problem can be solved using a fundamental method called depth-first search, if it is possible to set marks, such as a line with a piece of chalk, along the way. Interestingly, the depth-first search method also works if one wants to systematically explore a part of the World-Wide Web or if one wants to generate a labyrinth.
KeywordsProgram Code Return Path Program Fragment Social Network Platform Start Vertex
Unable to display preview. Download preview PDF.