Please forgive me if this is a poor question. But how do I optimize a set of variables in a dictionary?
I posted an excel img of my problem. Where the max cost is 169 and I have to select 4/6 five cost to get the max profit? So my goal is to have a combination of 4/6 (max profits) with a cost limit of $169.
I was able to learn to get the max from a basic equation but could not extend to help solve my example.
x1 = pulp.LpVariable("x1", 0, 40) # 0<= x1 <= 40
x2 = pulp.LpVariable("x2", 0, 1000) # 0<= x2 <= 1000
prob = pulp.LpProblem("problem", pulp.LpMaximize)
prob += 2*x1+x2 <= 100
prob += x1+x2 <= 80
prob += 3*x1+2*x2
status = prob.solve()
pulp.LpStatus[status]
# print the results x1 = 20, x2 = 60
pulp.value(x1)
pulp.value(x2)
Source:https://thomas-cokelaer.info/blog/2012/11/solving-a-linear-programming-problem-with-python-pulp/

x[i]indicating if projectiis selected.