Lemoine-OR Algorithms
Description

What this method is

Shortest-path formulation is an exact solver-backed ULS strategy. It builds a mathematical formulation and delegates the optimization step to the selected external engine while keeping the common IUlsSolver result contract.

How it works

Core idea

The method builds its portable linear or mixed-integer formulation, automatically selects an available engine in the CPLEX -> Gurobi -> Xpress -> CBC priority order, solves the model, normalizes numerical values and reconstructs a UlsSolution that is checked independently.

Implementation in ULSAlgorithmsContinuous network-flow formulation with path reconstruction
Mathematical formulation

Regeneration shortest-path model

A replenishment arc from t to j+1 represents one setup in period t serving all demand from t through j.

z_{t,j+1} arc-flow variablec_{tj} regeneration-arc cost
\[ c_{tj}=f_t+\sum_{k=t}^{j}d_k\left(p_t+\sum_{r=t}^{k-1}h_r\right) \]
\[ \min \sum_{(t,j+1)\in A}c_{tj}z_{t,j+1} \]

subject to node-flow conservation

\[ \sum_{a\in\delta^+(v)}z_a-\sum_{a\in\delta^-(v)}z_a=b_v, \qquad b_v=\begin{cases} 1 & v=0,\\ -1 & v=T,\\ 0 & \text{otherwise.} \end{cases} \]
\[ 0\le z_a\le1. \]

Applicability condition

\[ p_t+h_t\ge p_{t+1}, \qquad t=1,\ldots,T-1. \]

The network matrix is integral; zero-demand periods may be crossed by explicit zero-cost skip arcs.

Use it

Minimal C# example

using ULSAlgorithms.Abstractions;
using ULSAlgorithms.Models;
using ULSAlgorithms.Exact.Formulations;

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 ShortestPathFormulationSolver();
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

Zangwill (1969), A Backlogging Model and a Multi-Echelon Model of a Dynamic Economic Lot Size Production System, Management Science 15(9), 506-527; Brahimi, Dauzere-Peres, Najid & Nordli (2006), Single Item Lot Sizing Problems, European Journal of Operational Research 168(1), 1-16 · DOI 10.1287/mnsc.15.9.506