Integer Phylogeny Constraints
PortfolioOptimisers.set_iplg_constraints! Function
set_iplg_constraints!(
model::Model,
plgs::Union{AbstractPhylogenyConstraintResult, AbstractVector{<:AbstractPhylogenyConstraintResult}}
)Add integer phylogeny cardinality constraints to the JuMP optimisation model.
Iterates over plgs and, for each IntegerPhylogeny entry, enforces A * ib ≤ B where ib is the held binary (held_bin) of the MIP builder that ran. The bundle is read back from Model State with mip_indicators rather than hand-threaded from set_mip_constraints!: the builder registered it under one canonical entry, and each builder's own raw keys stay private to it.
This runs in the same neighbourhood of assemble_jump_model! as its semidefinite sibling set_sdp_phylogeny_constraints!: both are phylogeny constraints applied to the fully-assembled weights. Unlike the semidefinite one it reads nothing that later builders set (no :variance_flag), so its position there is a grouping, not a dependency.
held_bin is read only inside the IntegerPhylogeny branch, so a bundle that carries no held indicator (a SignIndicators from the lean sign-bit builder) is never asked for one — by set_mip_constraints!'s own guards that builder rules out any integer phylogeny. The ::Nothing method and the early mip_indicators guard make the call total: no phylogeny of any kind, or no MIP builder having run at all.
Arguments
model::JuMP.Model: The JuMP optimisation model.plgs: Collection of phylogeny constraint objects (ornothing).
Returns
nothing.
Related
source