Transportation Problem Solver (VAM and MODI)

Fill in the supply, demand and cost table, pick a starting method, and step through every allocation and every MODI iteration to the cheapest shipping plan, drawn as a network.

Funziona nel tuo browser. I tuoi file non lasciano mai il dispositivo. Scopri come verificarlo

…

Come si usa

  1. 1
    Enter the table

    Type costs, supplies and demands, rename the rows and columns, or import a CSV.

  2. 2
    Pick a start

    Choose northwest corner, least cost or Vogel's approximation method.

  3. 3
    Replay the start

    Step through each allocation and the Vogel penalties in the initial tab.

  4. 4
    Follow MODI

    Move through the iterations to see u, v, reduced costs, the loop and θ.

  5. 5
    Read the plan

    See the optimal shipments, the total cost and the network diagram.

  6. 6
    Export

    Download the plan CSV and network SVG, or print the full working.

Informazioni su questo strumento

The transportation problem asks how to ship goods from several sources, such as factories or warehouses, to several destinations so that every demand is met, no source ships more than it holds, and the total cost is as low as possible. It is a staple of operations research courses and of real distribution planning. Solving it by hand has two stages. First an initial basic feasible solution is built with the northwest corner rule, the least cost method or Vogel's approximation method, which uses penalties to avoid expensive cells. Then the modified distribution method, MODI, tests that plan with dual values u and v, finds a cell whose reduced cost is negative, moves goods around a closed loop and repeats until no saving remains. This solver does both stages and shows every step in the form an examiner expects. The grid editor lets you rename sources and destinations, add or remove rows and columns, mark blocked routes with M, and switch to maximising profit. Unbalanced problems get a dummy row or column automatically. The initial tab replays each allocation with the penalties for Vogel's method, while the MODI tab shows u and v, every reduced cost, the loop with its plus and minus signs, θ and the leaving cell. Degenerate plans receive ε cells chosen so that no loop forms.

How MODI decides

Every basic cell must satisfy uᵢ + vⱼ = cᵢⱼ. Starting from u₁ = 0, those equations fix every other u and v. For each empty cell, the reduced cost dᵢⱼ = cᵢⱼ − uᵢ − vⱼ says how much the total would change if one unit were sent along that route. A negative value means a saving, so the most negative cell enters the plan. The loop through basic cells alternates plus and minus, θ is the smallest quantity on a minus cell, and that cell leaves. When every reduced cost is zero or positive, the plan is optimal; a zero reduced cost signals that another plan with the same cost exists. A degenerate plan, with fewer than m + n − 1 basic cells, would leave some u or v undefined, which is why ε cells are added.

Worked example

The first sample is a classic textbook problem with three sources supplying 15, 25 and 10 units and four destinations needing 5, 15, 15 and 15. The northwest corner rule starts at a cost of 520 and needs two MODI improvements; the least cost method and Vogel's method both start at 475 and need one. Every route ends at the same optimal cost of 435: S1 sends 5 units to D2 and 10 to D4, S2 sends 10 to D2 and 15 to D3, and S3 sends 5 to D1 and 5 to D4. In the first MODI iteration from the northwest corner plan, the cell S3 to D1 has a reduced cost of −9, θ = 5, and the cost falls from 520 to 475.

Limits

The solver handles the classic balanced or balanced-by-dummy problem with linear costs. It does not handle transshipment through intermediate depots, fixed charges per route, capacity limits on single routes or integer vehicle loads. Big M marks a blocked route; if the optimal plan still uses one, no feasible plan exists.

Esempio svolto

3 sources × 4 destinations: NWC 520, least cost 475, VAM 475, optimal 435 after MODI.

In breve

Domande frequenti

Which starting method is best?

Vogel's approximation usually gives the cheapest start and needs the fewest MODI iterations. The northwest corner rule is the easiest to do by hand but ignores costs. All three lead to the same optimum after MODI.

What happens if supply and demand are not equal?

The solver adds a dummy destination for surplus supply or a dummy source for unmet demand, with zero cost. Units sent to or from the dummy show what is left unshipped or unmet.

What is degeneracy and how is it handled?

A plan is degenerate when it has fewer than m + n − 1 basic cells, which happens when a row and a column are used up at the same time. The solver adds zero-quantity ε cells that do not form a loop, so u and v can be found.

How do I block a route?

Type M in that cost cell. The route gets a very large cost, so the optimal plan avoids it whenever a feasible alternative exists, and the tool warns you if it cannot.

Can it maximise profit instead of minimising cost?

Yes. Tick the profit option. The solver converts each profit into a regret, the largest profit minus that profit, minimises the regret and reports the plan and total profit in your own figures.

Can I import my table from a spreadsheet?

Yes. Save a CSV with destination names and Supply in the header row, one row per source with its costs and supply, and a final Demand row. Export uses the same layout.

Completamente gratisNessun costo, nessuna registrazione
I file restano privatiTutto funziona nel tuo browser
Facile nella tua linguaDisponibile in molte lingue