crispLP: Solves a crisp linear programming problem.

Description Usage Arguments Value Examples

View source: R/ResFuz.R

Description

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

Max f(x) or Min f(x)

s.t.: Ax<=b

Usage

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

Arguments

objective

A vector (c1, c2, …, cn) with the objective function coefficients f(x)=c1*x1+…+cn*xn.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 April 11, 2021, 5:06 p.m.

Related to crispLP in FuzzyLP...