Graph Theory37 sections · 1633 units
Open in Course

Problem - Cat and Mouse (Part 2)

(State space modeling)

The state space is O(n2)O(n^2) where nn is the number of vertices. Each state has two positions and a turn indicator. Model this as a graph where each state is a vertex. Edges represent legal moves. Each state where the mouse moves has edges to states where the mouse took a turn.

This creates a large game graph. You need to classify each state as mouse-win, cat-win, or draw using the techniques you learned earlier.

Space complexity is O(n2)O(n^2) for the data structures used.