A cheap purchase can use capacity that would save more money elsewhere, even when each individual price looks attractive. Consider two approved mills supplying three garment units within the same planning period. If the buyer awards each unit's order in isolation, the first award may leave an expensive route for the next unit. A transportation model compares all the allowed routes together.

The model in this guide allocates one approved fabric during one planning period. It chooses quantities that meet each unit's need without exceeding the mills' available supply, with the objective of minimising the stated variable cost. Fabric approval, shade, delivery and lot rules define what the model is allowed to choose.

Use the worked example to build a small Excel Solver sheet. The illustrative costs are used in calculations that assume divisible metres and no fixed dispatch charges; they do not represent current supplier quotations. Later sections explain what must change when real buying terms do not fit those assumptions.

Confirm that the fabric can be substituted

Begin with one clearly defined material whose construction, fibre content, usable width, finish and relevant buyer approvals can be matched across sources. Because similar GSM alone does not make two fabrics interchangeable, a technically unsuitable fabric must not enter the model as a cheap alternative.

Confirm the shade-lot rules too. A unit may accept fabric from two approved mills for different orders but reject mixed lots within one garment order. The allocation model needs that distinction before it solves the cost problem.

Use one quantity unit throughout. If one mill quotes kilograms and the unit needs metres, establish an approved conversion using the relevant width and GSM basis. The fabric GSM and roll-weight guide explains the area and mass checks behind such conversions.

Set a common planning period and required arrival date, since a mill's stock next month cannot cover next week's cutting plan. Record each lane as allowed or prohibited based on the actual technical and timing conditions.

Calculate available supply and net need

A source's capacity should be what remains after earlier commitments, rather than its total output with quantities already promised elsewhere left uncounted. Link the available figure to a reservation record for the period being planned.

For each destination, calculate net need after usable stock and confirmed receipts that can serve the same order. Exclude held, rejected or reserved material where it is unavailable for this purpose, while keeping gross demand and free stock visible behind the net figure.

The inventory policy guide covers the timing and size of replenishment decisions. The allocation model identifies which approved source should fill a stated need, while the economic order quantity requires a separate calculation.

If the data includes an uncertain receipt, test a separate case without it because an optimistic supply figure can conceal cutting's exposure to a delay. The model cannot judge whether an unconfirmed promise will arrive.

Define comparable variable costs

Use one currency, quantity unit and delivery basis. The cost may include purchase price and variable freight, whereas an allocation of fabric already owned may include only the extra transport cost. State the scope so each lane is compared on the same basis.

After checking whether freight is already included in the quoted price, record any relevant exchange-rate and tax treatment under the company's approved method. The example uses USD per metre, but the method works with another consistent currency.

A fixed truck charge does not remain constant per metre, and minimum bills, quantity discounts or supplier setup fees may also break the simple linear assumption. Model them explicitly when they affect the choice, or restrict the analysis to a range where the linear cost is valid.

The following matrix defines the base example. All lanes in this example have the required approval and can deliver within the specified period.

Source

Unit A, USD/m

Unit B, USD/m

Unit C, USD/m

Available metres

Mill 1

4.00

6.00

8.00

1,000

Mill 2

5.00

4.00

3.00

800

Required metres

600

700

500

1,800 total

Although total supply equals total demand in this example, that equality comes from the inputs and should not be imposed on every real problem. Keep the actual quantities even when they do not balance.

Write the decisions and constraints

Let x1A mean metres sent from Mill 1 to Unit A, with the other five lane quantities defined in the same way. Each quantity must be zero or positive because a negative shipment has no physical meaning here.

The objective is:

Minimise cost = 4x1A + 6x1B + 8x1C + 5x2A + 4x2B + 3x2C.

Mill 1's three quantities must total no more than 1,000 m. Mill 2's must total no more than 800 m. The two quantities arriving at A must total 600 m; B needs 700 m and C needs 500 m.

Fix the quantity of a prohibited lane at zero rather than assigning a high cost and hoping the model avoids it. When alternatives are short, a high-cost lane can still be selected, which is why a hard prohibition needs an explicit constraint.

SciPy's linear programming documentation describes this objective, constraint and bound structure. Google's minimum-cost-flow guide presents the related network view. In either form, the physical rules must be explicit.

See why the first cheap choice can be expensive

Suppose Unit B is planned first and receives its full 700 m from Mill 2 at $4/m. Mill 2 then has only 100 m left for C. Mill 1 supplies all 600 m to A and the remaining 400 m to C.

