Variable shipping costs

Distinguishes convex from concave piecewise linear functions.

Now consider the costs of shipping from a given factory to a given showroom. Assume that for every pair (factory, showroom), there are different rates, varying according to the quantity shipped. To illustrate the difference between convex and concave piecewise linear functions, in fact, this example assumes that there are two different tables of rates for shipping cars from factories to showrooms. The first table of rates looks like this:

  • a rate of 120 per car for quantities between 0 and 200;

  • a rate of 80 per car for quantities between 200 and 400;

  • a rate of 50 per car for quantities higher than 400.

These costs that vary according to quantity define the piecewise linear function represented in Figure 1. As you see, the slopes of the segments of that function are decreasing, so that function is concave.

Figure 1. A concave piecewise linear cost function
Concave piecewise linear cost function

Also assume that there is a second table of rates for shipping cars from factories to showrooms. The second table of rates looks like this:

  • a rate of 30 per car for quantities between 0 and 200;

  • a rate of 80 per car for quantities between 200 and 400;

  • a rate of 130 per car for quantities higher than 400.

The costs in this second table of rates that vary according to the quantity of cars shipped define a piecewise linear function, too. It appears in Figure 2. The slopes of the segments in this second piecewise linear function are increasing, so this function is convex.

Figure 2. A convex piecewise linear cost function
Convex piecewise linear cost function