LP Solver

medianshape.core.lp_solver.lp_solver(c, cons, b, solver='cplex')[source]

Linear program solver.

Parameters:
  • c (float) – a vector of cost coefficients for the objective function.
  • cons (int) – a constraint matrix A of dimension kmx(2m+k(2m+2n)).
  • b (int) – a vector of coefficients.
  • solver (str) – the type of solver either ‘cplex’ or ‘cvxopt’
Returns:

sol_x, objective_value – the optimal solution and objective value resp.

Return type:

int, float