Graph Theory37 sections · 1633 units
Open in Course

Coin Collector - Analysis

Recognizing the SCC pattern.

Pattern recognition:

  • One-way tunnels = directed graph
  • Can traverse cycles = all coins in an SCC are collectible together
  • Maximize collection = find optimal path in DAG

Approach: 1.1. Find SCCs and condense the graph

2.2. Each super-node has sum of coins from all its rooms

3.3. The condensed graph is a DAG

4.4. Run DP to find maximum coins on any path

This is SCC + DP on DAG, a classic combination.