The cost is 700 × $4 + 100 × $3 + 600 × $4 + 400 × $8 = $8,700. Although the plan meets every demand and uses all available supply, its feasibility does not establish that it has the lowest cost.

Compared with Mill 1, Mill 2 saves $2/m on B and $5/m on C. Giving its limited capacity to B first uses that capacity where the saving is smaller. The model considers that opportunity cost across the whole allocation.

This does not mean the cheapest lane should always be filled first. In a larger network, other capacity and lane limits can change the result. Use the complete model rather than turning this example's pattern into a universal allocation rule.

Check the minimum-cost solution

For the stated base inputs, the optimal allocation is:

Source

Unit A metres

Unit B metres

Unit C metres

Source total

Mill 1

600

400

0

1,000

Mill 2

0

300

500

800

Destination total

600

700

500

1,800

The total cost is 600 × $4 + 400 × $6 + 300 × $4 + 500 × $3 = $7,500. This result is $1,200 below the local-choice plan, with all six decision quantities meeting the row, column and nonnegative limits.

The improvement can be explained by a swap that shifts 100 m of Mill 2's B allocation to C. Mill 1 takes the displaced 100 m of B instead of supplying that quantity to C. The saving is 100 × ($5 − $2) = $300.

That swap remains feasible while Mill 1 still sends fabric to C and Mill 2 still sends fabric to B. Four such swaps move the local plan to the displayed result, making the cost change easy to inspect without relying only on a solver message.

Lay out the Excel worksheet

Use separate blocks for input costs and decision quantities, with the same source and destination order. Label metres and USD per metre clearly, and check the matrix order because a transposed block can produce a plausible-looking objective for the wrong routes.

Worksheet area

Content

Formula or use

B3:D4

Six lane costs

Enter the base cost matrix

B8:D9

Six shipment quantities

Solver changes these cells

E8:E9

Source totals

Sum each decision row

F8:F9

Source capacity

Enter 1,000 and 800

B10:D10

Destination receipts

Sum each decision column

B11:D11

Destination needs

Enter 600, 700 and 500

F12

Total variable cost

=SUMPRODUCT(B3:D4,B8:D9)

For example, E8 contains =SUM(B8:D8), and B10 contains =SUM(B8:B9). Copy the formulas across the matching rows or columns, keeping capacities and demand in input cells instead of hiding typed numbers inside the formulas.

Fabric supply allocation planning

Microsoft's SUMPRODUCT documentation explains how matching array entries are multiplied and summed. Both arrays must have matching dimensions, and a manual check of one lane should confirm that its quantity multiplies the intended cost.

Set up Solver for this linear model

Follow Microsoft's Solver guidance. Set F12 as the objective to minimise, then select B8:D9 as the cells whose shipment quantities Solver can change.

Add the source limits E8:E9 ≤ F8:F9 together with the destination equalities B10:D10 = B11:D11. Require all changing cells to be nonnegative, with a zero-quantity constraint for each prohibited lane. Choose Simplex LP for this linear model.

Check that Solver is loaded in the Excel installation being used. Microsoft provides separate loading instructions. Because platform support and menu details vary, use the cell map as a reproducible model specification rather than as evidence that a particular interface has been tested.

Keep formulas in the objective and total cells. If F12 contains a typed cost instead of a formula linked to the decision cells, changing shipments will not change the objective. Likewise, a typed row total can conceal a capacity breach.

Verify the result independently

Read the solver status before using the quantities, since neither a stopped search nor an infeasible result constitutes an approved allocation. Keep the result message with the input version so the decision can be traced later.

Recalculate each row and column to confirm that every demand is met and no source exceeds its available quantity. After checking prohibited lanes, negative values and numerical residue close to zero, use the agreed physical precision to prepare order quantities and check the totals again.

Calculate lane costs separately and add them. For the base plan, the nonzero costs are $2,400, $2,400, $1,200 and $1,500. Their sum of $7,500 provides a simple check that can reveal a wrong cost range or a missing lane in the objective.

A solver only proves a result for the mathematical model it received. Supplier approval and delivery credibility require an operating review because the mathematical result cannot verify those inputs.

Handle excess supply and shortages honestly

When supply exceeds demand, keep source quantities as upper bounds. The model may leave capacity unused, so there is no need to create a shipment simply to use every available metre.

If a reporting system requires a balanced transportation table, a dummy destination can represent unused supply. Label that destination clearly because a zero-cost dummy entry represents unused capacity with no assigned cost, rather than a real customer shipment.

If Mill 2's supply falls to 700 m while Mill 1 remains at 1,000 m, total supply is only 1,700 m against 1,800 m of demand. The exact-demand model is therefore infeasible, leaving a 100 m shortfall that needs an approved response.

