frontier_extremes: Find objective-wise extreme solutions

View source: R/analysis_frontier.R

frontier_extremesR Documentation

Find objective-wise extreme solutions

Description

Identify the observed minimum and maximum values for each objective in a solutionset-class object.

This function returns the solutions that define the observed range of each selected objective. It also labels each extreme as "best" or "worst" according to the registered optimization sense of the objective.

Usage

frontier_extremes(x, objectives = NULL, ties = c("all", "first"))

Arguments

x

A solutionset-class object returned by solve.

objectives

Optional character vector of objective names to inspect. If NULL, all available objective-value columns are used.

ties

Character. How to handle ties. If "all", all tied solutions are returned. If "first", only the first tied solution is returned.

Details

Objective values are obtained from the stored run table. Objective senses are obtained from the objective specifications stored in the original problem.

For objectives with sense = "min", the observed minimum is labelled as "best" and the observed maximum is labelled as "worst". For objectives with sense = "max", the observed maximum is labelled as "best" and the observed minimum is labelled as "worst".

Runs without a stored solution_id or with missing objective values for the selected objectives are ignored automatically. Therefore, infeasible runs are not considered in the computation.

If several solutions have the same extreme value for an objective, the behaviour is controlled by ties.

Value

A data.frame with one or more rows per objective. The returned columns are:

  • solution_id: integer solution id;

  • objective: objective name;

  • sense: optimization sense, either "min" or "max";

  • bound: observed bound, either "min" or "max";

  • role: interpretation of the bound, either "best" or "worst";

  • value: objective value at the observed bound.

See Also

get_objectives, solution_filter

Examples

# Load a complete simulated planning problem.
example_data <- load_sim_multiaction()

problem <- create_problem(
  pu = example_data$planning_units,
  features = example_data$features,
  dist_features = example_data$dist_features,
  cost = "cost"
) |>
  add_actions(
    example_data$actions,
    cost = example_data$action_costs
  ) |>
  add_effects(
    example_data$effect_assumptions
  ) |>
  add_constraint_targets_relative(0.05) |>
  add_objective_min_cost(alias = "cost", include_pu_cost = FALSE) |>
  add_objective_max_effect(alias = "benefit") |>
  set_method_weighted_sum(
    aliases = c("cost", "benefit"),
    runs = set_runs_grid(n = 3),
    normalize_weights = TRUE
  )

if (requireNamespace("rcbc", quietly = TRUE)) {
  problem <- set_solver_cbc(
    problem,
    verbose = FALSE
  )

  solutions <- solve(problem)

  # Observed minimum and maximum for every objective
  frontier_extremes(solutions)

  # Inspect only selected objectives
  frontier_extremes(
    solutions,
    objectives = c("cost", "benefit")
  )

  # Keep only the first solution when several solutions share an extreme
  frontier_extremes(
    solutions,
    ties = "first"
  )
}


multiscape documentation built on Oct. 12, 2026, 5:08 p.m.