Overview
Also called the 'jeep problem', this optimisation classic rewards moving cargo in stages rather than all at once.
How to solve The Camel and Bananas
- While more than 2000 bananas remain, moving 1 km costs 5 bananas (3 forward + 2 return trips).
- From 2000 down to 1000, a km costs 3 bananas (2 forward + 1 return).
- Below 1000 it fits one load, costing 1 banana/km. The optimal switch points leave 533 at the market.
The key insight
Establish caches at the exact points where you drop from 3 trips to 2 to 1. Each threshold minimises the wasteful return legs.
Variations & echoes
- The jeep problem asks how far a vehicle can travel across a desert with fuel caches.
- It models any logistics with per-distance consumption and limited capacity.
Frequently asked questions
Why not carry everything at once?
The camel holds only 1000, so 3000 bananas need multiple trips — and those return legs are the whole cost.