Defining Constraints in Pulp model

PHOTO EMBED

Sun Jul 10 2022 06:16:57 GMT+0000 (Coordinated Universal Time)

Saved by @nilotpalc #python

# defining constraints
for c in customers:
    model += lpSum([flows.get((w, c)) for w in warehouse]) == 1

model += lpSum([open_w[w] for w in warehouse]) == 3

for w in warehouse:
    for c in customers:
        model += open_w[w] >= flows.get((w,c))
content_copyCOPY

Linear Progamming