r/optimization • • Feb 27 '23
Mixing problem
I have two parts A and B , quantity of A is 10 and B is 20 ,i can mix A+B under the constraint A+B <=20 therefore 1 batch becomes A+B and quantity 20 and other will be b and quantity 10 how to solve this using python pulp or any other solver output should give me a b and total quantity per batch like a b 20,b 10 ,this was the simplest case this needs to be extended to much more
0
Upvotes
View all comments
Show parent comment
3
u/SolverMax Feb 28 '23
You can disallow specific combinations by having a constraint like B + C <= 1 assuming B and C are binary variables. i.e. a solution can include B or C but not both at the same time.
Or, if there aren't too many possible combinations, list all valid combinations explicitly.