
Add minimum penalties objective
Source:R/add_min_penalties_objective.R
add_min_penalties_objective.RdSet the objective of a conservation planning problem to minimize the penalties added to the problem. Targets can optionally be specified to ensure that the solution must meet all the targets. Budgets can also optionally be specified to ensure that the solution does not exceed a budgetary threshold. This objective is designed to be used with multi-objective optimization.
Arguments
- x
problem()object.- budget
numericvalue specifying the maximum expenditure permitted for the solution. Ifxhas multiple zones, thenbudgetcan be (i) a singlenumericvalue to specify an overall budget for the entire solution or (ii) anumericvector to specify a budget for each zone (separately) in the solution. Defaults toNULLsuch expenditure is not limited.
Details
The minimum penalty objective is designed to be used with problems that have penalties (see penalties for details). It can be used to generate solutions that focus entirely on minimizing the penalties, whilst (optionally) ensuring that certain constraints are met. This is is useful when performing multi-objective optimization (see examples below).
Mathematical formulation
This objective can be expressed mathematically for a set of planning units (\(I\) indexed by \(i\)) and a set of features (\(J\) indexed by \(j\)) as:
$$\mathit{Minimize} \space 0 \\ \mathit{subject \space to} \\ \sum_{i = 1}^{I} x_i r_{ij} \geq T_j \space \forall \space j \in J \\ \sum_{i = 1}^{I} x_i c_i \leq B$$
Here, \(x_i\) is the decisions variable (e.g.,
specifying whether planning unit \(i\) has been selected (1) or not
(0)), \(c_i\) is the cost of planning unit \(i\),
\(r_{ij}\) is the amount of feature \(j\) in planning unit
\(i\), and \(T_j\) is the target for feature \(j\). Since
the objective is to minimize zero, this function does not actually provide
any criteria to compare competing solutions. As such, when used in
conjunction with a penalty function (see penalties), only the penalty
(e.g., add_boundary_penalties()) will be used to compare competing
solutions during optimization.
See also
See objectives for an overview of all functions for adding objectives. Also see targets for an overview of all functions for adding targets. Additionally, see penalties for an overview of all functions for adding penalties.
Other functions for adding objectives:
add_max_cover_objective(),
add_max_n_targets_met_objective(),
add_max_phylo_div_objective(),
add_max_phylo_end_objective(),
add_max_wtd_sum_objective(),
add_min_largest_shortfall_objective(),
add_min_set_objective(),
add_min_shortfall_objective()
Examples
# set seed for reproducibility
set.seed(500)
# load data
sim_pu_raster <- get_sim_pu_raster()
sim_features <- get_sim_features()
sim_zones_pu_raster <- get_sim_zones_pu_raster()
sim_zones_features <- get_sim_zones_features()
# here we will show how the min penalties objective can be used
# to generate a solution that accounts for spatial fragmentation
# (via boundary penalties) using multi-objective optimization techniques
# create initial problem
# note that this does not consider boundary penalties
p1 <-
problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.3) %>%
add_binary_decisions() %>%
add_default_solver(verbose = FALSE)
# solve problem
s1 <- solve(p1)
# plot solution
plot(s1, main = "initial solution", axes = FALSE)
# create a multi-objective problem that contains the
# initial problem as well as an additional problem that is
# focused entirely on minimizing spatial fragmentation.
# additionally, this multi-objective problem will use the
# hierarchical approach for optimization and we will
# consider three rel_tol values to generate multiple solutions
# that represent different levels of trade-off between total cost
# and spatial fragmentation. note that we use a small penalty value
# in add_boundary_penalties() to avoid scaling issues and this
# has no influence on the trade-offs between cost and spatial fragmentation.
rel_tol <- c(0, 0.05, 0.1, 0.2)
mp <-
multi_problem(
obj1 = p1,
obj2 =
problem(sim_pu_raster, sim_features) %>%
add_min_penalties_objective() %>%
add_boundary_penalties(penalty = 0.1) %>%
add_binary_decisions()
) %>%
add_hier_approach(rel_tol = matrix(rel_tol, ncol = 1)) %>%
add_default_solver(verbose = FALSE)
#> Warning: → `multi_problem(...)` contains a `problem()` object that has a `?solvers`
#> added to it.
#> ℹ To specify solver settings for multi-objective optimization, the solver
#> should be added to the `multi_problem()` object.
# generate multi-objective solutions
s2 <- solve(mp)
#> Generating solutions ■■■■■■■■■ | 1/4 | 25% | ETA: 4s
#> Generating solutions ■■■■■■■■■■■■■■■■ | 2/4 | 50% | ETA: 2s
#> Generating solutions ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ | 4/4 | 100% | ETA: 0s
# plot multi-objective solutions
plot(terra::rast(s2), main = paste("rel_tol =", rel_tol), axes = FALSE)