Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_min_size_constraints [feature proposal] #29

Open
jeffreyhanson opened this issue Oct 11, 2017 · 3 comments
Open

add_min_size_constraints [feature proposal] #29

jeffreyhanson opened this issue Oct 11, 2017 · 3 comments

Comments

@jeffreyhanson
Copy link
Contributor

jeffreyhanson commented Oct 11, 2017

I propose adding a add_min_size_constraints function that would allow users to specify the minimum size a reserve can be to represent a particular feature. I think these constraints could be very useful when there is information on home range size or the size of population extents, though perhaps this might be only a small fraction of actual conservation planning scenarios.

The function could look something like this:

#' Add minimum size constraints
#'
#' This function adds constraints to ensure that reserves used to represent each feature are above
#' a particular size.
#'
#' @param x \code{\link{ConservationProblem}} object.
#'
#' @param size \code{numeric} minimum reserve size. The argument to \code{size} can be single 
#'      number to ensure that all reserves used to represent each feature are above a given size.
#'      If different minimum sizes are required for each feature than a \code{numeric} vector with 
#'      sizes for each feature can be supplied.
#'
#' @details This function is inspired by T{\'o}th \emph{et al.} (2009).
#'
#' @return \code{\link{ConservationProblem}} with the constraint added to it.
#'
#' @seealso \code{\link{constraints}}.
#'
#' @references
#' T{\'o}th SF, Haight RG, Snyder SA, George S, Miller JR, Gregory MS, Skibbe AM (2009) Reserve 
#' selection with minimum contiguous area restrictions: An application to open space protection 
#' planning in suburban Chicago. \emph{Biological Conservation}, 142: 1617--1627.
#'
#' @export
add_min_size_constraints <- function(x, n) {
   # insert magic here
}

What do people think? Would it be useful in prioritizr?

@magalicombes
Copy link

Hi,
I think this constraint could be very useful. To avoid having very little reserves, I used the add_neighbor_constraint one, but on my example it only worked for 1 or 2 neighbors so the minimum size is limited to 2 or 3 planning units. Solving refused to work with 3 and 4 neighbors, I didn't get why.
Another interesting one would be add_max_distance between conservation zones, if we want to create a connected network of reserves. But I guess that a such option will put many constraints on the PrioritizR output, maybe too much..

Magali

@jeffreyhanson
Copy link
Contributor Author

jeffreyhanson commented Mar 7, 2019

Yeah, I completely agree. Unfortunately, the integer programming formulation for this type of constraint is really complex, and massively increases the size of the optimisation problem. I played around with this a while ago, but I wasn't able construct conservation planning problems with this type of constraint when there were more than 1000 planning units with constraints on 50 planning units per reserve (it worked with 5 planning units per reserve though) because the optimisation problem became so big that it wouldn't fit on my laptop computer (i.e. 8 GB RAM, see https://rpubs.com/jeffreyhanson/subgraphs-gremlin and try playing with the numbers, note this is just trying to generate the constraint data that would be input to an ILP solver, it doesn't actually use an ILP solver). There might be alternative mathematical formulations which might be more efficient, but it's beyond my ability at the moment to research them. So I don't see this constraint being added to prioritizr until a mathematical genius comes up with a more efficient mathematical formulation for adding these constraints. I'm sorry I don't have a more helpful answer.

@magalicombes
Copy link

Yes, and I think that adding too much constraints would create either unfeasible problems or just make all the study area to be a reserve... For now, the spatial planning tools help to find important places to protect regarding the features, and that's the more important. I think that whith too strong constraints, the solution would maybe depend more on the constraint than on the feature conservation relevance.
But it would have been nice though. I will continue with my 2 neighbors constraint and the boundary penalty..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants