Displaying 5 results from an estimated 5 matches for "rglpk_solve_lp".
2010 Jun 09
1
Rglpk
Hi list,
in the Rglpk_solve_LP function (::Rglpk),
on line 26, the function calls a function
as.glp_bounds() that i cannot access.
i'm trying to alter the Rglpk_solve_LP function
to add a line to retrieve column/row dual values.
everytime i change the slightest line of code inside
Rglpk_solve_LP() [to even add a print]
i...
2009 Jun 11
2
Optimization Question
...negative integers
## x_2 is a non-negative real number
obj <- c(3, 1, 3)
mat <- matrix(c(-1, 0, 1, 2, 4, -3, 1, -3, 2), nrow = 3)
dir <- c("<=", "<=", "<=")
rhs <- c(4, 2, 3)
types <- c("I", "C", "I")
max <- TRUE
Rglpk_solve_LP(obj, mat, dir, rhs, types, max)
## Same as before but with bounds replaced by
## -Inf < x_1 <= 4
## 0 <= x_2 <= 100
## 2 <= x_3 < Inf
bounds <- list(lower = list(ind = c(1L, 3L), val = c(-Inf, 2)),
upper = list(ind = c(1L, 2L), val = c(4, 100)))
Rglpk_solve_LP(obj, mat, dir...
2011 Oct 10
1
Linear programming problem, RGPLK - "no feasible solution".
...c(0,1,0,0,1,0,1,-2.057855981,0)
col3 <-c(0,0,1,0,0,1,1,-1.885177032,0)
col4 <-c(-1,-1,-1,1,1,1,0,0,1)
mat <- cbind(col1, col2, col3, col4)
dir <- c(rep("<=", 3), rep(">=", 3), rep("==", 2), ">=")
rhs <- c(rep(0, 7), 1, 0)
sol <- Rglpk_solve_LP(obj, mat, dir, rhs, types = NULL, max = FALSE,
bounds = c(-100,100), verbose = TRUE)
The R output says there is no feasible solution, but e.g. (-2.3756786, 0.3297676, 2.0459110, 2.3756786) is feasible.
The output is
"GLPK Simplex Optimizer, v4.42
9 rows, 4 columns, 19 non-zeros
0:...
2011 Oct 03
1
minimisation problem, two setups (nonlinear with equality constraints/linear programming with mixed constraints)
..., rep(-1,XROWS)), cbind(diag(XROWS), rep(1,XROWS)), cbind(t(X), rep(0,XCOLS)), cbind(t(rep(0,XROWS)), 1)), nrow=2*XROWS+XCOLS+1)
dir <- c(rep("<=", XROWS), rep(">=", XROWS), rep("==", XCOLS), ">=")
rhs <- c(rep(0, 2*XROWS), e_2, 0)
sol <- Rglpk_solve_LP(obj, mat, dir, rhs, types = NULL, max = FALSE,
bounds = c(-5,5), verbose = TRUE)
...........................................................................
The output is
"
GLPK Simplex Optimizer, v4.42
203 rows, 101 columns, 601 non-zeros
0: obj = 0.000000000e+000 infeas = 1.000e+0...
2009 Sep 22
2
Semi continous variable- define bounds using lpsolve
How to define bounds for a semi continous variable in lp_solve.
Min 5x1 +9x2 +7.15x3 +0.1x4
subject to
x1+x2+x3+x4=6.7
x1+x4 <= 6.5
And x3 can be 0 or greater than 3.6
hence x3 is a semi continous variable
how to define bounds as well as semicontinous function because using
set.semicont and set. bound simantaneously doesn't seem to work.Thanks in
advance for the help
--
View this