What does Routing Periodic Quotas conclude, in numbers, about “Shadow Prices and the Reset Countdown: How the Marginal Value of Quota Falls with Time”?
Answer: Strong duality holds exactly on the problem of Chapter 1, and the shadow price of 9/40 for H is valid only between 400 and 900 units; with less quota it rises to 0.4375 and with more it falls to 0.0500. Tasks arriving online turn the plan into a dynamic programme: the nearer the reset and the larger the balance, the less one H unit is worth, down to nothing with ten or so tasks to come; with a tight balance it stays dear. Countdown re-solving approaches the optimum but needs a margin against fluctuation. The next chapter turns from time to the tasks themselves: complexity has to be judged, judgements err, and how much of the benefit of routing survives the errors?
Scope of the numbers: Under illustrative parameters the linear programme gains 0.1668 to 0.2217 over arrival order, but only 0.41 % to 5.05 % over a fixed rule that sorts by complexity; most of the gain comes from sorting itself. Parameters are illustrative and contain no vendor's prices or quotas; all calculations are generated by the book's programs.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.0500, 0.4375, 40, 400, 900
| primal optimum 893, dual b.y 893, equal: True | |||
| duals: H 9/40 | F 0 | demand rows 19/20 8/5 9/4 49/10 | |
| H quota | optimum | y_H | marginal class on H |
| 0 | 690.00 | 0.4375 | - |
| 100 | 733.75 | 0.4375 | critical |
| 200 | 777.50 | 0.4375 | critical |
| 300 | 821.25 | 0.4375 | critical |
| 400 | 848.00 | 0.2250 | complex |
| 500 | 870.50 | 0.2250 | complex |
| 600 | 893.00 | 0.2250 | complex |
| 700 | 915.50 | 0.2250 | complex |
| 800 | 938.00 | 0.2250 | complex |
| 900 | 960.50 | 0.2250 | complex |
| 1000 | 969.00 | 0.0500 | standard |
| 1100 | 974.00 | 0.0500 | standard |
| 1200 | 979.00 | 0.0500 | standard |
| 1300 | 984.00 | 0.0500 | standard |
| 1400 | 989.00 | 0.0500 | standard |
Show the full program
# Chapter 3. p31: the shadow price of quota, and how it steps down.
# Model: the routing programme of p21 (two tiers, four classes). The
# dual value y_H of the H quota row is the extra expected output from
# one more H unit; strong duality says b.y equals the primal optimum,
# checked here in exact Fractions. Then the H quota is scanned from 0
# to 1,400 units: the optimum is concave and piecewise linear, and its
# slope is y_H. All parameters are illustrative units.
from fractions import Fraction as Fr
def simplex(c, A, b, rule="bland", cap=500):
m, n = len(A), len(c)
T = [[Fr(v) for v in A[i]] + [Fr(int(i == j)) for j in range(m)]
+ [Fr(b[i])] for i in range(m)]
z = [-Fr(v) for v in c] + [Fr(0)] * (m + 1)
basis = [n + i for i in range(m)]
steps = 0
while steps < cap:
cols = [j for j in range(n + m) if z[j] < 0]
if not cols:
break
if rule == "bland":
e = cols[0]
else:
e = min(cols, key=lambda j: (z[j], j))
rows = [i for i in range(m) if T[i][e] > 0]
if not rows:
return None
r = min(rows, key=lambda i: (T[i][-1] / T[i][e], basis[i]))
p = T[r][e]
T[r] = [v / p for v in T[r]]
for i in range(m):
if i != r and T[i][e] != 0:
f = T[i][e]
T[i] = [a - f * w for a, w in zip(T[i], T[r])]
f = z[e]
z = [a - f * w for a, w in zip(z, T[r])]
basis[r] = e
steps += 1
x = [Fr(0)] * (n + m)
for i, j in enumerate(basis):
x[j] = T[i][-1]
return x[:n], z[-1], z[n:n + m], steps
VALUE = (1, 2, 5, 10)
COST = {"H": (4, 6, 10, 16), "F": (1, 2, 3, 4)}
SUCC = {"H": ("0.97", "0.95", "0.90", "0.85"),
"F": ("0.95", "0.80", "0.45", "0.15")}
DEMAND = (300, 150, 60, 20)
def solve(qh, qf):
c = [VALUE[k] * Fr(SUCC[t][k]) for t in "HF" for k in range(4)]
A = [[COST["H"][k] if t == "H" else 0 for t in "HF" for k in range(4)],
[COST["F"][k] if t == "F" else 0 for t in "HF" for k in range(4)]]
b = [qh, qf]
for k in range(4):
A.append([1 if j == k else 0 for t in "HF" for j in range(4)])
b.append(DEMAND[k])
return simplex(c, A, b), b
(x, val, y, _), b = solve(600, 900)
dual = Fr(0)
for bi, yi in zip(b, y):
dual += bi * yi
print("primal optimum %s, dual b.y %s, equal: %s" % (val, dual,
val == dual))
print("duals: H %s F %s demand rows %s" % (
y[0], y[1], " ".join(str(v) for v in y[2:])))
print("H quota optimum y_H marginal class on H")
names = ("routine", "standard", "complex", "critical")
prev = None
for qh in range(0, 1401, 100):
(x, val, y, _), _b = solve(qh, 900)
marg = "-"
for k in range(4):
if 0 < x[k] < DEMAND[k]:
marg = names[k]
print("%7d %7.2f %6.4f %s" % (qh, float(val), float(y[0]), marg))Single source and citation
Fan, Y. (2026). Peak-Shaving Periodic Quotas and Cross-Model Routing: Linear Programming against Reset Countdowns to Split Work between Heavy-Reasoning and Fast Models (Version 1.0.0), Chapter 3: Shadow Prices and the Reset Countdown: How the Marginal Value of Quota Falls with Time. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-270 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026270,
author = {Fan, Yafu},
title = {Peak-Shaving Periodic Quotas and Cross-Model Routing: Linear Programming against Reset Countdowns to Split Work between Heavy-Reasoning and Fast Models},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Price of First Come, First Served: Exhaustion before the Reset and Waste at It
- Chapter 2 · A Standard-Library Simplex: Exact Fractions, Bland's Rule and the Worst Case
- Chapter 4 · Routing across Models: Complexity Classes, Label Errors and Cascades
- Chapter 5 · Peak Shaving and Valley Filling: Deferral, Pulling Forward and a Backlog under Short Reset Windows
- Chapter 6 · Greedy against Linear Programming: Random Arrival, Prices Learned from a Sample, and Drift
- Chapter 7 · Eastern and Western Classics: Gathering and Releasing in the Guanzi, and Kantorovich's Resolving Multipliers
- Chapter 8 · A Daily Task Routing Table: the Empirical Loop, the Distilled Tool and a Pre-registered Test