Nondecreasing paths in a weighted graph or: How to optimally read a train schedule

  • Authors:
  • Virginia Vassilevska Williams

  • Affiliations:
  • University of California, Berkeley, Berkeley, CA

  • Venue:
  • ACM Transactions on Algorithms (TALG)
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

A travel booking office has timetables giving arrival and departure times for all scheduled trains, including their origins and destinations. A customer presents a starting station and demands a route with perhaps several train connections taking him to his destination as early as possible. The booking office must find the best route for its customers. This problem was first considered in the theory of algorithms by Minty [1958], who reduced it to a problem on directed edge-weighted graphs: find a path from a given source to a given target such that the consecutive weights on the path are nondecreasing and the last weight on the path is minimized. Minty gave the first algorithm for the single-source version of the problem, in which one finds minimum last weight nondecreasing paths from the source to every other vertex. In this article we give the first linear-time algorithm for this problem in the word-RAM model of computation. We also define an all-pairs version for the problem and give a strongly polynomial truly subcubic algorithm for it. Finally, we discuss an extension of the problem in which one also has prices on trip segments and one wishes to find a cheapest valid itinerary.