0

I want to check if my linear program has just one solution or infinite ones. How can I do that using PuLP?

Progman
  • 16,827
  • 6
  • 33
  • 48

1 Answers1

1

In practice, there are virtually always multiple solutions because of numerical tolerances, that is, allowing small violations of primal and dual feasibility in the solutions.

I suppose you are rather referring to multiple different optimal bases for your LP. This can be checked by testing for degeneracy: Check whether there are basic variables that are on one of their bounds (or tight basic constraints) and check whether there are non-basic variables with 0 reduced costs or dual multipliers.

These checks can only be done if your LP solution is a basic solution in the first place, coming from a simplex-type optimization.

mattmilten
  • 6,242
  • 3
  • 35
  • 65