61 _generalSolver = fallback
switch
67 _ =>
throw new ArgumentOutOfRangeException(
70 "Unknown general exact fallback.")
75 public string Name =>
"Adaptive exact ULS solver";
96 ArgumentNullException.ThrowIfNull(problem);
98 return problem.HasNoSpeculativeMotiveCosts
117 ArgumentNullException.ThrowIfNull(problem);
119 if (characteristics.Horizon != problem.
Horizon ||
120 characteristics.TotalDemand != problem.
TotalDemand)
122 throw new ArgumentException(
123 "The supplied characteristics do not describe the supplied problem.",
124 nameof(characteristics));
127 return characteristics.HasNoSpeculativeMotiveCosts
135 CancellationToken cancellationToken =
default)
137 ArgumentNullException.ThrowIfNull(problem);
138 cancellationToken.ThrowIfCancellationRequested();
148 string selectedAlgorithmId =
149 GetSelectedAlgorithmId(
161 private string GetSelectedAlgorithmId(
168 return "wagner-whitin-linear";
173 UlsGeneralExactFallback.WagelmansGeneral =>
176 UlsGeneralExactFallback.FedergruenTzurGeneral =>
177 "federgruen-tzur-general",
179 _ =>
throw new InvalidOperationException(
180 $
"Unsupported adaptive exact fallback '{Fallback}'.")
Implements the general forward Federgruen-Tzur dynamic lot-sizing algorithm.
Solves the general uncapacitated economic lot-sizing problem in O(n log n) time using the backward ge...
Solves ULS instances with Wagner-Whitin costs in linear time.
Represents a validated classical uncapacitated lot-sizing problem.
double TotalDemand
Gets the total demand over the complete planning horizon.
int Horizon
Gets the number of planning periods.
Solve result returned by the adaptive exact strategy.
Represents the outcome returned by a ULS solution strategy.
string? Message
Gets an optional diagnostic message.
UlsSolveStatus Status
Gets the mathematical solve status.
UlsSolution? Solution
Gets the feasible solution, when one is available.
string SolverName
Gets the solver that produced the result.
string Name
Gets the stable human-readable name of the solver.
UlsSolverKind Kind
Gets the broad family of the solver.
AdaptiveExactUlsSolver(UlsGeneralExactFallback fallback)
Initializes a selector with an explicit general exact fallback.
UlsSolveResult Solve(UlsProblem problem, CancellationToken cancellationToken=default)
Solves an uncapacitated lot-sizing problem.The solve result.
AdaptiveExactUlsSolver()
Initializes a selector using the Wagelmans general algorithm as fallback.
IUlsSolver SelectSolver(UlsProblem problem, in UlsProblemCharacteristics characteristics)
Selects a solver from already-computed problem characteristics.
IUlsSolver SelectSolver(UlsProblem problem)
Selects the exact solver to use for the supplied problem.
UlsGeneralExactFallback Fallback
Gets the general exact fallback configured for this selector.
Defines the common strategy contract implemented by every ULS solver.
UlsSolveResult Solve(UlsProblem problem, CancellationToken cancellationToken=default)
Solves an uncapacitated lot-sizing problem.
UlsSolverKind
Identifies the broad family of a ULS solution strategy.
UlsGeneralExactFallback
Selects the general exact algorithm used when the linear-time Wagner-Whitin specialization is not app...
@ WagelmansGeneral
Uses the backward geometric Wagelmans-van Hoesel-Kolen algorithm.
@ FedergruenTzurGeneral
Uses the forward Federgruen-Tzur algorithm.
Describes inexpensive structural and cost characteristics used to select an exact ULS solution strate...