intlinprog {modopt.matlab}R Documentation

MatLab(R)-style Mixed Integer Linear Programming in R using ROI

Description

intlinprog provides a simple interface to ROI using the optimization model specification of MatLab(R)

minimize in x: f'*x subject to A*x <= b Aeq*x == beq x >= lb x <= ub

Usage

intlinprog(f, intcon = NULL, A = NULL, b = NULL, Aeq = NULL,
  beq = NULL, lb = NULL, ub = NULL, x0 = NULL, options = NULL)

Arguments

f

Linear term (vector) of the objective function

intcon

Vector of which variables are integer

A

Inequality constraints (left-hand side)

b

Inequality constraints (right-hand side)

Aeq

Equality constraints (left-hand side)

beq

Equality constraints (right-hand side)

lb

Lower bound

ub

Upper bound

x0

Initial solution

options

Additional optimization parameters

Value

The solution vector in x as well as the objective value in fval.

Author(s)

Ronald Hochreiter, ron@hochreiter.net

Examples

# minimize 8x1 + x2
# subject to
#   x1 + 2x2 >= -14
#   -4x1 - 1x2 <= -33
#   2x1 + x2 <= 20
#   x1, x2 integer

f <- c(8, 1)
A <- matrix(c(-1, -2, -4, -1, 2, 1), nrow=3, byrow=TRUE)
b <- c(14, -33, 20)

sol <- intlinprog(f, c(1, 2), A, b)
sol <- intlinprog(f, NULL, A, b)

sol$x


[Package modopt.matlab version 1.0-2 Index]