Graph Theory37 sections · 1633 units
Open in Course

LeetCode 1631 Path with Minimum Effort - Minimax Path

Maximum edge on path

In standard Dijkstra, you minimize the sum of edge weights. Here, you minimize the maximum edge weight encountered on the path. When you move from cell A to cell B, the effort is abs(height[A] - height[B]). The total effort of a path is the largest single effort among all steps.

Example: Path A has steps [11, 55, 22]. Maximum is 55. Path B has steps [33, 33, 33]. Maximum is 33. Path B wins, even though both have the same sum.