Column Generation
- class bnbpy.colgen.PriceSol(red_cost, new_col)[source]
Bases:
objectReturns the solutions of the pricing problem (which includes a new column). Is is NOT recommended to modify these instance after creation due to safe hashing.
- Parameters:
red_cost (float)
new_col (Any)
- red_cost: float
- new_col: Any
- class bnbpy.colgen.MasterSol(cost, duals)[source]
Bases:
objectReturns the solutions of the master problem (which includes dual information). Is is NOT recommended to modify these instance after creation due to safe hashing.
- Parameters:
cost (float)
duals (Any)
- cost: float
- duals: Any
- class bnbpy.colgen.Pricing(price_tol=0.01)[source]
Bases:
ABCAbstraction for pricing problem
- Parameters:
price_tol (float)
- price_tol: float
Tolerance for including new columns into master problem
- abstractmethod set_weights(c)[source]
Modifies problem by incorporating new weights
- Parameters:
c (Any) – New weights (depend on problem structure)
- Return type:
None
- abstractmethod solve()[source]
Solves pricing problem and returns PriceSol instance
- Returns:
Instance with reduced cost and new column
- Return type:
- class bnbpy.colgen.Master[source]
Bases:
ABCAbstraction of master problem Must overwrite methods add_col and solve
- abstractmethod add_col(c)[source]
Includes new column into master problem and returns True if it is valid to continue pricing
- Parameters:
c (Any) – New column
- Returns:
Either or not to proceed
- Return type:
bool
- class bnbpy.colgen.ColumnGenProblem(master, pricing, max_iter_price=None)[source]
Bases:
ProblemAbstraction of optimization problem solved using column generation
- calc_bound()[source]
Returns a lower bound of the (sub)problem. By default, the subproblems’ nodes are initialized with the same lower bounds as the parent problems’ nodes.
- Returns:
Lower bound of the (sub)problem
- Return type:
float