The model below is a re-implementation of the cart-picking decision core on a generated warehouse. Left is what a first-come cart would walk; right is the optimized cart. Shuffle the orders to get a new wave.
A cart that stays in one zone beats a shorter walk across two. Only ties are settled by travel time — and every swap in the search respects that order.
Inside an aisle a sweep with at most one turn-back; across aisles an ordering that enters each zone once. Two small dynamic programs give the exact best route.
Real-time mode searches the smallest aisle set that fills the next cart; wave mode packs every box into trips and dispatches them so workers avoid the same aisle.