LP
Simple C/C++ interface to COIN-OR CBC, CPLEX, GLPK and GUROBI, with some interesting features
Functions
Optimization and parameter settings

Functions

int lp_optimize (LinearProgram *lp)
 Optimizes your Mixed Integer Program. More...
 
int lp_optimize_as_continuous (LinearProgram *lp)
 optimizes only the linear programming relaxation of your MIP More...
 
double lp_obj_value (LinearProgram *lp)
 objective value of your optimization More...
 
double lp_best_bound (LinearProgram *lp)
 returns the best dual bound found during the search More...
 
double * lp_x (LinearProgram *lp)
 returns the vector of solution values More...
 
double * lp_row_slack (LinearProgram *lp)
 
double * lp_row_price (LinearProgram *lp)
 
double * lp_reduced_cost (LinearProgram *lp)
 reduced cost for columns - only available when solving continous models More...
 
int lp_num_saved_sols (LinearProgram *lp)
 number of solutions stored in the solution pool More...
 
double lp_saved_sol_obj (LinearProgram *lp, int isol)
 objective value for the isol-th solution of the solution pool More...
 
double * lp_saved_sol_x (LinearProgram *lp, int isol)
 objective value for the isol-th solution of the solution pool More...
 

Detailed Description

These are the functions that can be used to optimize your model and control some solver configuration.

Function Documentation

◆ lp_best_bound()

double lp_best_bound ( LinearProgram lp)

returns the best dual bound found during the search

If your Mixed Integer Optimization concluded without finding the optimal solution, you can retrieve the best dual bound (lower bound in minimization), which is a valid estimate of the best possible value for the optimal solution.

Parameters
lpthe (integer) linear program
Returns
the dual bound (lower bound if minimization)

◆ lp_num_saved_sols()

int lp_num_saved_sols ( LinearProgram lp)

number of solutions stored in the solution pool

Parameters
lpthe (integer) linear program
Returns
number of solutions in the solution pool

◆ lp_obj_value()

double lp_obj_value ( LinearProgram lp)

objective value of your optimization

Parameters
lpthe (integer) linear program
Returns
objective value found

◆ lp_optimize()

int lp_optimize ( LinearProgram lp)

Optimizes your Mixed Integer Program.

Optimizes your Mixed Integer Program. Returns the problem status, which can be:

0 : LP_OPTIMAL : optimal solution found
1 : LP_INFEASIBLE : the problem is infeasible
2 : LP_UNBOUNDED : the problem is unbounded
3 : LP_FEASIBLE : a feasible solution was found, but its optimality was not proved
4 : LP_INTINFEASIBLE : the lp relaxation is feasible but no integer feasible solution exists
5 : LP_NO_SOL_FOUND : optimization concluded without finding any feasible solution
6 : LP_ERROR : the solver reported an error

Parameters
lpthe (integer) linear program

◆ lp_optimize_as_continuous()

int lp_optimize_as_continuous ( LinearProgram lp)

optimizes only the linear programming relaxation of your MIP

Optimizes your Mixed Integer Program relaxing integrality constraints (if any). Returns the problem status, which can be:

0 : LP_OPTIMAL : optimal solution found
1 : LP_INFEASIBLE : the problem is infeasible
2 : LP_UNBOUNDED : the problem is unbounded
3 : LP_FEASIBLE : a feasible solution was found, but its optimality was not proved
4 : LP_INTINFEASIBLE : the lp relaxation is feasible but no integer feasible solution exists
5 : LP_NO_SOL_FOUND : optimization concluded without finding any feasible solution
6 : LP_ERROR : the solver reported an error

Parameters
lpthe (integer) linear program

◆ lp_reduced_cost()

double* lp_reduced_cost ( LinearProgram lp)

reduced cost for columns - only available when solving continous models

Parameters
lpthe (integer) linear program
Returns
vector with reduced costs

◆ lp_saved_sol_obj()

double lp_saved_sol_obj ( LinearProgram lp,
int  isol 
)

objective value for the isol-th solution of the solution pool

Parameters
lpthe (integer) linear program
isolthe solution index
Returns
objective value of the i-th solution from the solution pool

◆ lp_saved_sol_x()

double* lp_saved_sol_x ( LinearProgram lp,
int  isol 
)

objective value for the isol-th solution of the solution pool

Parameters
lpthe (integer) linear program
isolthe solution index
Returns
solution vector of the i-th solution from the solution pool

◆ lp_x()

double* lp_x ( LinearProgram lp)

returns the vector of solution values

Parameters
lpthe (integer) linear program
Returns
solution vector