pyepo.model.copt.knapsack
Knapsack problem
Attributes
Classes
This class is an optimization model for the knapsack problem |
|
This class is relaxed optimization model for knapsack problem. |
Module Contents
- class pyepo.model.copt.knapsack.knapsackModel(weights, capacity)
Bases:
pyepo.model.copt.coptmodel.optCoptModelThis class is an optimization model for the knapsack problem
- _model
COPT model
- Type:
COPT model
- weights
weights of items
- Type:
np.ndarray
- capacity
total capacity
- Type:
np.ndarray
- items
list of item index
- Type:
list
- weights
- capacity
- items
- _getModel()
A method to build COPT model
- relax()
A method to get linear relaxation model
- class pyepo.model.copt.knapsack.knapsackModelRel(weights, capacity)
Bases:
knapsackModelThis class is relaxed optimization model for knapsack problem.
- _getModel()
A method to build COPT model
- relax()
A forbidden method to relax MIP model
- pyepo.model.copt.knapsack.cost