Graph Theory37 sections · 1633 units
Open in Course

Problem - Cat and Mouse (Part 10)

(Edge cases)

Edge cases: What if the graph is not connected?

What if the cat starts on the food (vertex 00)? The problem statement says the cat cannot enter vertex 00, so this will not happen. What if there are self-loops?

The problem uses an undirected graph without self-loops, but if they existed, they would not change the outcome. Make sure your state representing handles all cases. Use a 3D3D array or map states to integers carefully.