Solution
Solution classes for the three Python-based PS-BHLP models.
Each solution class extracts variable values from the Gurobi model, formats them as tables, and infers prices for models without explicit price variables.
PC_HLPSolution
¶
Bases: PriceMixin, DecisionMixin, HubLocationMixin, LinearWeightMixin, InferredPricingMixin, RecursiveDecisionMixin, BaseModelSolution
Solution for the PC-HLP (Fast Lagrange) model.
Since PC-HLP has no explicit price variable, price is inferred from the budget-to-weight ratio of the marginal client on each route. Recursive decisions are unrolled to the original client indices.
Mixin composition:
PriceMixin— price tableDecisionMixin— active routesHubLocationMixin— hub statusLinearWeightMixin— weightsInferredPricingMixin— computes prices from marginal clientsRecursiveDecisionMixin— unrolls aggregated decisions to original client keys
PPC_HLPSolution
¶
Bases: PriceMixin, DecisionMixin, HubLocationMixin, LinearWeightMixin, InferredPricingMixin, BaseModelSolution
Solution for the PPC-HLP (Lagrange) model.
Like PC-HLP, price is inferred post-solve from the marginal client on each route. No recursive unrolling is needed here — PPC-HLP uses flat (non-aggregated) client indices.
Mixin composition:
PriceMixin— price tableDecisionMixin— active routesHubLocationMixin— hub statusLinearWeightMixin— weightsInferredPricingMixin— computes prices from marginal clients
PS_HLPSolution
¶
Bases: PriceMixin, DecisionMixin, HubLocationMixin, BaseModelSolution
Solution for the PS-HLP (Big M) model.
Unlike the Lagrange-based models, PS-HLP has price as an explicit Gurobi variable, so no inference is needed. The price values are extracted directly from the solver.
Mixin composition:
PriceMixin— price tableDecisionMixin— active routesHubLocationMixin— hub status- [
BaseModelSolution][bilevelpy.solution.core.BaseModelSolution] — base variable extraction