Worked examples and user guide
The demo asks a conditional question: given a measured trade network and explicit limits on supply and bilateral trade, how much of the original import target can still be served after a disruption? Each result belongs to the selected commodity, annual baseline, reporting cohort, and scenario assumptions.
This guide moves from a small example that can be checked by hand to the larger scenarios shipped with the application. The companion model document gives the full optimization problem, while sensitivity and interpretation defines the shock measures.
1. A small network that can be checked by hand
Suppose two exporters, A and B, supply two importers, C and D. Let the baseline trade matrix be
Rows are exporters and columns are importers. The units can be any consistent volume unit. Exporter totals are and . Import targets are and , so the total import target is .
Now cut A’s supply by 50%, allow B to supply 50% above its baseline, and allow existing bilateral routes to expand by 50%. The resulting supplier capacities are
On the existing network, the route capacities are , , and . The route B to C does not exist in this support. A route capacity of 90 does not give A 90 units of supply. All of A’s outbound flows together must remain at most 40.
Maximum aggregate service
Total available supply is 70. Therefore no allocation can serve more than 70. The following allocation attains that bound:
Thus and the network loses 30 units of service. Importer C receives of its target and D receives .
The fairness objective
C can receive only from A, so C cannot receive more than 40. This gives the upper bound on the minimum buyer service fraction. The displayed allocation attains it. Once maximum throughput and that floor are imposed, the allocation above is forced in this small example.
The minimum fraction is a policy choice. It protects the most severely rationed buyer in proportional terms. It does not represent a market price, a shipping contract, or an observed rationing agreement.
Complete candidate routes
Allow B to supply C as a hypothetical candidate route. Available supply is still 70, so total service remains 70. However, proportional service of 70% is now feasible:
C receives 42 and D receives 28. Both receive 70% of their targets. The complete network improves the minimum buyer fraction without changing aggregate service.
This is why a zero routing penalty does not mean route access has no distributional effect. The routing penalty compares total service. Country outcomes and the allocation rule contain additional information.
Minimum adjustment and remaining ties
For both matrices above,
The complete-network allocation is not unique. For example, the matrix
also serves 70, gives each importer 70% service, and has absolute change 50. Two correct solvers can select different routes while agreeing on all three objective values. Route-by-route differences alone are therefore an inadequate test of numerical correctness.
Reading the shock measures
The direct disruption is . The network ultimately loses 30, so it absorbs 10 of the 40 directly disrupted units. Recovery is
The supply-only lower bound on lost service is . Both supports attain it, so the routing penalty is zero. On the existing network, the minimum country service fraction is nevertheless lower than on the complete network.
2. Reproducing the shipped examples
Run the following from the repository root:
node scripts/worked_examples.mjsThe script reads the saved snapshot and writes
review/worked-examples.json. It calls the same numerical
module as the browser. It does not need network access or a data-service
credential. The independent Python comparison is a separate exercise
described in validation and
limits.
The examples below use the 2025 annual baseline, 10% replacement-supply headroom, 25% expansion of existing routes, and existing-route support. Volumes are in millions of physical barrels within each product. LNG quantities refer to liquid LNG barrels.
| Scenario | Direct disruption | Lost imports | Loss as % of panel imports | Recovery |
|---|---|---|---|---|
| USA LNG supply reduced by 50% | 485.935 | 144.899 | 3.105% | 70.181% |
| USA to France LNG route closed | 141.163 | 104.542 | 2.240% | 25.943% |
| Russian crude supply reduced by 50% | 735.014 | 0.000 | 0.000% | 100.000% |
| USA and Qatar LNG supply each reduced by 50% | 899.228 | 612.457 | 13.125% | 31.891% |
These figures are outputs of the stated capacity model. They describe the included reporting panel, rather than global production, global consumption, or actual crisis losses. A result for a 2025 baseline is not a prediction made before the 2022 crisis.
3. A 50% USA LNG supply cut
The LNG panel has a baseline import target of approximately 4,666.168 million liquid barrels. A 50% reduction in the USA’s modeled supply directly removes 485.935 million barrels. The network serves about 4,521.270 million barrels after adjustment, leaving a shortfall of 144.899 million barrels.
The interpretation is that replacement supply and permitted changes on existing routes absorb about 70.18% of the direct exposure. The remaining shortfall is about 3.11% of the panel’s import target.
Under complete candidate routes, the loss is approximately 2.497% of the panel target. The difference is 0.608 percentage points. That difference measures the aggregate value of relaxing the existing-route support under the same modeled supplies and demands. It is not a monetary value, an estimate of a terminal investment’s return, or a promise that the candidate routes could be established immediately.
The severity curve first develops a shortfall at a cut of approximately 35.09%. A complete outage produces a loss of approximately 13.52% of panel imports. The integrated stress measure is approximately 4.388 percentage points of panel loss integrated over severity on . It is an area under a conditional curve, not an expected loss unless a probability distribution over severities is supplied separately.
The selected solution gives the least-served buyer a service fraction of approximately 89.62%. A buyer’s allocation range can be much wider than that selected outcome because the range is calculated before the fairness and minimum-change priorities are imposed. Those ranges are separate feasible extrema, not statistical confidence intervals.
4. Closing the USA to France LNG route
The baseline USA to France flow is approximately 141.163 million liquid barrels. France’s total import target in the panel is approximately 287.651 million barrels.
Closing this route sets its capacity to zero. It does not remove the USA’s supply from every other buyer. Exporters retain the specified supply headroom, and the remaining network can adjust subject to its route capacities.
With existing routes, France receives approximately 183.109 million barrels. Its shortfall is 104.542 million barrels, or approximately 36.343% of its import target. The same loss is approximately 2.240% of the entire LNG panel’s target. These two percentages have different denominators and answer different questions.
With complete candidate routes, the model can serve all panel import targets. The loss in the existing network is therefore attributable to its route constraints under the chosen supply assumptions. The result motivates examination of alternative supplier access. It does not identify an implementable shipment plan without information about terminals, vessels, contracts, product compatibility, timing, and costs.
The route can absorb a reduction of approximately 25.94% before aggregate service falls. At a zero corridor cut, the selected route is capped at its baseline, even when other existing routes have 25% headroom. This convention matters when comparing a corridor experiment with a supplier experiment.
5. A Russian crude supply cut
At a 50% Russian supply cut, the 2025 crude panel remains fully served under the selected headroom assumptions. The model absorbs the directly disrupted 735.014 million barrels through the feasible network.
This outcome does not imply that a real disruption would be costless. The model contains no prices, freight rates, voyage times, contract frictions, refinery constraints, inventories, or financial sanctions beyond the selected capacity restrictions. A feasible reallocation may be expensive, slow, or operationally unavailable.
The existing-route severity curve starts losing service at a cut of approximately 71.96%. That threshold is conditional on this annual panel and the 10% supply and 25% route assumptions. Changing either assumption can change the threshold. It should not be interpreted as an intrinsic resilience score for Russia or for the world oil market.
6. Joint USA and Qatar LNG disruption
The joint experiment cuts both selected suppliers by 50%. It produces a modeled shortfall of approximately 612.457 million liquid barrels, or 13.125% of the panel target. Recovery falls to approximately 31.891% of the direct disruption.
The existing and complete supports have essentially the same aggregate loss in this example, up to floating-point error. Removing route restrictions therefore does not resolve the modeled aggregate shortage at this severity. The binding limitation is the available supply under the current assumptions.
This comparison illustrates why a joint shock should be solved directly. Adding the losses from separate shocks generally fails because suppliers and routes share capacity and compete to serve the same buyers.
The joint severity curve applies a common cut to both selected suppliers. If the main scenario instead uses unequal cuts, the displayed severity curve traces a different one-dimensional path through that two-dimensional shock space. The current main scenario remains defined by its own two cuts.
7. Moving through the website
Choose the experiment
Select crude or LNG, then a scenario baseline of 2021 or 2025. The baseline fixes the included exporters, buyers, quantities, and import targets. The historical comparison view has annual observations for 2021 through 2025, but the scenario solver is not available for every year in that interval.
Choose a supply cut, country-pair restriction, or EU + UK corridor restriction. Supply cuts reduce a selected exporter’s total available supply. Pair restrictions reduce one bilateral route. Regional restrictions reduce the selected exporter’s routes into the listed EU + UK destinations. A second supplier can be selected for a joint supply shock.
Set the cut, supply headroom, route expansion, and support. Committed control changes recompute the scenario automatically. Run scenario also recomputes explicitly and closes the controls on mobile. Pending calculations clear the previous result and disable export until a result for the current settings is available.
Inspect the same solution in three views
The map uses country label points. Its curved connections are schematic. They do not trace shipping lanes, pipelines, ports, straits, or vessel voyages.
The circular network emphasizes connectivity and changes in bilateral flows. The complete matrix gives every displayed source-destination combination a position, including zeros and unavailable observations. A dense matrix is a complete representation of a set of pairs. It does not mean that every pair has positive flow or a usable observed baseline.
The display control can show the largest changes or all links. This changes only the drawing. It does not remove variables from the optimization, change capacities, or truncate the downloads.
Select a country or route to inspect its baseline, modeled allocation, and change. Green and rust colors distinguish increases and decreases. In complete-route scenarios, an allocated candidate may have an unknown observed baseline. The interface retains that distinction instead of reporting a measured gain from zero.
Use the country-pair directory
The directory includes 254 country and statistical-area identifiers and 64,262 ordered non-self pairs. The full directory CSV also includes the 254 excluded self-pairs, for 64,516 rows. These identifiers are not interchangeable with ISO country codes. For example, the shipped trade panels use USA code 842 and France code 251.
Only supported roles with known baseline quantities can be selected for a direct pair restriction. A known-zero route can be selected, but cutting its baseline capacity removes no measured direct flow. An unknown pair has no defensible numerical direct-exposure estimate. An outside-panel pair lacks one or both active model roles.
The directory is deliberately broader than the runnable scenario set. This prevents country coverage from being mistaken for complete quantitative observation.
Explore sensitivity
Use the severity curve to compare progressively larger disruptions under the same headroom assumptions. The replacement-supply and route-expansion grid asks which capacity relaxation improves aggregate service at the selected cut. The exporter ranking applies a standardized 50% supply cut to one exporter at a time.
The ranking is conditional on the panel, commodity, route support, and headroom. It is not a forecast of which exporter is most likely to be disrupted.
Compare recorded history
Switch to observed comparisons and choose two years. The application compares quantities on the common usable set of bilateral observations. A missing or rejected quantity remains unavailable. It is not relabeled as zero.
An observed change between 2021 and a later year includes every force affecting trade over that interval. The displayed difference alone does not identify the effect of the war, a sanction, a price movement, or a model-guided policy.
Export and share
Use Copy link to retain the selected scenario controls in the URL. A shared link reopens those settings and recomputes the scenario from the deployed snapshot. Reproducibility also depends on retaining that same snapshot and solver version.
The JSON download contains assumptions, metrics, allocations, and interpretation metadata. CSV downloads provide country results, route flows, and a complete pair table. Unknown values remain blank or explicitly marked by status, rather than silently becoming measured zeros.
When sharing a result, record the commodity, baseline year, scenario scope, selected source and destination identifiers, shock fractions, supply headroom, route expansion, support mode, snapshot timestamp, and model revision. This is the minimum information needed to interpret a scenario unambiguously.
8. Questions the demo can answer
The app can identify shortfalls that follow from its stated capacities, compare the value of broader route access, locate restrictive cuts, and show how results change with assumptions. It can also reveal how much a country’s allocation depends on the selected distributional rule.
A decision about actual shipments requires additional operational inputs. A forecast requires a time-indexed prediction model and evaluation on unseen periods. A claim that a policy would have improved the 2022 outcome requires a counterfactual design with identified treatment, outcomes, timing, and comparison assumptions. The current capacity model can inform those studies, but it does not by itself complete them.