Skip to content

Modeling network flow problem in Python #4384

Discussion options

You must be logged in to vote

I think this should work similarly to the way I implemented the objective functions:

c4 = solver.Constraint(1)
for f in range(modesz):
  for j in range(nodesz):
    c4.SetCoefficient(get_x(s, j, f), 1)
for f in range(modesz):
  for j in range(nodesz):
    c4.SetCoefficient(get_x(j, s, f), -1)

This should capture the intent of equation (4) above.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ron-at-swgy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant