What does Routing Periodic Quotas conclude, in numbers, about “Eastern and Western Classics: Gathering and Releasing in the Guanzi, and Kantorovich's Resolving Multipliers”?

Answer: Chapter 7 examines "years bring dearth and plenty, so grain is dear or cheap" from the Guanzi and Kantorovich's resolving multipliers of 1939.

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 only

draws: lean 11, normal 21, rich 8
casesd(use)short/lostwasted/idle
grain, granary cap 0.00.17860.11000.0800
grain, granary cap 0.40.15200.07000.0400
grain, granary cap 1.20.14280.06000.0100
quota, backlog 0.0 s 0.00.17860.08250.1100
quota, backlog 0.4 s 0.40.15200.04120.0700
quota, backlog 1.2 s 0.40.14280.01030.0600
Show the full program
# Chapter 7. p71: the Guanzi granary next to a quota that cannot keep.
# Model, part 1 (grain): need 1.0 a year; harvests 0.6, 1.0 or 1.4
# (lean, normal, rich) with chances 1/4, 1/2, 1/4, seeded, 40 years. A
# public granary buys the surplus of rich years and sells in lean years
# ("gather when cheap, release when dear"), store capped at C.
# Part 2 (quota): capacity 1.0 a cycle that vanishes at the reset;
# demand 0.6, 1.0 or 1.4 with the same chances. The supply cannot be
# stored, but a share s of the demand can wait: a backlog capped at C
# plays the granary's part with time running the other way. Shares
# are of total need or demand. Parameters illustrative.
import math
import random
import statistics

YEARS = 40
rng = random.Random(20261113)
draws = [rng.choices((0.6, 1.0, 1.4), weights=(1, 2, 1))[0]
         for _ in range(YEARS)]


def grain(cap):
    stock, short, waste, eat = 0.0, [], [], []
    for y in draws:
        if y >= 1.0:
            put = min(y - 1.0, cap - stock)
            stock += put
            waste.append(y - 1.0 - put)
            eat.append(1.0)
            short.append(0.0)
        else:
            out = min(1.0 - y, stock)
            stock -= out
            eat.append(y + out)
            short.append(1.0 - y - out)
            waste.append(0.0)
    return eat, math.fsum(short) / YEARS, math.fsum(waste) / YEARS


def quota(cap, s):
    back, lost, idle, done = 0.0, [], [], []
    for d in draws:
        urgent, flex = (1 - s) * d, s * d
        u = min(1.0, urgent)
        room = 1.0 - u
        b = min(room, back)
        back -= b
        room -= b
        f = min(room, flex)
        room -= f
        keep = min(flex - f, cap - back)
        back += keep
        lost.append(urgent - u + flex - f - keep)
        idle.append(room)
        done.append(u + b + f)
    tot = math.fsum(draws)
    return done, math.fsum(lost) / tot, math.fsum(idle) / YEARS


print("draws: lean %d, normal %d, rich %d" % (
    draws.count(0.6), draws.count(1.0), draws.count(1.4)))
print("case                      sd(use)  short/lost  wasted/idle")
for cap in (0.0, 0.4, 1.2):
    eat, sh, wa = grain(cap)
    print("grain, granary cap %.1f    %7.4f  %10.4f  %11.4f" % (
        cap, statistics.pstdev(eat), sh, wa))
for cap, s in ((0.0, 0.0), (0.4, 0.4), (1.2, 0.4)):
    done, lo, idl = quota(cap, s)
    print("quota, backlog %.1f s %.1f  %7.4f  %10.4f  %11.4f" % (
        cap, s, statistics.pstdev(done), lo, idl))

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 7: Eastern and Western Classics: Gathering and Releasing in the Guanzi, and Kantorovich's Resolving Multipliers. 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