Description Usage Arguments Value Author(s) References Examples
View source: R/random_problem.R
A random linear programming problem, with the form Max Z=CX subject to AX≤q b, X ≥q 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.
1 |
n |
The size of the problem (number of equations and variables) |
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 |
Alejandro Quintela del Rio aquintela@udc.es
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.
1 2 3 | ## generating and solving a linear programming problem with uniform (0,1)
## random values
random_problem(10)
|
$`The optimum value of Z is`
[1] 3.966858
$`The optimal solution X`
[,1]
[1,] 2.602136e-06
[2,] 1.245861e-05
[3,] 7.511170e-07
[4,] 6.967498e-06
[5,] 2.351661e+00
[6,] 1.587935e-06
[7,] 1.918489e+00
[8,] 7.431164e-06
[9,] 1.090491e+00
[10,] 1.914368e-06
$`Number of iterations`
[1] 13
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.