Learn R Programming

intpoint (version 1.0)

random_problem: Random squared (n x n) linear programming problems are generated and solved by the interior point method

Description

A random linear programming problem, with the form $Max Z=CX$ subject to $AX\leq b$, $X \geq 0$ is generated, using U(0,1) values for both the matrix $A$ and the vectors $C$ and $b$. Next, the interior point is used to solve the problem. If the number of equations (variables) is least than or equal to 5, the input problem is shown.

Usage

random_problem(n)

Arguments

n
The size of the problem (number of equations and variables)

Value

A
The coefficient matrix A
c
The coefficients of the objective function
b
The right hand side constants
z
Optimum value for the objective function
xf
Solution vector
n
Number of iterations

References

Gill, P.E., Murray, W. and Wright, M.H. (1991) Numerical Linear Algebra and Optimization vol. 1, Addison-Wesley.

Karmarkar, N. (1984) A new polynomial-time algorithm for linear programming. Combinatorica 4, pp. 373-395.

Vanderbei, R.J., Meketon, M.S. and Freedman, B.A. (1986) A modification of Karmarkar's linear programming algorithm. Algorithmica 1, pp. 395-407.

Examples

Run this code
## generating and solving a linear programming problem with uniform (0,1)
## random values
random_problem(10)

Run the code above in your browser using DataLab