🚚 Supply Chain Optimizer: Cheapest Delivery Plan from Factories to Stores

The science
  • The transportation problem: minimise sum c_ij x_ij subject to sum_j x_ij <= supply_i, sum_i x_ij <= demand_j, x_ij >= 0 integer. It is a linear programme whose constraint matrix is totally unimodular, so integer solutions are optimal.
  • Unmet demand is priced at the lost-sale penalty through a dummy supplier; surplus goes to a dummy customer at zero cost, so the problem is always balanced and solved exactly by successive shortest paths (Bellman-Ford) on the residual network.
  • Independent checks: (1) on load, 40 random small instances are solved by exhaustive enumeration and must match the solver; (2) after every change the residual network is tested for negative-cost cycles, which is the optimality certificate (equivalent to LP duality); (3) cost = shipping + penalty x lost units.
  • Simplifications: one product, linear costs, no fixed charges, no road capacities, no time or inventory dynamics; real logistics adds all of these (mixed-integer programming).

Controls

Raise demand above supply and the solver chooses which stores to leave short (cheapest lost sale first). Close the cheapest road and watch the plan re-route.

Readouts

Self-checks