# NOT RUN {
# create basic problem
p1 <- problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.2)
# create problem with added connected constraints
p2 <- p1 %>% add_connected_constraints()
# }
# NOT RUN {
# solve problems
s <- stack(solve(p1), solve(p2))
# plot solutions
plot(s, main = c("basic solution", "connected solution"), axes = FALSE,
box = FALSE)
# }
Run the code above in your browser using DataLab