Analyzing the least-cost path