solution_status: Solution status

View source: R/cbc_solve.R

solution_statusR Documentation

Solution status

Description

Extract the status of a solution generated using the CBC (COIN-OR branch and cut) solver (via cbc_solve).

Usage

solution_status(result)

Arguments

result

CBC result (rcbc_milp_result) object.

Value

A character status description. For example, an "optimal" status indicates that the optimization process finished because it found an optimal solution. Also, if a maximum time limit was specified, an "timelimit" status indicates that the optimization process finished because it ran out of time. Furthermore, an "infeasible" status indicates that there is no possible solution to the specified optimization problem. This "infeasible" status could potentially mean that there was a mistake when constructing the input data.

See Also

cbc_solve, column_solution, objective_value.

Examples

## 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 solution status
solution_status(result)

## End(Not run)

dirkschumacher/rcbc documentation built on Feb. 3, 2023, 6:58 a.m.