Manuscript Offprint
arXiv:2610.24316Computational Complexity and Exact Algorithms for Pressure-Driven Hydrogen Charging
Abstract
We study the problem of deciding the feasibility of pressure-driven hydrogen charging from supply cylinders to demand cylinders without replenishment, asking whether an order of transfers allows every demand cylinder to reach its target pressure. Hydrogen can be transferred from a cylinder to another only when the supply cylinder has higher pressure than the demand cylinder. The charging to each demand cylinder must be completed before starting another, and each transfer continues until the connected cylinders reach equal pressures or the demand cylinder reaches its target. We consider equal-capacity supply cylinders and arbitrary positive rational demand cylinder capacities.
Let be the number of demand cylinders and the binary input length. With one supply cylinder, feasibility is decidable in polynomial time; with two, it is NP-complete even with cylinder capacities equal to 1 and nonnegative integer pressures. We prove that feasibility is preserved even if the supply cylinders are always used in non-decreasing order of their current pressures when filling each demand cylinder. We also show that majorization of residual supply cylinder pressure states justifies discarding majorized states in dynamic programming over sets of completed demand cylinders without losing any feasible remaining demand cylinder order. Using these structural results, we design exact algorithms for deciding feasibility and analyze their running times; we also establish complexity bounds for the problem. With two supply cylinders, one state per completed demand cylinder set suffices, yielding poly() time and space. With three, the exponential time hypothesis (ETH) excludes deterministic poly()-time algorithms. This lower bound is tight in the exponent because the rule for order of supply cylinders allows feasibility to be decided in time by enumerating only demand cylinder orders.
2012 ACM Subject Classification Theory of computation → Design and analysis of algorithms; Theory of computation → Problems, reductions and completeness
Keywords and phrases hydrogen charging, cascade filling, computational complexity, majorization, exact exponential algorithms, exponential time hypothesis
Complexity and Exact Algorithms for Hydrogen Charging
1 Introduction
Hydrogen refueling stations fill vehicle tanks using several supply cylinders at different pressures. Research on these systems has examined filling control and storage configurations, focusing on refueling time and energy consumption [1]. A common filling method uses lower-pressure supply cylinders before higher-pressure ones. Studies have also examined when to switch between these cylinders to improve refueling performance [6, 18].
We study the problem of deciding the feasibility of pressure-driven hydrogen charging under an isothermal ideal-gas model without replenishment. Each cylinder has a specified capacity and initial pressure; each demand cylinder also has a target pressure. To reflect station operations in which vehicles are filled one at a time [2, 5, 16], we require each demand cylinder to reach its target pressure before starting to charge another demand cylinder. Hydrogen flows only from a higher-pressure supply cylinder to a lower-pressure demand cylinder. Each transfer continues until the pair reaches equal pressures or the demand cylinder reaches its target pressure, whichever occurs first. We ask whether a transfer sequence fills every demand cylinder to its target.
Completing the same set of demand cylinders consumes a fixed total amount of hydrogen, but different filling orders can leave different supply cylinder pressure distributions. These distributions affect whether all remaining demand cylinders can reach their target pressures. This dependence on the residual pressure distribution complicates this problem.
For equal-capacity supply cylinders, if a demand cylinder can be filled from a supply cylinder state, using supply cylinders in non-decreasing order of their current pressures also succeeds. We prove this fact and that this rule leaves a residual supply cylinder pressure vector majorizing that of every other successful supply cylinder order. Majorization compares how unevenly a fixed total residual pressure is distributed [17]. We also prove that a majorizing state preserves every feasible remaining demand cylinder order, with majorization maintained after each demand cylinder is filled. These results justify searching only over demand cylinder orders and discarding majorized states.
Based on these findings, we show the following. Let be the number of demand cylinders and the binary input length. With one supply cylinder, sorting by non-increasing target pressure decides feasibility in polynomial time. With two supply cylinders, conservation fixes the residual pressure total for each completed demand cylinder set; majorization totally orders its residual states. The dynamic program retains at most one representative state for each of the possible sets of completed demand cylinders, using poly() time and space. Even when all cylinders have unit capacity, the problem is NP-complete for nonnegative integer pressures, and the exponential time hypothesis (ETH) rules out algorithms running in poly() time. The problem is strongly NP-complete for rational pressures even when all cylinders have unit capacity.
With three supply cylinders, ETH excludes deterministic poly(L)-time algorithms, even with unit-capacity supply cylinders and positive integer pressures. By the supply cylinder ordering result above, enumerating demand cylinder orders yields an poly(L)-time algorithm, establishing the optimal deterministic exponent under ETH. Table 1 summarizes our time bounds and hardness for the cases with supply cylinders.
Table 1 Our running-time upper bounds and hardness results for charging feasibility problems with equal-capacity supply cylinders and arbitrary positive rational demand cylinder capacities.
| Our upper bound | ETH lower bound (deterministic algorithms) | NP-completeness | |
|---|---|---|---|
| 1 | operations (Thm. 2) | — | — |
| 2 | time (Thm. 13) | (Cor. 5) | NP-complete (Thm. 3)Strongly NP-complete(unary rational pressures; Cor. 4) |
| 3 | time (Thm. 10) | (Thm. 18) | NP-complete (Thm. 3 instance plus a supply cylinder at initial pressure 0) |
Related work.
Scheduling with non-renewable resources studies job sequencing under resource constraints, with each job's requirements specified in advance as fixed constants [3, 4, 7]. In our model, on the other hand, even though each demand cylinder's total hydrogen requirement is fixed, withdrawals from individual supply cylinders can vary depending on current pressures and the order of supply cylinders. Thus, completing the same demands in different orders can leave different residual distributions, affecting feasibility.
2 Model and Basic Properties
2.1 Supply Cylinder Model and Transfers
Let and be the sets of supply cylinders and demand cylinders, respectively. Supply cylinders have a capacity and initial pressure; demand cylinders also have a target pressure:
All capacities and pressures are binary-encoded rationals, with total binary input length . Under the isothermal ideal-gas assumption, the amount of hydrogen is proportional to the product of capacity and pressure. Only transfers from supply cylinders to demand cylinders are allowed, with no replenishment or leakage. Let and be the current pressures, initially and . Our model requires each transfer to continue until the two pressures are equal or the demand cylinder reaches its target, increasing demand cylinder pressure by
and the pressure update is
Only transfers with are legal. Stopping at a demand cylinder's target is called target stopping.
Complexity and Exact Algorithms for Hydrogen Charging
2.2 Schedules and the Decision Problem
A schedule is a finite sequence of legal transfers , with ; pair specifies a transfer from supply cylinder to demand cylinder . A filling comprises the transfers to one demand cylinder, which is completed upon reaching its target. Each demand cylinder must be completed before another is filled; supply cylinders may be switched or skipped. A schedule completing every demand cylinder is feasible. The target hydrogen charging problem (THCP) asks whether such a schedule exists. For example, take equal-capacity cylinders with supply cylinder pressures and demand cylinder (initial, target) pressures and . Table 2 compares three filling orders.
Table 2 Supply states after the first fill; default supply order: .
| Demand cylinder order | Supply order for first fill | Supply cylinder state | Second demand cylinder pressure |
|---|---|---|---|
| at most (either order) |
2.3 Basic Properties
Conservation.
Update (1) preserves the capacity-weighted pressure sum. Thus, throughout any schedule,
Pressure monotonicity.
Supply cylinder pressures never increase, and demand cylinder pressures never decrease. A pair cannot be reused after equilibration or demand cylinder completion; hence .
▶ Lemma 1. For binary rational inputs, every pressure in a legal schedule has polynomial bit length. A proposed schedule of at most mn transfers can be verified in polynomial time. Consequently, THCP belongs to NP.
Proof. The equilibration and target-stopping formulas in (1) are affine, with input-determined rational coefficients and constants of polynomial bit length. Let be the product of the denominators of all input rationals, coefficients, and constants. There are formulas; hence . Initially, pressures have denominator ; update coefficients and constants have denominators dividing . A transfer changes pressures with denominator to pressures with denominator ; after transfers their denominator is . Because and pressures remain bounded by the largest input pressure, numerators and denominators have polynomial bit length. A feasible schedule is therefore a polynomial-size certificate verifiable by exact simulation.
3 Complexity with One or Two Supply Cylinders
▶ Theorem 2. With one supply cylinder, THCP is feasible if and only if a demand cylinder order of non-increasing target pressure is feasible. This condition can be checked using rational arithmetic operations and comparisons.
Proof. Discard demand cylinders already at their targets. Set . For a demand cylinder order, let be the cumulative pressure decrease of the supply cylinder through . By (1), the order is feasible exactly when for every . Interpreting demand cylinders as jobs, their processing times are and deadlines are . Jackson's earliest-due-date rule [13] therefore implies that the order of non-increasing target pressure is feasible whenever some order is. Sorting and checking prefix sums take operations.
▶ Theorem 3. With two supply cylinders and all capacities equal to one, THCP is NP-complete even for nonnegative integer pressures.
Proof. Lemma 1 establishes NP membership. We reduce from PARTITION. Let be the positive integers in the input instance. If their sum is odd, the reduction returns a fixed no-instance. Otherwise, let . The instance has unit-capacity supply cylinders , at pressures 7B, 11B, ordinary demand cylinders , and a gate demand cylinder , specified by (initial, target) pressures. It has demand cylinders, all with unit capacity; construction takes polynomial time and uses nonnegative integer pressures. Completing demand cylinder decreases the sum of supply cylinder pressures by . We show that completing requires using at pressure 6B, followed by at its initial pressure 11B. Thus, the ordinary demand cylinders completed before use only and have total weight B.
Completeness ( )
Suppose satisfies . Figure 1 shows a feasible schedule: each group of ordinary demand cylinders has total weight and uses one supply cylinder, whose pressure remains at least after every fill, in any order.
Figure 1 Pressures of ; pressure of below the middle arrow.
Soundness ( )
Suppose the THCP instance is feasible. Neither supply cylinder alone can complete , and the order , raises its pressure to at most . Hence, filling requires transfers from followed by . Let and be the pressures of and , respectively, immediately before they connect to in that order. After equilibration with , both and have pressure . Because equilibration with would yield , completing requires . Because cannot exceed 's initial pressure 11B, this implies .
Because implies , cannot transfer hydrogen to any further demand cylinder and ends at . After completing the gate demand cylinder at target 7B, has pressure at least 7B. If unused thereafter, this is its final bound. Otherwise, each transfer must complete its demand cylinder, because equilibration below 6B leaves it unfinished. Thus ends at pressure at least 6B.
Completing all demand cylinders raises their total pressure by , leaving final supply cylinder pressure sum by conservation. Because ends at and ends at pressure at least , we have , implying . Together with , this yields . The gate condition then implies . Because , we conclude that . Because and supply
Complexity and Exact Algorithms for Hydrogen Charging
cylinder pressures never increase, was not used before . The demand cylinders preceding were therefore completed using only and have total weight , yielding a solution to PARTITION.
▶ Corollary 4. THCP is strongly NP-complete even with exactly two supply cylinders and all capacities equal to one. This holds for nonnegative rational pressures whose reduced numerators and denominators are encoded in unary.
Proof. The reduction in Theorem 3 requires only positive weights summing to 2B and therefore also applies to rational PARTITION. Wojtczak [20, proofs of Theorems 4 and 5] reduces bounded-occurrence ALL-THE-SAME-SAT with r variables to rational PARTITION on 2r positive weights summing to 2r. Their reduced numerators and denominators are polynomially bounded in the source input size. Apply Theorem 3 with B = r and let be in lowest terms. The only potentially nonintegral pressures are , with positive reduced numerators at most and denominators at most . All other pressures are integers bounded by 11r, and there are demand cylinders. The unary output length is polynomial, proving strong NP-hardness; NP membership follows from Lemma 1.
▶ Corollary 5. Under ETH, THCP admits no poly(L)-time algorithm, even with two supply cylinders, unit capacities, and nonnegative integer pressures.
Proof. Under ETH, 3SAT admits no -time algorithm, where is the total number of variables and clauses [15, Theorem 8]. The standard reduction produces an equivalent SUBSET SUM instance with nonnegative weights and a target , all with bits [15, Section 3.3]. For the standard reduction to PARTITION [14, p. 100], let be the total weight. Remove zero weights, handle targets outside in polynomial time, and append and . Each half must sum to , forcing the original weights alongside to sum to . The resulting equivalent instance has at most positive weights, each with bits.
Theorem 3 produces an equivalent THCP instance with one demand cylinder per weight and one gate demand cylinder: , pressures of bits, and . A poly(L)-time algorithm would then solve 3SAT in time, contradicting ETH.
4 Cascade Dominance
Throughout this section, all supply cylinders have the same capacity .
4.1 Majorization and Cascade Operators
Majorization.
We represent residual supply cylinder states in non-decreasing order. For sorted states and , we use the standard majorization order [17]:
In Section 2.2, the supply cylinder states and after filling demand cylinder 1 have equal totals and are componentwise incomparable. However, because , and only permits completing demand cylinder 2. Theorems 8 and 9 establish the general preference: filling a demand cylinder in non-decreasing supply cylinder pressure order yields a residual state majorizing that of any other successful order. Replacing the initial state by a majorizing state preserves feasibility under this rule. For a real threshold and , define and , the sum of pressure excesses above . For any states and with the same sum,
This is a standard characterization of majorization [17, Proposition 4.B.3].
Cascade filling
Cascade filling scans supply cylinders in non-decreasing current pressure order to fill one demand cylinder. It skips cylinders at or below the demand cylinder pressure and stops at the target or after scanning all cylinders. Define the capacity ratio and let and . For a sorted supply cylinder state , the demand cylinder pressure update at supply cylinder before target stopping is
The update is non-decreasing in . Let denote the residual supply cylinder state after cascade filling of demand cylinder . For a supply cylinder permutation , let denote the sorted residual state after filling demand cylinder in -order. Either operator returns if its filling procedure fails. Whenever both orders complete demand cylinder , their residual supply cylinder pressure sums agree by conservation. Pressure monotonicity prevents reuse within a fill; thus appending unused cylinders extends any successful fill to a permutation with the same residual state.
▶ Lemma 6. Suppose equal-capacity supply cylinders are indexed by non-decreasing pressure at the start of a fill. Cylinders with the same pressure at that time may be indexed in either order. Cascade filling leaves their residual pressures non-decreasing by index.
Proof. If no supply cylinder is used, the supply cylinder state is unchanged. Otherwise, the cylinders skipped at the start keep their pressures unchanged. Each equilibration below the target leaves the supply cylinder at the new demand cylinder pressure. Because the demand cylinder pressure increases with each transfer, the residual pressures of these cylinders are non-decreasing in the order of use. If supply cylinder i completes demand cylinder j, its residual pressure is at least the target and at most its pressure before the transfer, . Earlier cylinders have residual pressures below the target, and unused later cylinders have pressures at least . Thus the residual supply cylinder pressures remain non-decreasing.
4.2 Cascade Dominance for One Demand Cylinder
Interchange arguments based on majorization are used in stochastic scheduling [8]. We prove cascade dominance by exchanging adjacent supply cylinders to place the one with lower pressure first. Such an exchange can raise the demand cylinder pressure after the pair and reduce the pair's total residual pressure. A higher demand cylinder pressure requires less hydrogen from the remaining cylinders. The next lemma quantifies the compensation via .
▶ Lemma 7. Fix a demand cylinder j with capacity ratio and an ordered sequence of distinct equal-capacity supply cylinders. Compare two fills from starting
Complexity and Exact Algorithms for Hydrogen Charging
pressures , fixing the demand cylinder capacity and target, initial supply cylinder pressures, and order . Let denote the residual supply cylinder pressure vector after filling from pressure , with unused cylinders unchanged. If filling from completes , then filling from also completes it and for every .
Proof. The demand cylinder pressure update is non-decreasing in incoming pressure. Higher pressure requires less hydrogen to reach the target and permits less transfer before equilibration. Each supply cylinder therefore transfers no more from than from ; along , this implies completion from and componentwise.
If , cylinders initially below are skipped in both fills, whereas all others retain pressure at least . Completion from removes more total supply cylinder pressure than from , yielding .
If , the right-hand side is zero. The componentwise inequality established above implies , proving the claimed inequality.
If , filling from also completes the demand cylinder, with componentwise. By monotonicity and the first case with starting pressures and , we have .
▶ Theorem 8. Suppose all supply cylinders have equal capacity and an order completes demand cylinder from state . Then cascade filling from also completes , and its residual state satisfies .
Proof. In a successful fill, let be the pressures of an adjacent inverted pair, the demand cylinder pressure before the pair, and . Let be the demand cylinder pressures after the pair and its sorted residual supply cylinder pressure vectors, for ascending and descending order, respectively. Exchange the pair as in Figure 2.
Figure 2 Supply cylinder exchange; the common suffix compensates pair losses via Lemma 7.
First, if or , the exchange changes neither fill; assume and . Let and be the first-connection equilibrium pressures. Without target stopping, the demand cylinder pressures after the pair satisfy
Stopping at replaces each pressure by its minimum with ; hence . By Lemma 7, the ascending order also completes demand cylinder .
Next, both orders complete demand cylinder , leaving equal supply cylinder pressure sums by conservation. The unchanged prefix contributes nothing to the final difference. Let be this difference, measured as ascending minus descending, and define . Applying Lemma 7 to the common suffix from demand cylinder pressures yields . By (2), it suffices to prove that this difference is nonnegative for every .
To bound , we compare the smaller residual supply cylinder pressures. Let , , and , the required total supply cylinder pressure decrease from . In the ascending order, the lower-pressure cylinder ends at if it completes the demand cylinder, and at otherwise. It has the smaller residual in either case; hence . In the descending order, the higher-pressure cylinder ends at pressure at least . The lower-pressure cylinder remains at if unused, and ends at pressure at least if used. Because and , we obtain . Each cylinder's pressure decrease is at most , and both initial pressures are at least . Thus , and combining these bounds yields .
Finally, we use this comparison to prove for every . In either order, the larger residual supply cylinder pressure is at least the demand cylinder pressure, with equality if filling remains unfinished.
■ For , let , with , be the pair residual state in either order. Let be the corresponding demand cylinder pressure after the pair. Because , we have and . The smaller residual may lie below , and its term remains . Substituting into the definition of and using , we obtain
Conservation implies , which is identical in both orders. The common terms therefore cancel. Substituting in ascending order and in descending order yields , because .
■ For , if , the larger descending supply cylinder residual equals . Both residual supply cylinder pressures and the demand cylinder pressure are therefore below , implying . Hence . Otherwise, , and both orders raise the demand cylinder pressure from to . The two supply cylinders therefore undergo the same total pressure decrease , and both pair residual sums equal . Together with , this proves . Because the demand cylinder terms are identical, (2) implies .
We have proved for every . The equal final pressure sums therefore imply majorization by (2). Repeated adjacent exchanges remove all inversions while preserving completion. Transitivity of majorization proves the theorem.
4.3 Preservation of Majorization under Cascade Filling
▶ Theorem 9. For equal-capacity supply cylinders, let and be sorted supply cylinder pressure states satisfying . If cascade filling completes demand cylinder j from Q, then it also completes j from P, and .
Proof. For a sorted supply cylinder state , let be the initial pressure sum of the first cylinders and their residual pressure sum after the cascade scan, with unused cylinders unchanged. These residual sums are defined whether the scan reaches the target or fails after scanning all supply cylinders. Let be the total decrease in supply cylinder pressures required to complete demand cylinder .
Before cylinder , conservation implies that the demand cylinder pressure is . Table 3 lists the three cases, using and . Thus, with ,
Because , induction shows that is non-decreasing in each initial prefix sum . Hence implies for every .
Let . Because the scan never raises the demand cylinder pressure above its target, it removes at most from the total supply cylinder pressure. Completion
Complexity and Exact Algorithms for Hydrogen Charging
Table 3 Residual prefix sums in a cascade scan.
| Case | Pressure behavior | Residual prefix sum |
|---|---|---|
| Cylinder skipped before completion | Sorted order implies all earlier cylinders are also skipped. | |
| Equilibration below target | Both pressures reach . | |
| Target reached in first cylinders | Total pressure decrease is . |
from and the prefix inequality therefore imply . Thus the scan from removes exactly and completes demand cylinder by conservation. Sortedness, equal totals, and the prefix inequalities imply .
▶ Theorem 10. For equal-capacity supply cylinders, if a fixed demand cylinder order admits a feasible schedule, then filling each demand cylinder by cascade is also feasible. After each demand cylinder, the cascade residual state majorizes the residual state of the original schedule.
Proof. Relabel the demand cylinders as in the fixed order and fix a feasible schedule. Let and be the sorted residual supply cylinder pressure vectors after the first fills in the original and cascade schedules, respectively. Initially, . Suppose the cascade schedule has completed the first demand cylinders and . By Theorem 8, cascading demand cylinder from succeeds and leaves a state majorizing . Theorem 9 implies success from and a residual state majorizing that from . Thus . Induction proves feasibility of the cascade schedule and the claimed majorization after every demand cylinder.
5 Exact Algorithms and the Lower Bound for Three Supply Cylinders
Throughout this section, supply cylinders have equal capacity. Remove demand cylinders already at their targets and let be the remaining set, with .
5.1 General Frontier Dynamic Programming
We use subset dynamic programming for sequencing, following Held and Karp [11]. Initially and after each fill, let contain the completed demand cylinders and let be the residual supply cylinder state sorted by non-decreasing pressure. Demand cylinders in are at their targets and all others at their initial pressures; hence determines all demand cylinder pressures. Define the normalized requirement . By conservation, completing demand cylinder reduces the supply cylinder pressure sum by ; hence every reachable state satisfies
By (3), all residual states for the same have equal sums. By Theorem 10, we restrict to cascades. Let be the sorted initial supply cylinder state and the residual states from successful cascade orders of exactly the demand cylinders in . For the same , Theorem 9 ensures that a majorizing state preserves every feasible remaining cascade demand cylinder order. As in dominance-based labeling for resource-constrained shortest paths [9, 10], we discard majorized states and retain the majorization-maximal states as the frontier, which may contain several mutually incomparable states. For a set of states, let denote its majorization-maximal states. Set and .
▶ Theorem 11. For THCP with equal-capacity supply cylinders, compute the frontier for each nonempty as follows. For each last demand cylinder , cascade from every state in , discard failures, and retain the majorization-maximal candidates:
Evaluating the recurrence (4) in order of increasing cardinality of A yields the exact frontiers. Moreover, if and only if the THCP instance is feasible. Predecessors of retained states reconstruct a feasible demand cylinder order.
Proof. Permutations of induce all states in , making it finite. Candidates arise from demand cylinder orders; hence . Choose an order reaching , with last demand cylinder and preceding state . Let majorize ; such a state exists by finiteness. Theorem 9 then implies and . Every majorization-maximal state in therefore belongs to , and every other candidate is majorized by such a state. Hence . Theorem 10 establishes decision equivalence; predecessors reconstruct a feasible demand cylinder order.
Let be the maximum number of retained states for any completed demand cylinder set.
▶ Theorem 12. For THCP with equal-capacity supply cylinders, generate candidates via (4) and retain the majorization-maximal candidates by all-pairs comparison. This computes all frontiers using rational arithmetic operations and comparisons and stores rational values and indices. For binary rational inputs, the bit complexity is time and space.
Proof. Each has at most candidates. Cascades preserve sorted order (Lemma 6), making each fill and comparison and all-pairs frontier extraction operations. Summing over all subsets using proves the time bound, including initial sorting. Storing at most frontier states and temporary candidates proves the space bound. Each stored state is reached by a legal schedule of at most transfers. Its pressures therefore have polynomial bit length by Lemma 1. Prefix sums and cross-products in feasibility tests and frontier comparisons retain polynomial bit length. Predecessor indices require bits because .
5.2 Dynamic Programming for Two Supply Cylinders
For a completed set , conservation fixes the residual total at . For , define . For in this interval, exactly when ; hence each nonempty frontier has one state minimizing the lower pressure, and . Let be this minimum, or if the frontier is empty.
For , let be the lower component of , or on failure; two supply updates suffice. Initialize and evaluate, in increasing set size,
Complexity and Exact Algorithms for Hydrogen Charging
Discard values and set .
▶ Theorem 13. For THCP with exactly two equal-capacity supply cylinders and arbitrary positive rational demand cylinder capacities, feasibility can be decided using rational operations and comparisons. The algorithm stores rational values and indices. Its bit complexity is poly(L) in both time and space. A feasible schedule can be reconstructed within the same bounds.
Proof. Theorem 11 and the total order above prove the recurrence and feasibility criterion . Precompute for any , starting from , in operations. Each candidate takes operations; hence yields the time bound. Store , , and an attaining last demand per subset. Following these predecessors and replaying the resulting cascade order reconstructs a schedule in operations. The bit bounds follow from Theorem 12.
Corollary 5 shows that the running-time exponent in Theorem 13 is optimal up to a constant factor under ETH, even when all capacities are one.
5.3 An ETH Lower Bound with Three Supply Cylinders
By Theorem 10, enumerating all demand cylinder orders and applying cascade filling decides THCP in time. We prove that ETH rules out a poly(L)-time algorithm even with three supply cylinders, by reducing sparse 3SAT to THCP via the following arithmetic problem.
EXACT PERMUTATION SUM (EPS). The input consists of row weights and label values , all positive integers, and an integer target . The question is whether some satisfies . A permutation assigns one label to each row, using each label exactly once. Assigning label to row contributes to the sum.
First, Lemma 14 compresses a sparse 3SAT formula with variables into at most EPS instances, each with rows. The formula is satisfiable if and only if at least one of these instances is a yes-instance. Then, Lemma 17 transforms each EPS instance into a THCP instance with three supply cylinders and demand cylinders. Because , a poly-time algorithm for THCP would solve sparse 3SAT in time, contradicting ETH.
▶ Lemma 14. For each fixed , a deterministic algorithm maps a 3CNF formula with variables and at most clauses to at most EPS instances in poly(|F|) time. Each instance has rows, uniformly in , and each of its integers has bits. The formula is satisfiable if and only if some instance is a yes-instance. Every solution permutation decodes to a satisfying assignment in polynomial time.
Proof. For sufficiently large , partition variables into blocks of at most variables and clauses into blocks of at most clauses. A variable pattern lists its block's variable values, and a clause pattern lists literal values satisfying every clause in its block. There are blocks. A choice of one pattern per block is consistent when each variable bit equals its corresponding literal bit, complemented for a negative occurrence. Appendix A.1 proves that a consistent choice exists if and only if is satisfiable. Group literal occurrences by , where is the variable's position in its variable block, is the literal's position in its clause block, and the sign records polarity; this fixes the bit positions read from each pattern. In a group of occurrences, weights encode the two compared bit sequences as binary integers. The integers differ by at most and are equal exactly when all comparisons agree.
First, combine the tests into one product-sum congruence. For example, let consist of two occurrences of one variable in distinct clause blocks A, B. Let be the variable bit and the corresponding bits in A, B. Weights 1, 2 yield
The block coefficients 3, -1, -2 multiply the selected bits.
For general groups, choose pairwise coprime prime powers ; define , . The example contributes to the variable block and clause blocks . Add each occurrence's binary weight times to its variable block and subtract it from its clause block, summing over all groups and all variables or literals in each block. Reduce totals to least nonnegative residues modulo , then add for block to obtain positive, distinct without changing residues. Independently of placement, sum once per nonempty group reading a 1 from pattern , complementing negative clause bits; its least nonnegative residue modulo is . Let be the matching-type pattern selected by block , and let . Modulo , each factor retains only its -term, yielding times the group's binary difference. The example yields . Because is invertible modulo and the difference has magnitude below , the residue vanishes exactly when that group's comparisons agree. Pairwise coprimality yields exactly when is consistent. Appendix A.2 proves this equivalence and .
Next, fix the EPS target before choosing a permutation, although consistent main sums vary. From the input, fix a common -multiple above all main sums and fix auxiliary row weights as times powers of . Consistency makes an integer; its base- digits specify auxiliary labels filling the gap. Conversely, auxiliary products vanish modulo ; every matching-type exact solution therefore has a consistent main choice. Enumerate copy counts of main patterns and auxiliary digits, leaving placement to the permutation. Appendix A.3 constructs auxiliary rows and proves both directions. With permitted symbols and label copies, there are at most inventories, each fixing the label multiset before its permutation is chosen.
Finally, require matching row and label types. Let row and label tags be 1, 2, 3 for variable, clause, and auxiliary types, respectively. Let , and replace raw values by and . Define the final target from the inventory, independently of the permutation, with remainder modulo . Each product satisfies . Row and label type counts agree. Thus for every permutation , with the maximum attained exactly when all paired types match. The final equation forces matching types and is equivalent to on those placements. Appendix A.4 proves these claims and verifies the EPS input conditions and polynomial-time decoding. Together with Appendix A.3, this yields and bits per integer. A satisfying assignment determines an output EPS solution; every output solution decodes to a satisfying assignment of .
We reduce EPS to THCP using three unit-capacity supplies and demands. Let , , , denote label, slot, clock, and probe demand cylinders, respectively. The nonprobe demands are called source demands. A word lists demand cylinders in their cascade filling order. For , define the canonical word . The consecutive triple forms block of . Block assigns label to row .
Let be a small encoding parameter. The baseline sets while retaining all capacities; its labels then have identical parameters, with initial pressure 1 and target
Complexity and Exact Algorithms for Hydrogen Charging
pressure 3, and their order does not affect the supply trajectory. Appendix B.1 specifies the capacities, pressure targets, and encoding parameters. Table 4 summarizes the demands in normalized pressures.
Table 4 Demand counts, initial pressures, and roles in canonical words.
| Demand | Count | Initial pressure | Role |
|---|---|---|---|
| Label | Encodes ; label order selects . | ||
| Slot | Represents row . | ||
| Clock | Separates blocks; tests . | ||
| Probe | Last demand; tests . |
▶ Lemma 15 (Canonical words succeed exactly for EPS solutions). For every , the canonical word succeeds exactly when .
Proof. For canonical words, label order encodes the EPS sum, and the final clock and probe impose opposite inequalities. Appendix B.3 proves that every canonical word proceeds until equilibrates with supply 2, whether or not the EPS equality holds. Fix and, immediately after this equilibration, let be the actual pressures of supplies 1 and 2, and the pressure of supply 1 in the baseline. The subsequent contact between and supply 3 changes neither nor . Let be the small scale chosen for the fixed EPS input. Label starts below its baseline pressure, inducing a pressure change in supply 1. Each block scales this change; the capacities make the combined multiplier from block onward proportional to . Let . For a common coefficient independent of , summing the label contributions yields
Because is independent of the order, only the EPS sum varies with . Appendix B.1 defines the reference state from the EPS input, without assuming reachability. If the EPS equality holds, is the supply state before the probe, and the final clock equilibrates with supply 3 at its target. Replacing the EPS sum in the pressure formula by yields . Subtracting this reference pressure yields
Thus the EPS equality holds exactly when . By the construction in Appendix B.1, the checkpoint state satisfies
The second relation follows by substituting .
The final clock has target pressure . Appendix B.1 calibrates to match the actual total gas of the supplies and unfinished clock, with supply 3 and the clock both at in the reference. Because supplies 1 and 2 have unit capacity, their gas deviation from the reference is . The gas in supply 3 and the unfinished clock therefore differs by from the amount needed to bring both to . Thus completes exactly when .
On completion, transfer stops at , leaving the excess gas in unit-capacity supply 3. The resulting supply state is .
If completes, we execute the probe . Its first two contacts equilibrate below target by Appendix B.2, leaving completion to the third contact. For the capacity-9 probe, the resulting equilibrium arrival pressure minus its target is . Thus completes exactly when . Together with the clock condition , this makes successful exactly when , equivalently when .
▶ Lemma 16 (Successful words are canonical). Every successful full word consists of the blocks in index order, followed by , for some ; only the label order can vary.
Proof. Fix a successful full word; Appendix C.1 shows that is last and the clocks occur in index order. Let be the supply state immediately before , and use the reference state from Lemma 15. Let , and let be the algebraic baseline endpoint potential for the same source order, defined even if baseline filling fails; its canonical value is .
Success requires , whereas a noncanonical source order will yield at the chosen scale. Because is calibrated to the total supply gas after completing these same source demands, unit supply capacities yield . Completion of leaves supply 3 at pressure at least . Later labels and slots leave it unchanged; hence . The probe's first two contacts equilibrate below target. These conditions imply by Appendix B.2.
We first show that deleting all labels leaves . Each slot and clock has a positive construction weight . In the canonical order, both and precede for each , contributing total weight . Let be the actual preceding slot-clock weight minus this canonical value. This mismatch affects the supply-1 pressure when the slot is processed. After summing over slots, the corrections caused by switching to supply 2 and the remaining terms combine through . For the construction scale , Appendix C.2 proves
Because all weights are positive, the coefficient of vanishes exactly when every slot has its canonical preceding weight. The canonical preceding totals increase strictly with the slot index, forcing slots into index order. Before , the preceding slots then contribute , leaving the same required weight for clocks. Because clocks are ordered and their weights are positive, exactly precede . Thus the coefficient vanishes exactly for and is positive otherwise. For this slot-clock order, we next show that one label must immediately precede each pair . Let count labels before and those between and . Label-placement errors appear at the next order:
Because all weights are positive, the nonnegative coefficient vanishes exactly when and for every . These conditions place one label immediately before each pair, with none inside or after; every other placement has a positive coefficient.
Finally, we verify that label encoding preserves the positive leading term for every noncanonical source order with clocks in index order. With , label pressure shifts and capacities are both , producing supply-state errors that subsequent updates do
Complexity and Exact Algorithms for Hydrogen Charging
not amplify. Appendix C.2 bounds the endpoint error uniformly over source orders for the fixed EPS input, leaving the positive or leading term unchanged. Appendix C.3 selects one polynomial-bit rational preserving these positive signs. A noncanonical successful word would therefore satisfy , contradicting the terminal bound.
▶ Lemma 17. Every EPS instance reduces in polynomial time to an equivalent THCP instance with three unit-capacity supply cylinders, demand cylinders, positive integer pressures, and positive rational demand cylinder capacities. Its bit length is polynomial.
Proof. An EPS solution yields a successful canonical word by Lemma 15. Conversely, Theorem 10 converts any feasible schedule into a successful cascade word. Lemma 16 makes that word canonical, and Lemma 15 recovers the EPS equality. Appendix C.4 verifies polynomial construction time and all output conditions, including bit length.
▶ Theorem 18. Assume ETH. Then THCP with exactly three unit-capacity supply cylinders admits no deterministic poly(L)-time algorithm, even when all initial and target pressures are positive integers and demand cylinder capacities are arbitrary positive rationals.
Proof. Under ETH, there is a constant for which 3SAT on variables cannot be decided in poly(|F|) time. Let . Deterministic sparsification [12, Corollary 1] maps the input to at most formulas of sparsity . Lemma 14 produces an OR of EPS instances per sparse formula, each with input bits, in poly(|F|) time. Apply Lemma 17 to every resulting EPS instance. Each EPS instance has rows and produces demand cylinders with input length .
Thus and , and the resulting OR is equivalent to the input formula. A poly(L) algorithm would decide 3SAT in poly(|F|) time, including generation. All reduction constants are fixed by the choice of . For sufficiently large , , contradicting the choice of .
6 Conclusion
Our results establish the usefulness and limits of majorization for pressure-driven charging. For equal-capacity supply cylinders, conservation fixes each completed set's residual pressure total, ruling out componentwise dominance between distinct states. Theorems 9–11 justify restricting to cascades and discarding majorized states in subset dynamic programming. With two supply cylinders, majorization totally orders each completed set's states, and Theorem 13 establishes a poly(L)-time algorithm using one representative per set.
Despite preserved majorization, Theorem 18 rules out deterministic poly(L)-time algorithms for three supply cylinders under ETH. With demand cylinder order enumeration and Corollary 5, these bounds establish optimal deterministic exponents and for two and three equal-capacity supply cylinders under ETH, allowing arbitrary positive rational demand cylinder capacities. Thus, constant-dimensional residual pressure states and preserved majorization do not ensure deterministic single-exponential exact algorithms under ETH. In particular, Theorems 12 and 18 imply that the frontier width W cannot be bounded by in the worst case for three equal-capacity supply cylinders. An open question is whether unit demand cylinder capacities permit a single-exponential algorithm with three equal-capacity supply cylinders. Resolving this question would clarify the role of varying demand cylinder capacities in the exponent gap.
AI use. OpenAI Codex assisted manuscript editing and proof development, including reductions. The authors verified all arguments and retain full responsibility.
References
1 Yunfeng Bai, Caizhi Zhang, Hao Duan, Shangfeng Jiang, Zhiming Zhou, Didier Grouset, Mingjun Zhang, and Xuefeng Ye. Modeling and optimal control of fast filling process of hydrogen to fuel cell vehicle. Journal of Energy Storage, 35:102306, 2021. doi:10.1016/j.est.2021.102306.
2 Tjard Bätge, Steffen Heinke, Christian Weckenborg, Marco Karig, Wilhelm Tegethoff, Jürgen Köhler, and Thomas S. Spengler. Configuration planning for gaseous hydrogen refueling stations: a techno-economic assessment. Journal of Business Economics, 96(2–3):409–456, 2026. doi:10.1007/s11573-025-01246-7.
3 Matthias Bentert, Robert Bredereck, Péter Györgyi, Andrzej Kaczmarczyk, and Rolf Niedermeier. A multivariate complexity analysis of the material consumption scheduling problem. Journal of Scheduling, 26(4):369–382, 2023. doi:10.1007/s10951-022-00771-5.
4 Kristóf Bérczi, Tamás Király, and Simon Omlor. Scheduling with non-renewable resources: minimizing the sum of completion times. Journal of Scheduling, 27(2):151–164, 2024. doi:10.1007/s10951-024-00807-y.
5 Tim Brown and Hilary Kisting. Analysis of customer queuing at hydrogen stations. International Journal of Hydrogen Energy, 47(39):17107–17120, 2022. doi:10.1016/j.ijhydene.2022.03.211.
6 Roberta Caponi, Andrea Monforti Ferrario, Enrico Bocci, Sandra Bødker, and Luca del Zotto. Single-tank storage versus multi-tank cascade system in hydrogen refueling stations for fuel cell buses. International Journal of Hydrogen Energy, 47(64):27633–27645, 2022. doi:10.1016/j.ijhydene.2022.06.100.
7 J. Carlier and A. H. G. Rinnooy Kan. Scheduling subject to nonrenewable-resource constraints. Operations Research Letters, 1(2):52–55, 1982. doi:10.1016/0167-6377(82)90045-1.
8 Cheng-Shang Chang and David D. Yao. Rearrangement, majorization and stochastic scheduling. Mathematics of Operations Research, 18(3):658–684, 1993. doi:10.1287/moor.18.3.658.
9 Luigi Di Puglia Pugliese and Francesca Guerriero. A survey of resource constrained shortest path problems: Exact solution approaches. Networks, 62(3):183–200, 2013. doi:10.1002/net.21511.
10 Dominique Feillet, Pierre Dejax, Michel Gendreau, and Cyrille Gueguen. An exact algorithm for the elementary shortest path problem with resource constraints: Application to some vehicle routing problems. Networks, 44(3):216–229, 2004. doi:10.1002/net.20033.
11 Michael Held and Richard M. Karp. A dynamic programming approach to sequencing problems. Journal of the Society for Industrial and Applied Mathematics, 10(1):196–210, 1962. doi:10.1137/0110015.
12 Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? Journal of Computer and System Sciences, 63(4):512–530, 2001. doi:10.1006/jcss.2001.1774.
13 J. R. Jackson. Scheduling a production line to minimize maximum tardiness. Technical Report 43, Management Science Research Project, University of California, Los Angeles, 1955. URL: https://ntrl.ntis.gov/NTRL/dashboard/searchResults/titleDetail/AD152722.xhtml.
14 Richard M. Karp. Reducibility among combinatorial problems. In Complexity of Computer Computations, pages 85–103. Plenum Press, 1972. doi:10.1007/978-1-4684-2001-2_9.
15 Dušan Knop, Michał Pilipczuk, and Marcin Wrochna. Tight complexity lower bounds for integer linear programming with few constraints. In Rolf Niedermeier and Christophe Paul, editors, 36th International Symposium on Theoretical Aspects of Computer Science (STACS 2019), volume 126 of Leibniz International Proceedings in Informatics (LIPIcs), pages 44:1–44:15, Dagstuhl, Germany, 2019. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.STACS.2019.44.
16 Jimmy Li, Edward Youn, Ashwin Ramteke, Jordan McRobie, Erik Hansen, Cullen Hall, Kenneth Kratschmar, Alvin Prakash, Kirt Conrad, and Anthony Ku. Liquid pump-enabled
Complexity and Exact Algorithms for Hydrogen Charging
hydrogen refueling system for heavy duty fuel cell vehicles: Fuel cell bus refueling demonstration at Stark Area Regional Transit Authority (SARTA). International Journal of Hydrogen Energy, 46(78):38575–38587, 2021. doi:10.1016/j.ijhydene.2021.09.112.
17 Albert W. Marshall, Ingram Olkin, and Barry C. Arnold. Inequalities: Theory of Majorization and Its Applications. Springer Series in Statistics. Springer, New York, NY, second edition, 2011. doi:10.1007/978-0-387-68276-1.
18 Jongyeon Oh, Sangwoo Yoo, Chungkeun Chae, and Dongil Shin. Dynamic simulation and optimization of hydrogen fueling operated by n-bank cascade fueling method. International Journal of Hydrogen Energy, 49:276–286, 2024. doi:10.1016/j.ijhydene.2023.08.073.
19 J. Barkley Rosser and Lowell Schoenfeld. Approximate formulas for some functions of prime numbers. Illinois Journal of Mathematics, 6(1):64–94, 1962. doi:10.1215/ijm/1255631807.
20 Dominik Wojtczak. On strong NP-completeness of rational problems. In Fedor V. Fomin and Vladimir V. Podolskii, editors, Computer Science – Theory and Applications, volume 10846 of Lecture Notes in Computer Science, pages 308–320, Cham, 2018. Springer. doi:10.1007/978-3-319-90530-3_26.
A From Sparse 3SAT to Exact Permutation Sum
A.1 Consistency and Satisfiability
We prove that the local patterns in the main proof admit a consistent choice if and only if is satisfiable. Output no instances if has an empty clause; otherwise, pad short clauses to length three by repeating literals. Handle finitely many small input sizes by direct decision and fixed YES or NO instances. For all remaining inputs, use the block sizes and partition in the main proof. Let be the clause count, the variable block count, and the clause block count. Define and index the main rows by ; here , , and . All unspecified logarithms have base two.
Define the variable and clause pattern sets by and , respectively. Patterns retain their variable or clause type even when their bit strings coincide. Let select a pattern from on each variable row and from on each clause row. Unused positions impose no consistency constraints; when extending an assignment to full patterns, fill unused variable positions with 0 and unused clause triples with 111.
If is consistent in the sense of the main proof, its variable patterns define a global assignment, and its clause patterns record the actual literal values. Because every clause triple in C contains a 1, this assignment satisfies F. Conversely, every satisfying assignment determines variable patterns in V and clause patterns in C; completing unused positions as above yields a consistent choice .
A.2 Consistency Test and Size Bounds
We first prove that the construction in the main proof tests consistency exactly. For each group of occurrences, fix an ordering specifying their binary weights. For a matching-type choice , let . Let be its variable and literal bits at occurrence , complementing for a negative literal. Fix a group . Modulo , all other cofactors and the row shifts vanish. Because fixes the bit position on each side, expanding the main proof's products yields
To justify the second line, the weighted difference is the difference of two binary integers in . Its magnitude is below ; uniqueness of binary representation implies that it is zero exactly when all corresponding bits agree. Because , is invertible modulo ; the first congruence thus has zero remainder exactly when every comparison in agrees. Pairwise coprimality then combines these conditions over all groups. In particular, errors in different groups cannot cancel. If there are no groups, define , , and ; consistency is automatic.
We then prove the size and construction-time bounds. Let count the nonempty groups. For , take the first odd primes and choose as the least power of exceeding . We have and . The bound [19, Corollary to Theorem 3] permits polynomial-time sieving. Because , we have . The main proof's residue choices satisfy and ; hence all main values have bits. These bounds permit polynomial-time prime-power selection and construction of all occurrence weights, row values, and pattern values.
Complexity and Exact Algorithms for Hydrogen Charging
A.3 Exact Lifting and Inventory Enumeration
Let be the main row count.
The ranges in Appendix A.2 imply for every matching-type main choice , without assuming consistency. Let be the least integer such that , found by repeated integer multiplication. Define one auxiliary row per base- digit position as in Table 5, with permitted labels . The common target is the maximum auxiliary sum, attained by selecting at every position. The auxiliary rows, permitted labels, and target are fixed before any main choice.
Table 5 Auxiliary rows for base- completion, with and .
| Digit position | 0 | 1 | ||
|---|---|---|---|---|
| Row value | ||||
| Selected label | ||||
| Row contribution |
Correctness of the lifting. Integrality implies ; hence for every such choice. For a consistent main choice, equivalence (5) implies that is a multiple of . Thus is an integer in . Its base- expansion, padded with leading zeros, selects labels in Table 5 with . Thus the auxiliary rows complete the main sum to the fixed target; only the selected digits depend on the main choice.
We prove that a consistent main choice exists if and only if some enumerated candidate label multiset admits a matching-type exact solution. Each candidate, called an inventory, specifies the number of copies of each permitted symbol, with variable-pattern copies from , clause-pattern copies from , and auxiliary-digit copies from . Each inventory fixes labels before a permutation chooses their positions. The rows and are common to all inventories. Let be the numerical value of label copy : its pattern value from Appendix A.2 for a main label, or its digit value for an auxiliary label. Retain the type and original symbol with each copy index, even when numerical values coincide.
A consistent main choice and its completion determine one of these inventories and a matching-type permutation satisfying
Conversely, reducing a matching-type solution of (6) modulo removes the auxiliary products and target, because each is a multiple of . This leaves , and equivalence (5) establishes consistency of the main patterns.
Size and enumeration bounds. We bound the row count, inventory count, and integer bit length.
(i) Row count. Because and Appendix A.2 proves , we have and .
(ii) Number of inventories. The inequalities , , and imply . Including the auxiliary digits, there are at most typed label symbols. Encode each multiset by one star per copy and one separator between successive permitted symbols. The combined encoding has fixed length at most , permitting at most inventories. Enumerate the three multisets recursively with polynomial delay.
(iii) Bit length and construction time. Minimality of implies ; hence all raw values and have bits. Appendix A.4 preserves the row and bit bounds with polynomial-time construction per inventory, yielding poly(|F|) total time.
A.4 Positive Type Tags and Decoding
For the transformed rows and labels from Lemma 14, define the final target for each inventory by
The label sum counts this inventory's copies; the target therefore depends only on copy counts and is fixed before any permutation is chosen.
The inventory construction makes the row and label tag multisets equal. Thus for any permutation . Because the tags are positive, the tag score lies in , reaching its maximum exactly when every paired tag agrees. If , reduction modulo yields . Within this range, the congruence forces the maximum score itself, hence matching types.
Matching types imply and . Expanding the products and subtracting the chosen target therefore yields
Thus a permutation satisfies the final equation if and only if it preserves types and satisfies the raw equation. Appendix A.3 consequently proves consistency of its main patterns.
We finally verify the EPS input conditions and polynomial-time decoding. All final entries are positive, including labels with zero raw value. Main rows remain distinct because their raw values differ by at least one and . Auxiliary rows are distinct because ; their tag 3 separates them modulo from main rows with tags 1, 2, even if raw values coincide. Sort the transformed rows once to obtain , set , and retain the map to original row indices. Because , the raw bounds imply bits for all final entries and , with polynomial-time construction per inventory. For any EPS solution, undo sorting and read the retained main symbols, even when different symbols have the same numerical value. Appendix A.1 proves that their variable bits form a satisfying assignment; decoding takes polynomial time.
B Construction and Canonical Computation
B.1 Parameters and Demand Cylinder Construction
Fix an EPS input and let . The baseline and encoded instances share capacities and use and , respectively.
All pressures below are normalized, and the three unit-capacity supplies start at in both instances. Let , , and . We determine the demand capacities from the desired block response in (8): label perturbations accumulate in X as the required row-weighted sum, while zero deviation of E from the baseline is preserved.
Complexity and Exact Algorithms for Hydrogen Charging
We then specify slot and nonterminal clock targets through a formal baseline trajectory, and calibrate the final clock and probe at a reference state corresponding to the EPS equality. Physical feasibility is not assumed in this design. Appendix B.3 proves that baseline canonical words succeed and that encoded canonical words proceed through the final clock's first two contacts, where the designed response applies.
Row multipliers. Let be a formal endpoint, which adds no EPS row or demand. For , define the desired row multipliers by
The product identity follows by cancellation and is affine in with a common denominator. Thus accumulating label perturbations through the remaining blocks produces the required row-weighted sum.
Label capacity and pressures. The label parameters control both the perturbation at the first equilibration and the change in total gas requirement. Let be the common label capacity, chosen to retain coefficient at equilibration with a unit supply:
For label , set the initial and target pressures to and , respectively. The target exceeds the initial pressure by for sufficiently small .
The completed label fill requires
Slot and clock capacity design. We choose the slot and clock coefficients to produce the row multiplier and cancel the label contribution to the E-deviation. Slots start at pressure 1, and clocks start at pressure 0. Let be the slot and clock coefficients to be chosen, with and ; their capacities are and . Along the intended route, the label and slot equilibrate with supply 1 and complete at supply 1 or 2; the clock equilibrates with supplies 1 and 2. This is a calculation along the intended route, without assuming that the constructed instance follows it. Let be the deviations from the baseline immediately before block i, whose label is . Figure 3 shows the local deviation maps along the intended route. The label and slot draw only from supplies 1 and 2, decreasing their total gas amount Z by the demand requirements. Thus (7) adds to the baseline Z-update, while the slot requirement is unchanged.
Figure 3 Each box acts simultaneously on its incoming deviations from the baseline at that stage; the clock map ends after its first two equilibrations.
Let , be the deviations in X, E after the clock's first two equilibrations, with evaluated at the block entrance. Composing the maps yields the required row multiplier and when
The first identity fixes the X-multiplier, and the second makes the incoming deviations contribute to . The second also implies , cancelling the label term in . Using , these identities determine
The resulting block response is
In particular, a zero incoming E-deviation remains zero. Let . To check capacity positivity, expand at the fixed EPS input as :
Because , sufficiently small satisfies . Thus and are positive capacities.
Formal baseline targets. With the capacities fixed, we define a formal baseline trajectory to specify the slot and nonterminal clock targets without assuming physical feasibility. The full arrival at a contact is the demand pressure after equilibration without target stopping. Slot and nonterminal clock targets are their baseline full arrivals at supplies 1 and 3, respectively, and remain unchanged under encoding. Let , representing the intended supply state before block . After the label's first equilibration, supply 1 has pressure . Set the slot target to , its first full arrival, leaving no baseline slot requirement for supply 2. The label removes from supply 2. The intended clock equilibrations then define
These recursions define rational functions independent of . For , set , the intended third full arrival.
EPS reference state and final clock target. We now calibrate the final clock at a reference supply state C corresponding to the EPS equality. Let . Starting with zero deviation, the local response and telescoping row multipliers predict a final X-deviation of
along the intended route. Replacing the weighted sum by defines the target readout
The target X-readout and baseline E-value fix the first two coordinates of . In the reference gas balance, supply 3 and the final clock are both at , with combined
Complexity and Exact Algorithms for Hydrogen Charging
capacity . By (7), all other source requirements equal their baseline values except for the total label saving . Thus define by
These equations uniquely determine . Explicitly,
No reachability assumption is used in this definition. Set . The potential equation fixes to its baseline value. Subtracting the final clock's requirement from the combined gas equation fixes the completed-source supply total to , independently of source order. At , the formal trajectory is . Its rational functions and the reference coordinates are regular at zero. At , ; at , all three coordinates differ from these baseline values by . Slot and clock targets tend to and and exceed their initial pressures for small enough .
Probe parameters. We calibrate the probe target to its full third arrival from . Set and ; the probe has capacity 9 and starts at pressure 1. Define , the probe's full third arrival from . This target tends to ; thus it exceeds the initial pressure for sufficiently small . All demand parameters are now specified in Table 6.
Table 6 Demand parameters before the final pressure translation and scaling.
| Demand cylinder | Capacity | Initial pressure | Target pressure |
|---|---|---|---|
| Label | |||
| Label | |||
| Slot | |||
| Clock | |||
| Probe |
Call labels and slots low demands, and a repetition-free sequence of source demands a source prefix.
B.2 Common Contact Routes and the Terminal Bound
For both instances, fix an EPS input and sufficiently small . The arrival gap is the full-equilibration pressure minus the target; a demand completes at a contact exactly when this gap is nonnegative. Source capacities and total requirements are because label, slot, and clock targets tend to 3, 2, and 6. Withdrawal during any successful source prefix or partial source fill is bounded by this total; hence uniformly. These separated limits establish the source routes in Table 7, with positive flow at every used contact. The probe's first two full arrivals tend to 1.1 and 1.39, below its limiting target 1.851, with positive flow. Completion at supply 3 remains a separate arrival-gap test.
Table 7 Contact routes after a successful source prefix.
| Demand cylinder | Cylinder 1 | Cylinder 2 | Cylinder 3 |
|---|---|---|---|
| Label | Equilibration | Target stopping | Unused |
| Slot | Equilibration or target stopping | Target stopping if unfinished | Unused |
| Clock or probe | Equilibration below target | Equilibration below target | Target stopping on success |
Let and for a completed source state with the same total supply pressure as . Conservation implies . The probe's full third arrival weights the pressure deviations of supplies 1, 2, and 3 by , , and , respectively. After the probe's first two equilibrations below target, subtracting from its full third arrival yields . Thus and probe completion require and , whose intersection appears in Figure 4. Because ,

