A program to find the optimal solution and value of a linear programming problem in standard form.
The program supports:
- Primal simplex method:
- PhaseI to find feasible base
- PhaseII to solve
- Dual simplex method
- Branch and bound
Create a .txt file with these values:
- n: Number of constraint;
- m: Number of variables;
- is_max: 1 on maximization, 0 on minimization;
- c: Vector of costs (size
m); - A: Matrix of constraints coefficients (size
n*m); - b: RHS vector;
- variables:
mvalues to describe the variables:- 0 = real;
- 1 = integer;
- 2 = binary;
Example (bb1 model):
-
n = 3
-
m = 5
-
is_max = 1
-
c = 0 -1 0 -1 0
-
A = -1 0.5 0 -0.5 0 0 2.5 -1 -0.5 0 0 1 0 1 -1
-
b = -3.5 4.5 -15
-
variables = 0 1 0 1 0
Notes:
- Newlines between parameters are valid
- c, A and b can be on the same line or not
-
Compile
make
-
Run
make run ARGS="model_filename"(or optionally
make runto read fromstdin).Example:
make run ARGS="bb1"Note: Test models are located in test_models directory, and every new model file MUST be located there.
-
Compile
make debug
-
Run
make drun ARGS="model_filename"(or optionally
make drunto read fromstdin).