Shortest Path Intuition Math Example 1

Follow the full solution, then compare it with the other examples linked below.

Example 1

medium
A river runs along the xx-axis. Town AA is at (2,3)(2, 3) and town BB is at (8,5)(8, 5), both north of the river. A pumping station on the river at point P(x,0)P(x, 0) connects to both towns. Find xx that minimises the total pipe length AP+PBAP + PB.

Solution

  1. 1
    Step 1: Reflect BB across the river (xx-axis) to get Bโ€ฒ(8,โˆ’5)B'(8, -5).
  2. 2
    Step 2: The shortest total path from AA to PP to BB (with PP on the xx-axis) equals the straight line ABโ€ฒAB' by the reflection principle.
  3. 3
    Step 3: Line ABโ€ฒAB': slope =โˆ’5โˆ’38โˆ’2=โˆ’86=โˆ’43= \dfrac{-5-3}{8-2} = \dfrac{-8}{6} = -\dfrac{4}{3}. Equation: yโˆ’3=โˆ’43(xโˆ’2)โ‡’y=โˆ’43x+173y - 3 = -\dfrac{4}{3}(x-2) \Rightarrow y = -\dfrac{4}{3}x + \dfrac{17}{3}.
  4. 4
    Step 4: Find PP: set y=0y = 0: 0=โˆ’43x+173โ‡’x=174=4.250 = -\dfrac{4}{3}x + \dfrac{17}{3} \Rightarrow x = \dfrac{17}{4} = 4.25.

Answer

P=(4.25,โ€…โ€Š0)P = (4.25,\; 0); minimum pipe length =โˆฃABโ€ฒโˆฃ=(8โˆ’2)2+(โˆ’5โˆ’3)2=100=10= |AB'| = \sqrt{(8-2)^2+(-5-3)^2} = \sqrt{100} = 10 units.
The reflection principle converts the two-segment path problem into a single straight-line problem. Reflecting one endpoint across the barrier and drawing a straight line to the other endpoint gives the optimal relay point.

About Shortest Path Intuition

The minimum-length route connecting two points, whose form depends on the geometry of the underlying space.

Learn more about Shortest Path Intuition โ†’

More Shortest Path Intuition Examples