One pointer along many lines
transcript
Many options, one best at each step. Checking all of them is slow. A pointer can skip the rest.
Each possible start is a line. The cheapest line at a mark wins. The marks only grow.
Marks one to five, in order. Line zero wins at one and two. Line one takes over at three. Line two wins at five.
The slopes fall as lines are added. The marks grow as questions come. So a beaten line stays beaten.
All pairs would be five billion. The pointer needs about a hundred thousand steps. One pass is enough.
Survey points sit on one road, sorted by distance. Each trip costs a fee plus a squared gap. Each possible start becomes one line. The pointer then finds the best start in one step. No search is needed for each point.
Name the property first. Falling slopes, growing marks. Full breakdown in the lecture.