crispLP: Solves a crisp linear programming problem.

View source: R/ResFuz.R

crispLPR Documentation

Solves a crisp linear programming problem.

Description

crispLP use the classic solver (simplex) to solve a crisp linear programming problem:

Max\, f(x)\ or\ Min\ f(x)

s.t.:\quad Ax<=b

Usage

crispLP(objective, A, dir, b, maximum = TRUE, verbose = TRUE)

Arguments

objective

A vector (c_1, c_2, \ldots, c_n) with the objective function coefficients f(x)=c_1 x_1+\ldots+c_n x_n.

A

Technological matrix of Real Numbers.

dir

Vector of strings with the direction of the inequalities, of the same length as b. Each element of the vector must be one of "=", ">=", "<=", "<" or ">".

b

Vector with the right hand side of the constraints.

maximum

TRUE to maximize the objective function, FALSE to minimize the objective function.

verbose

TRUE to show aditional screen info, FALSE to hide aditional screen info.

Value

crispLP returns the solution if the solver has found it or NULL if not.

Examples

## maximize:   3*x1 + x2
## s.t.:       1.875*x1   - 1.5*x2 <= 4
##              4.75*x1 + 2.125*x2 <= 14.5
##               x1, x2 are non-negative real numbers

obj <- c(3, 1)
A <- matrix(c(1.875, 4.75, -1.5, 2.125), nrow = 2)
dir <- c("<=", "<=")
b <- c(4, 14.5)
max <- TRUE

crispLP(obj, A, dir, b, maximum = max, verbose = TRUE)


FuzzyLP documentation built on Aug. 21, 2023, 1:06 a.m.

Related to crispLP in FuzzyLP...