Operations Research, Machine Learning, Linear Optimization, Optimization, Dynamic Programming.
a1+a2+…+b1+b2+….c1+c2+…d1+d2+… = 11 a1*p(A1) + a2*p(A2) + … + b1*p(B1) + b2*p(B2) + … + c1*p(C1) + … + d1*p(D1) + … ≤ W a1+a2+…ak ≥ 2 b1+b2+…bl ≥ 2 c1+c2+…cm ≥ 1 d1+d2+…dn = 1 This is a linear optimization problem which can be solved using the PULP library in Python. This approach is much faster as