Linear Optimization

The linopt library provides algorithms for linear and integer programming. The routines in this library can be used in order to minimize and maximize a linear function subject to the set of linear constraints. It is possible to get only integer solutions. The routines for linear optimization are based on the two phase simplex algorithm. The algorithm of Land-Doig is used to find integer solutions.

The library functions are called using the library name linopt and the name of the function. E.g., use

c := [{3*x + 4*y - 3*z <= 23, 5*x - 4*y - 3*z <= 10, 
       7*x + 4*y + 11*z <= 30}, - x + y + 2*z, {x, y, z}]:

to solve the linear optimization problem defined in the variable c. This mechanism avoids naming conflicts with other library functions. If this is found to be inconvenient, then the routines of the linopt package may be exported via use. E.g., after calling

use(linopt, maximize):

the function linopt::maximize may be called directly:

c := [{3*x + 4*y - 3*z <= 23, 5*x - 4*y - 3*z <= 10, 
       7*x + 4*y + 11*z <= 30}, - x + y + 2*z, {x, y, z}]:

All routines of the linopt package are exported simultaneously by


The functions available in the linopt library can be listed with:

Library 'linopt': a package for linear optimization
-- Interface:
linopt::Transparent, linopt::corners, linopt::maximize, linopt::minimize, linopt::plot_data,
Was this topic helpful?