Search code examples
c#ms-solver-foundation

Reporting shadow prices from SimplexSolver


I'm using the SimplexSolver class directly to solve a linear program, with AddRow, AddVariable and SetCoefficient. This works quite well.

We need to come up with shadow prices now, and I don't see any way to access either the shadow prices or the simplex matrix.

If I set SimpleSolverParams.GetSensitivityReport to true, casting the return of SimplexSolver.GetReport to ILinearSolverSensitivityReport may be the key here. Checking it out.


Solution

  • It looks like ILinearSolverSensitivityReport.GetDualValue returns the shadow price.

    Hopefully this saves someone else a merry chase through dotPeek. :-)