49 "Jacobs-Khumawala simplified branch-and-bound";
56 CancellationToken cancellationToken =
default)
58 ArgumentNullException.ThrowIfNull(problem);
59 cancellationToken.ThrowIfCancellationRequested();
65 ArrayPool<double>.Shared.Rent(
68 var predecessorBuffer =
69 ArrayPool<int>.Shared.Rent(
75 bestLabelBuffer.AsSpan(
80 predecessorBuffer.AsSpan(
85 double.PositiveInfinity);
95 ComputeLotForLotUpperBound(
102 cancellationToken.ThrowIfCancellationRequested();
107 if (!
double.IsFinite(startLabel) ||
108 startLabel > incumbent)
115 if (problem.
Demands[start] == 0.0 &&
117 bestLabel[start + 1])
119 bestLabel[start + 1] =
122 predecessor[start + 1] =
126 for (var end = start;
143 if (!
double.IsFinite(candidate))
145 throw new ArithmeticException(
146 "Numerical overflow in Jacobs-Khumawala branch cost.");
150 if (candidate > incumbent)
162 bestLabel[boundary] ||
164 bestLabel[boundary] &&
166 predecessor[boundary]))
168 bestLabel[boundary] =
171 predecessor[boundary] =
174 if (boundary == horizon &&
175 candidate < incumbent)
184 if (!
double.IsFinite(
187 throw new ArithmeticException(
188 "Jacobs-Khumawala failed to obtain a finite incumbent.");
199 ArrayPool<double>.Shared.Return(
203 ArrayPool<int>.Shared.Return(
209 private static double ComputeLotForLotUpperBound(
214 var productionCosts =
220 period < problem.Horizon;
223 if (demands[period] == 0.0)
231 productionCosts[period];
233 if (!
double.IsFinite(cost))
235 throw new ArithmeticException(
236 "Numerical overflow in Lot-for-Lot upper bound.");
O(1) regeneration-interval cost evaluator for the uncapacitated zero-inventory-ordering structure.
Exact single-level lot-sizing procedure expressed as the simplified branch-and-bound/subproblem schem...
string Name
Gets the stable human-readable name of the solver.
UlsSolveResult Solve(UlsProblem problem, CancellationToken cancellationToken=default)
Solves an uncapacitated lot-sizing problem.
UlsSolverKind Kind
Gets the broad family of the solver.
Reconstructs a zero-inventory-order ULS solution from shortest-path predecessors.
static UlsSolveResult Build(UlsProblem problem, ReadOnlySpan< int > predecessor, string solverName, CancellationToken cancellationToken)
Represents a validated classical uncapacitated lot-sizing problem.
ReadOnlySpan< double > UnitProductionCosts
Gets unit production costs by period.
int Horizon
Gets the number of planning periods.
ReadOnlySpan< double > Demands
Gets demand by period.
ReadOnlySpan< double > SetupCosts
Gets fixed setup costs by period.
Represents the outcome returned by a ULS solution strategy.
Defines the common strategy contract implemented by every ULS solver.
UlsSolverKind
Identifies the broad family of a ULS solution strategy.