column_solution | R Documentation |
Extract the values of decision variables from a solution generated using the
CBC (COIN-OR branch and cut)
solver (via cbc_solve
).
column_solution(result)
result |
CBC result ( |
numeric
values of the decision variables
in the solution (same order as columns in the constraint matrix used
to formulate the problem).
cbc_solve
,
solution_status
,
objective_value
.
## Not run:
# Define optimization problem
## max 1 * x + 2 * y
## s.t.
## x + y <= 1
## x, y integer
# Generate solution
A <- matrix(c(1, 1), ncol = 2, nrow = 1)
result <- cbc_solve(
obj = c(1, 2),
mat = A,
is_integer = c(TRUE, TRUE),
row_lb = c(-Inf),
row_ub = c(1),
max = TRUE)
# Extract column solution
column_solution(result)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.