Figure 4 Necessary terminal conditions for ; the shaded region meets only at .
B.3 Canonical Feasibility and Endpoint Response
Canonical feasibility. We first show that every baseline canonical word succeeds and reaches before the probe, and that every encoded canonical word proceeds through the first two contacts of . Fix an EPS input and let be sufficiently small.
Set and induct on canonical blocks from the initial state. Starting from the formal state before block , the label equilibrates with supply 1 and removes from supply 2. The slot reaches exactly at its first equilibration. The clock's first two equilibrations yield , and its third full arrival is , including because . Thus every baseline block completes at the next formal state, which proves that the formal trajectory is physically realized. The final state is , and the calibrated probe's full third arrival equals . The common routes therefore imply its completion.
Set and let be deviations from the baseline after the first two contacts of , with . The third contact changes neither nor . Suppose the preceding blocks have completed with and , and consider label . The label follows its common route. Its output supply-1 pressure differs from the baseline slot threshold by . Thus the slot equilibrates with supply 1 below target and completes at supply 2. The clock's first two contacts also follow the common route. The local response (8) now applies to these physical contacts and yields
Complexity and Exact Algorithms for Hydrogen Charging
The telescoping multipliers imply the exact prefix response
For , the clock targets retain their baseline values, whereas (7) shows that the completed labels save in total gas. After the first two contacts of , the remaining gas difference belongs to supply 3 and the unfinished clock, whose combined capacity is . Their full third arrival therefore satisfies
Every summand is positive because the row weights increase strictly and the label values are positive. This proves completion of each nonterminal clock and closes the induction through the first two contacts of , without assuming its completion. If completes, the common routes apply to the subsequent probe.
Canonical endpoint response. With and sufficiently small , equation (10) and the definition of yield, after the first two contacts of ,
Here is common to all permutations. The local response preserves zero E-deviation from the baseline, and C has the baseline potential. Hence , implying . The final clock's third contact changes neither of these pressures.
C Order Certificates and Completion of the Construction
A source word lists all 3k source demands. All asymptotic constants below may depend on the fixed EPS input, and the bounds are uniform over words and prefixes.
C.1 Physical Order and the Terminal Bound
Let . Every successful full encoded word satisfies three necessary conditions:
(i) The probe G is the last demand.
(ii) The clocks occur in index order.
(iii) The supply state p immediately before G satisfies .
Appendix C.2 uses this bound to exclude noncanonical source orders with clocks in index order. Fix an EPS input and set , with sufficiently small.
(i) Probe last. The probe G must be last because completing it lowers all supply pressures below every remaining source target. By the common source-prefix estimate and routes in Appendix B.2, a successful probe leaves the first two supplies at pressures tending to 1.1 and 1.39 as . Target stopping leaves the third at a pressure tending to . All three limits are below 1.9. Every remaining source demand has initial pressure tending to at most one and target tending to at least two. For sufficiently small d, these targets exceed all residual supply pressures and all source initial pressures; none can finish afterward.
(ii) Clock order. The clocks must occur in index order. The target of accounts for withdrawals by ; any additional clock consumes pressure needed for . A successful clock withdraws from supply 3: its capacity is , and its target and pressure after the second equilibration tend to 6 and 4. Low demands leave this supply unchanged, and it starts at 6. Let be the pressure of supply 3 when the set of completed clocks is . Then
Baseline calibration fixes . The final-clock target change is ; thus this expansion also holds under encoding. Every successful leaves supply 3 at least . At the first departure from index order, let be the next unused clock. At this departure, a clock with completes before . When eventually completes, let be the set of all clocks completed by that moment. The set contains and at least the additional index . Consequently
Because the additional clocks have positive weights, their negative contribution of order dominates the error for sufficiently small . This violates the requirement that supply 3 have pressure when completes.
(iii) Terminal bound. The bound follows by combining total-pressure conservation with the feasibility of and . Let be the supply state immediately before . The gas-budget identity in Appendix B.1 fixes the total supply pressure exactly to that of . Completion of leaves supply 3 at least , and later low demands leave it unchanged; hence . Let and . Conservation and imply . The probe's first two contacts are the equilibrations established above. Its success therefore implies by the arrival-gap identity in Appendix B.2. Because , the potential difference is a positive linear combination of these two nonpositive quantities:
C.2 Baseline Order Penalties and the Encoding Error
We show that the encoded endpoint potential of every noncanonical source order with clocks in index order exceeds for sufficiently small . We first detect departures from the canonical slot-clock order through a positive term in the baseline endpoint difference. If this coefficient vanishes, we detect departures from the canonical label placement through a positive term. We then bound the encoding error uniformly by , which preserves the positive leading term in either case.
Baseline and encoded comparison maps. We define algebraic comparison maps to track the endpoint potential in both instances. The baseline below is an algebraic comparison program for the same source order; its physical execution need not succeed. Its canonical endpoint potential is even though denotes the desired encoded endpoint. Let , , and . Define and . Here is
Complexity and Exact Algorithms for Hydrogen Charging
the incoming supply-1 pressure whose first slot arrival equals the target, and is the slot's total requirement. With , the baseline reduced maps are
Only the label map on changes under encoding: . Both algebraic programs remain defined for every repetition-free source prefix, even when physical filling fails. Every update branch is the identity at ; hence every algebraic source prefix has , uniformly at the fixed input. Along successful encoded source prefixes, the encoded program agrees with physical filling by Appendix B.2.
■ For , supply 1 alone fills slot .
■ For , the positive-part correction is the portion of its requirement supplied by supply 2 instead.
Equilibration with the label subtracts from , whereas its total requirement adds to relative to baseline. At the fixed EPS input, the label pressure shifts are and ; hence each encoded label changes the supply-state map by . For a complete source word , let and denote the endpoint potentials of these baseline and encoded programs. The following calculation concerns , regardless of baseline physical feasibility. The remainders are uniform over words at the fixed input.
Accounting for the remaining clocks. We account for the remaining clocks first to compare order differences through low-demand contributions alone. To isolate these contributions, we incorporate all future clock maps into the potential, making its value unchanged across each clock contact. Fix a complete source word whose clocks occur in index order. After the first clocks, use the linear potential . At a clock contact, the value before its reduced map equals the value after that map with the clock removed from the suffix. The exact remaining-clock map is
Indeed, composing the maps multiplies their scalar factors and adds their shear coefficients . For , the empty product is one and the empty sum is zero, recovering ; for , the formula includes every clock. All words start with the same value, and the value at the endpoint is . A low-demand jump is this potential's value after its update minus its value before. Endpoint differences equal differences of summed jumps, using each word's pending clocks and slot branches.
Let . For a low demand , let and be the sums of construction weights over preceding slots and clocks , respectively. Expanding the exact suffix formula with and yields coefficients at . For slot and label supply-1 inputs and , set . Their respective changes are and .
Slot and clock order. We derive (11) and show that its coefficient vanishes exactly when the slot-clock projection is . The canonical recursion (9) yields . Every slot or clock lowers X by 2d times its weight, up to , whereas labels change X by . Let . This quantity measures the excess or deficit in the total weight of slots and clocks preceding relative to the canonical value . Thus
The positive-part estimate includes zero by Lipschitz continuity. The slot requirement is position-independent, and its canonical correction is zero. Subtracting its canonical jump therefore leaves . Labels' common leading jumps cancel. In , each unordered slot pair contributes its weight product once. Thus . Hence . Summing the slot and label contributions and applying this identity with yields
The positive-part correction penalizes excess preceding weight; the linear term supplies the matching penalty for a deficit. The totals increase strictly in slot execution order. If every , they equal the strictly increasing values , forcing slot index order. Then and . Ordered clocks and positive weights force exactly .
Label placement. With the projection after deleting labels fixed to , we derive (12) and show that its coefficient vanishes exactly when one label immediately precedes each pair . Let count labels before and those between and . Each label lowers by . At corresponding nonlabel events, the incoming values in the baseline executions of and a canonical word differ by ; a common slot or clock changes this difference only by , because the slot map minus the identity is -Lipschitz and the clock slope is . Comparison with the canonical input yields
Each slot now has the same pending clocks as in the canonical word; hence its jump difference is . For a label, ; hence its jump is
The first three terms cancel in the canonical subtraction. Slot precedes labels, and clock precedes labels. Hence . Subtracting canonical values and adding the slot jumps, with , proves
Its coefficient vanishes exactly when and for every : one label immediately before each pair and none inside or after the pairs. Figure 5 illustrates the two penalties.
Canonical
Slot too early
Extra label before
Figure 5 Two-block examples in the baseline reduced program; each B denotes a label. In the second row, . In the third, and all other label-position deviations vanish.
Complexity and Exact Algorithms for Hydrogen Charging
Encoding error and order exclusion. We show that encoding changes every prefix state by only and hence preserves the positive leading penalty for each noncanonical order. For corresponding encoded and baseline iterates, with , , and ,
Because , this implies . These estimates are uniform over words and prefixes, with constants depending on the fixed EPS input. For sufficiently small , Appendix B.1 has . Each map is nonexpansive in the infinity norm.
■ The label's linear part is .
The slot’s X-slopes are and 1, its Z-update is a translation independent of X, and continuity at the breakpoint extends the bound across branches.
The clock’s linear part has nonnegative coefficients and row sums and .
The initial difference is zero. Each encoded label adds , of norm at most because . Induction proves (13), including when slot branches differ; yields the stated order. For the encoded reduced endpoint, (13) adds only to each certificate. The first coefficient, and the second coefficient on the required slot-clock projection, are therefore unchanged. Every noncanonical source order with clocks in index order therefore has a positive leading coefficient in one of these certificates; hence for sufficiently small .
C.3 Uniform Validation and an Effective Scale Choice
We replace the preceding sufficiently-small-d conditions by one rational scale of polynomial bit length, computable in polynomial time, that preserves all required physical and algebraic comparison signs. Use for baseline parameters and for encoded parameters in both computations.
Sign preservation principle. For an integer polynomial , let be the sum of its absolute coefficients. Suppose with and for an integer . Because the coefficients are integers, . At , the higher-degree terms satisfy
Thus retains the sign of , including when vanishes at zero. Applying this principle separately to every nonzero comparison numerator and denominator preserves quotient signs and ensures nonzero denominators, without requiring positive denominator signs; identically zero comparisons stay zero. It remains to compute a polynomially bounded from the input that controls all words and branches simultaneously, without enumerating them.
Physical and algebraic computations. We express both computations as affine updates and list the comparisons whose signs must be preserved.
For physical filling use homogeneous coordinates , initially . The final coordinate 1 allows the constant terms of affine updates to be represented by matrix multiplication. For each demand of capacity r, initial pressure z, and target q, reset
and scan supplies , stopping when . Skip a contact if ; otherwise compare with and update
The second branch completes the demand; if after supply 3, stop the physical computation with failure. Lemma 6 preserves the initial supply index order between fills.
■ For , both updates yield .
■ For , equilibration agrees with skipping.
Each reset and contact update is affine with rational-function coefficients in ; computing is a comparison row, not another state update. Thus every physical word uses at most updates.
Reuse the baseline and encoded maps of Appendix C.2 for algebraic comparison. Embed as , initially . These algebraic computations use at most updates, branch on , and end with the comparison . They continue through every source word, even after physical failure; agreement with physical filling is used only on successful source prefixes. Their slot branches coincide at .
Dynamic comparisons. Include all physical contact, route, and post-probe exhaustion comparisons used in Appendices B.2 and C.1, and both algebraic terminal comparisons.
Static comparisons. Include comparisons for positive capacities, targets above initial pressures, initial supply order, positive pressures after adding one, , and .
Polynomial-size local data. The triangle inequality and coefficient convolution imply and . Substituting successive recursion coordinates into equation (9) makes calibration affine updates in fixed dimension, with constant-degree primitive rational coefficients of polynomial coefficient bit length. The product of their primitive denominators has polynomial degree and logarithmic norm. After clearing this denominator, the fixed-dimensional matrix product has polynomial degree and logarithmic coefficient norm: its length is , and each entry sums at most products of entries. The explicit coordinate formulas for in Appendix B.1 define one further affine map with primitive rational coefficients. Each target, local update, and comparison uses a bounded number of rational operations on the calibrated coordinates and primitive data. Consequently, all local data admit expanded integer-polynomial quotients of polynomial degree and coefficient bit length, computable in polynomial time.
Uniform bounds over all words. Clear component denominators separately in each local matrix, initial column, and comparison row, obtaining one nonzero integer-polynomial denominator per array. Compute as the maximum degree of these numerator components and denominators, and by rounding up the logarithm of their maximum coefficient norm. The local list is polynomial in size and includes both parameter choices. Every word and branch sequence uses arrays from this same list, and every computation has at most K updates. Thus the same D, B, K bound all resulting comparison degrees and coefficient norms without enumerating words or branch sequences. After any updates, a comparison is : the numerator sums at most products of components, and the denominator multiplies the corresponding array denominators. The norm product inequality therefore proves
Complexity and Exact Algorithms for Hydrogen Charging
Choice of a common scale. We now apply the sign preservation principle to the uniform coefficient bounds. To ensure this simultaneously for all comparison numerators and denominators, choose
Keep in the baseline. The expanded local data make polynomialsly bounded and computable in polynomial time. Both polynomial norms are at most , and implies . The principle preserves the limiting signs of every nonzero numerator and denominator, including denominators vanishing at zero; identically zero comparisons stay zero. In particular, denominators are nonzero at the chosen scale; their signs need not be positive. Induction along each computation preserves every comparison and branch, including stopping or failure in the physical computation and all later algebraic updates. Equalities preserve the coincident updates above.
Validation of the construction. For every noncanonical source word with clocks in index order, Appendix C.2 proves that has a positive leading term. This algebraic endpoint comparison is included above and therefore remains positive at the chosen scale, independently of physical feasibility. For a successful full encoded word, its source prefix has the same algebraic and physical endpoint; a noncanonical prefix therefore contradicts the terminal bound in Appendix C.1. The preceding appendices establish the required route, completion, and static signs as ; the same scale preserves them and the canonical terminal equalities and tests of Lemma 15.
C.4 Output Normalization and Size
At the scale in (14), evaluating a nonzero polynomial uses bits; hence the calibrated parameters are polynomial-bit rationals computable in polynomial time. Add one to every initial and target pressure to make them positive, then multiply them by the product of their denominators; leave capacities unchanged. Common translation preserves pressure differences and transfer amounts, and positive scaling preserves every completion test while scaling transferred amounts. Thus both operations preserve successful words. There are pressures, each of polynomial bit length; the bit length of their denominator product is at most the sum of those lengths. Thus the normalization is computable in polynomial time. The resulting instance satisfies the output conditions of Lemma 17.