Something makes this render infeasible and i dont know why #654
Replies: 1 comment
-
Solution: # Create a variable for each candidate. The variable is an integer between 0
# and 1 where 1 means selected and 0 means not selected.
for candidate in candidates:
identifier = f"{candidate.id}_{int(candidate.captain)}"
variables[(candidate.id, candidate.captain)] = LpVariable(
identifier, 0, 1, LpInteger
)
# Set the objective function to maximize the combined xGrowth of the team
problem += sum(variables[(c.id, c.captain)] * c.xValue for c in candidates) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been pulling my hair out over this problem for a few days now, I hope a kind soul in here can help me find the problem.
Consider this slightly simplified and redacted function:
Being executed like this:
It renders as infeasible unless I removes the captain variant from the input. The output looks similar to this, the crown means its the captain variant.
If anyone can spot the problem I would be grateful.
Beta Was this translation helpful? Give feedback.
All reactions