Lemoine-OR Algorithms
Description

What this method is

Adaptive exact selection is the recommended orchestration strategy when client code needs an exact ULS solution without hard-coding a particular exact algorithm. It inspects the no-speculative-motive cost condition and dispatches to the fastest supported specialized or general exact strategy.

How it works

Core idea

The selector checks p[t] + h[t] >= p[t+1] over adjacent periods. If the condition holds, it executes the linear-time Wagner-Whitin specialization. Otherwise it executes the configured general O(T log T) solver, Wagelmans by default or Federgruen-Tzur when explicitly requested. Selection does not change the common IUlsSolver contract.

Implementation in ULSAlgorithmsSelects the linear Wagner-Whitin specialization when applicable; otherwise uses a configurable O(T log T) general exact fallback
Use it

Minimal C# example

using ULSAlgorithms.Abstractions;
using ULSAlgorithms.Models;
using ULSAlgorithms.Selection;

var problem = new UlsProblem(
    demands:             [20.0, 30.0, 25.0, 40.0],
    setupCosts:          [200.0, 200.0, 200.0, 200.0],
    unitProductionCosts: [0.0, 0.0, 0.0, 0.0],
    holdingCosts:        [4.0, 4.0, 4.0, 0.0]);

IUlsSolver solver = new AdaptiveExactUlsSolver();
var result = solver.Solve(problem);

Console.WriteLine(result.Status);
Console.WriteLine(result.ObjectiveValue);

The input example intentionally uses stationary, positive-demand data so it is compatible with restricted methods too. Always check the applicability box for your own instance.

Scientific source

Reference & provenance

Wagelmans, Van Hoesel & Kolen (1992), Economic Lot Sizing: An O(n log n) Algorithm That Runs in Linear Time in the Wagner-Whitin Case, Operations Research 40(S1), S145-S156; Federgruen & Tzur (1991), A Simple Forward Algorithm to Solve General Dynamic Lot Sizing Models with n Periods in O(n log n) or O(n) Time, Management Science 37(8), 909-925 · DOI 10.1287/opre.40.1.S145