from util import problem
w = [0.2,0.3,0.9]
p = [25,3.4,3.3]
alpha = [1,1,1]
a0 = 2
c = [w[i]*p[i] for i in range(3)]
p = problem(w,c,alpha,a0)
# optimal solution
p.solve_opt(debug=True)
# profit-nested solution
p.solve_profit()
- check.py: an example shows how to generate a problem instance and solve it.
- main.py: an example shows how to generate several problems with random parameters and find the smallest ratio.