Dynamic Programming - Highway Billboard Problem | Algorithms
a heavily traveled stretch of road that runs west-east for M miles. The possible sites for billboards are given by numbers x1 < x2 < • • • < xn, each in the interval [0, M], specifying their position in miles measured from the western end of the road. If you place a billboard at position xi , you receive a revenue of ri > 0. Regulations imposed by the Highway Department require that no two billboards be within five miles or less of each other. You'd like to place billboards at a subset of the sites so as to maximize your total revenue, subject to this restriction.