LinearProgramming Class |
The LinearProgramming class represents a data type for solving a linear program of the form { max cx : Ax <= b, x >= 0 }, where A is a M-by-N matrix, b is an M-length vector, and c is an N-length vector. For simplicity, we assume that A is of full rank and that b >= 0 so that x = 0 is a basic feasible soution.
The data type supplies methods for determining the optimal primal and dual solutions.
This is a bare-bones implementation of the Simplex algorithm. It uses Bland's rule to determing the entering and leaving variables. It is not suitable for use on large inputs. It is also not robust in the presence of floating-point roundoff error.
Namespace: Algs4Net
public class LinearProgramming
The LinearProgramming type exposes the following members.
Name | Description | |
---|---|---|
![]() | LinearProgramming |
Determines an optimal solution to the linear program
{ max cx : Ax <= b, x >= 0 }, where A is a M-by-N
matrix, b is an M-length vector, and c is an N-length vector. |
Name | Description | |
---|---|---|
![]() | Dual |
Returns the optimal dual solution to this linear program |
![]() ![]() | MainTest |
Demo test the LinearProgramming data type. |
![]() | Primal |
Returns the optimal primal solution to this linear program. |
For additional documentation, see Section 6.5Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.
This class is a C# port from the original Java class LinearProgramming implementation by the respective authors.