On this page
Weighted facility assignments: exact review and preserved evidence
9 October 2026. The second facility module adds weighted demand, separate client/site IDs, rectangular costs, required sites and whole-client capacity assignments. It addresses a concrete gap identified in the public planning workflow. It is a local prototype using ordinary exact arithmetic and an optional existing solver. No customer study, source approximation engine, geographic validation or commercial benefit was established.
Inspect the result
| Generated example | Submitted cost | Best checked cost | Exact relaxed lower bound | What the review demonstrates |
|---|---|---|---|---|
| Weighted choice | 40 | 10 | 0 | Demand changes the preferred site; an unweighted model answers a different question |
| Capacity reassignment | 12 | 10 | 4 | Nearest-site reassignment overloads a site; a checked alternative respects both capacities |
| Fractional demand/capacity | 11/30 | 11/30 | 1/10 | Rational input remains exact through review and integer solver scaling |
| Required site | 40 | 40 | 0 | A mandatory site can prevent a cheaper otherwise feasible choice |
| Zero demand | 0 | 0 | 0 | Every client still requires an explicit assignment; equality independently proves this model's optimum |
| 100 clients, 10 sites | 5472 | 2373 | 2260 | A rectangular weighted/capacitated model can be checked, with a remaining quality-bound difference of 113 |
| Unsplittable load | Not accepted | Unknown | 2 | One demand of two cannot fit into either capacity-one site; solver infeasibility is reported separately |
| Split assignments | Not assessed | Unknown | Not assessed | Unsupported assignment rules are refused before calculation |
| Duplicate identity | Not assessed | Unknown | Not assessed | Duplicate input IDs need correction |
| Escaped title | 40 | 10 | 0 | Supplied text is displayed literally rather than treated as HTML |
| Solver scale refusal | 20 | 20 | 10/1000003 | Exact local review survives a refused solver scale; no rounding is applied |
The 100-client case is self-authored, inspired only by the dimensions and features in public PySAL documentation. It neither reproduces that tutorial's data/results nor models an actual street network. All costs above are declared synthetic objective units, not observed savings or currency.
Run locally
The default checker uses Python's standard library. Choose an output directory that does not already exist:
python3 research/tools/facility_assignment_audit.py research/prototypes/facility-assignment-review-2026-10-09-v2/capacity_reassignment/review/inputs --output /tmp/my-facility-review-001
Without a solver, this case checks the submitted cost of 12 and rejects the overloaded nearest-site reassignment; it does not produce the alternative costing 10. Add --solver ortools with an interpreter containing OR-Tools to request a proposal. The recorded examples used OR-Tools 9.15.6755, two seconds, one worker and seed 125. Solver output is independently checked against the frozen model. No installation or account is needed for the default local review.
The exporter preserves all original input bytes, normalized JSON where valid, report.json, a standalone report.html, and a manifest of file hashes/runtime/tool identity. Existing output directories are refused. The published website serves these examples as static files; it has no customer upload endpoint or hosted solver.
Exact input contract
The input directory must contain exactly these six files, with no additional files or subdirectories. CSV column order may vary, but headers and complete rows must match the contract.
| File | Columns or fields | Meaning |
|---|---|---|
study.json |
schema, title, cost_units, demand_units, provenance, k, selection_rule, assignment_rule, objective, additional_constraints |
See the complete example |
clients.csv |
client_id,demand |
One nonnegative demand per unique client |
sites.csv |
site_id,capacity,required |
Blank capacity means unlimited; required is exactly true or false |
costs.csv |
client_id,site_id,unit_cost |
Every client-site pair exactly once; cost per demand unit |
selected.csv |
site_id |
Proposed open sites |
assignments.csv |
client_id,site_id |
Every client exactly once, including zero-demand clients |
Schema is facility-assignment-review-v1. Selection is exactly_k or at_most_k, with at least one selected site. Assignment is whole_client_to_one_open_site; objective is weighted_sum_assignment_cost. Additional constraints must be an empty list. Nonempty additional constraints, other objectives and split-assignment rules receive an unsupported-model result. Required sites must be open, but need not serve a positive load or be filled to capacity.
IDs are case-sensitive ASCII strings of at most 64 characters; leading zeros are preserved. Client and site IDs occupy separate namespaces. Input costs/demands/capacities are nonnegative decimals or fraction strings with at most 128-bit rational components. Scientific notation and floating coercion are refused. A rectangular cost matrix need not be symmetric or satisfy a triangle inequality; this ordinary model claims no strict-metric theorem eligibility.
The supported objective is exactly the sum of demand times assigned unit cost. Capacity uses the same demand units. Fixed opening costs, minimum utilization, multiple commodities, time windows, fairness, assignment splitting, uncertain input measurements and geospatial route validation require other models. A user's provenance declaration is retained, not independently authenticated.
Feasibility, quality and solver status
The checker independently verifies selected IDs, site budget, required sites, one whole-client assignment to an open site, and all capacity loads. An invalid submitted plan does not acquire an accepted cost. A nearest-site reassignment is only an alternative proposal: it can violate capacities and is rejected when it does.
The exact lower bound sums each client's demand times its cheapest cost over all candidate sites, relaxing opening count, required sites and capacities. Every feasible plan costs at least that amount. Subtracting this lower bound from a checked feasible cost gives an upper bound on suboptimality, not the measured difference from a known optimum. Equality establishes optimality for the frozen model. Otherwise independent optimality stays unknown, even when CP-SAT reports OPTIMAL. A solver-reported INFEASIBLE status is not an independent infeasibility certificate.
This module does not enumerate all facility plans. Exhaustive enumeration appears only in the separate tiny validation oracle. No family-125 approximation guarantee is attached to weighted or capacitated inputs. The strict metric module retains its separate assumptions, bounded enumeration and named dual certificates.
Limits and validation
Input limits are 512 clients, 128 sites, eight MiB per file and sixteen MiB combined. The optional adapter scales rational demand/capacity and weighted objectives separately, with denominator LCMs at most one million and conservative integer limits of 2^60. It refuses larger scales/ranges without rounding. These are explicit input/model limits; they do not constitute a wall-time or memory guarantee for parsing and exact arithmetic. The solver limit covers solver execution only.
7,926 main controls include 7,776 tiny models and 93,312 submitted plans, compared with a separate direct feasibility/objective oracle. The complete grid varies costs, demand, capacities, required sites, k and both selection rules. Other controls cover malformed/unsupported inputs, row/column permutations, BOMs, identity separation, eleven solver/export cases, exact fractions, caps, HTML escaping and output preservation. Exhaustive grid, saved solver comparison.
26 further controls check eleven preserved computations and clearer gap wording, both byte limits, and actual extra-file/directory rejection. Total new controls: 7,952. The checks are finite software evidence, not a formal correctness proof, production benchmark or customer validation.
Edition v2 preserves the original computed JSON and raw inputs byte-for-byte, and only clarifies the HTML's gap wording. Each manifest distinguishes the original computation tool hash from the rendering tool hash. Historical tool copies are inert evidence and are never executed. Complete artifact manifest.
Next product decision
Prepare a permissioned-study evaluation of errors found, false alarms, review time and delivery effort. Add local browser intake and stronger independently checked bounds only against a useful review workflow. The first-product plan retains an unvalidated AUD 5,000-10,000 assisted-review experiment. No outreach, paid pilot or purchase commitment occurred.