pyepo.model.copt.knapsack
Knapsack problem
Attributes
Classes
This class is optimization model for 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.optCoptModel
This class is optimization model for knapsack problem
- _model
Pyomo model
- Type:
PyOmo model
- solver
optimization solver in the background
- Type:
str
- 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 pyomo model
- relax()
A method to get linear relaxation model
- class pyepo.model.copt.knapsack.knapsackModelRel(weights, capacity)
Bases:
knapsackModel
This class is relaxed optimization model for knapsack problem.
- _getModel()
A method to build pyomo
- relax()
A forbidden method to relax MIP model
- pyepo.model.copt.knapsack.cost