Do not reduce a destination requirement silently to obtain a solution. If shortage or delayed demand is permitted, add an explicit variable and an agreed rule or cost. A shortage variable records the amount of unmet need while preserving its distinction from delivered fabric.

Test capacity and lane changes

Suppose Mill 2 falls to 400 m, while Mill 1 can supply 1,400 m. The optimal plan sends Mill 2's 400 m to C, while Mill 1 sends 600 m to A, 700 m to B and 100 m to C.

Its cost is 600 × $4 + 700 × $6 + 100 × $8 + 400 × $3 = $8,600. The $1,100 increase over the base plan belongs to this particular scenario and should not be treated as a fixed charge per metre of lost capacity.

In a different case, keep Mill 1 at 1,000 m and raise Mill 2 to 900 m. The minimum cost becomes $7,300. Mill 1 sends 600 m to A and 300 m to B, leaving 100 m unused, while Mill 2 sends 400 m to B and 500 m to C.

The extra 100 m of Mill 2 capacity saves $200 in that case, but its value changes once the next constraint becomes active. Do not extend one marginal saving across any amount of extra capacity without solving the new case.

Now prohibit Mill 2's lane to C under the original capacities. The optimum costs $9,300: Mill 1 sends 500 m each to A and C; Mill 2 sends 100 m to A and 700 m to B. A lane rule can change both cost and the source used for another unit.

Model whole rolls and single-source rules explicitly

Although the base quantities are continuous metres, real orders may require whole rolls, minimum lots or fixed pack sizes. Since rounding a continuous solution afterwards can exceed supply or leave a destination short, add the actual rules before treating the plan as an order.

Since whole rolls are not always equal lengths, a model where roll identity matters may need a separate assignment decision and verified usable quantity for each roll. A generic integer number of metres will not enforce that structure.

Single sourcing adds a further restriction that makes the base plan infeasible when every unit must receive its complete requirement from only one mill. Balanced total supply forces Mill 1 to send 1,000 m, but no combination of complete demands of 600, 700 and 500 m totals 1,000 m.

Use binary assignment variables when the model must decide whether a lane or source is used, including cases where fixed charges or minimum quantities depend on that choice. SciPy's mixed-integer programming documentation explains variables restricted to integer values. The line-balancing optimisation guide provides another apparel example where whole assignments matter.

Add fixed charges without hiding them in a unit rate

Suppose a lane costs $4 per metre plus a $150 dispatch fee whenever it is used. Sending 100 m costs $550, equivalent to $5.50/m, whereas sending 500 m costs $2,150, equivalent to $4.30/m. The average rate changes with the quantity, so entering either average as a constant lane cost can distort the decision.

A mixed-integer model can use a binary variable y for whether the lane is opened. Include $150y in the objective and add constraints that link the shipment quantity x to the decision represented by y. If the largest feasible shipment is 500 m, the constraint x ≤ 500y ensures that an unused lane carries zero and a used lane stays within that bound.

If a used lane also requires at least 100 m, add x ≥ 100y. These constraints apply the minimum only when the lane is selected, using a justified upper bound from capacity and demand rather than an unnecessarily large number. Keep the model linear and apply the solver settings suited to the added integer decisions.

Diagnose an infeasible sheet before changing demand

Because an infeasible result can reflect either a real shortage or a worksheet mistake, check the totals before examining each destination's allowed sources. A destination can be short even when total supply is ample if its approved lanes have too little capacity.

Review copied formulas and constraint ranges. A missing column in a row sum, the wrong inequality sign or a capacity entered in kilograms can create a false conflict. Correct any source error with supporting evidence, but keep genuine infeasibility visible while seeking an operating change when the inputs are valid.

Keep the model aligned with purchase commitments

An allocation is a proposal until the source confirms and the planner reserves the quantity. Record the time and version of each capacity confirmation so that separate sheets do not each use the same available metres and create a combined overcommitment.

A planner may override the model for new information, such as a delay or a shade-lot restriction. Preserve the original result alongside the revised quantities, then recheck feasibility and cost under the updated facts. Do not label an altered plan as the unchanged output of the earlier solve.

Before purchase release, confirm fabric approval, delivery timing, lot rules and actual ordering units. Reconcile every source and destination total so that each order traces to a valid lane, a defined need and reserved capacity. That is what makes the lowest-cost calculation usable on the factory floor.

Allocation connects to planning and sequencing, so see machine capacity planning, EDD and SPT scheduling, Johnson's rule and garment feasibility review.

References and further reading