メインコンテンツへスキップ

How to handle two ways of shipping for supply network problem

回答済み

コメント

3件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Nestor Trejo
    • Gurobi-versary
    • First Comment
    • First Question

    Ok so I was able to solve the first portion. I changed my multidict  to the following:

    arcs,cost=gp.multidict({
    ('s0','c0s0','r0'):[28.536319],
    ('s0','c0s0','r1'):[0.323409],
    ('s1','c0s1','r0'):[0.786101],
    ('s1','c0s1','r1'):[0.258617],
    ('s4','c0s4','r0'):[2.0],
    ('s4','c0s4','r1'):[0.418180],####carrier 0 cost assumed no data
    ('s0','c1s0','r0'):[42.701323],
    ('s0','c1s0','r1'):[1.256058],
    ('s1','c1s1','r0'):[1.7],
    ('s1','c1s1','r1'):[0.651774],####carrier 0 cost assumed no data
    ('s4','c1s4','r0'):[2.108387],
    ('s4','c1s4','r1'):[0.406466],
    ('s0','c2s0','r0'):[44.812141],
    ('s0','c2s0','r1'):[2.332005],
    ('s1','c2s1','r0'):[0.788449],
    ('s1','c2s1','r1'):[1.665496],
    ('s0','c3s0','r0'):[73.373559],
    ('s0','c3s0','r1'):[1.294359],
    ('s1','c3s1','r0'):[80],
    ('s1','c3s1','r1'):[4.572656],####carrier 0 cost assumed no data
    ('s4','c3s4','r0'):[80],
    ('s4','c3s4','r1'):[12.418360],####carrier 0 cost assumed no data
    ('s0','c6s0','r0'):[37.286300],
    ('s0','c6s0','r1'):[1.312147],
    ('s1','c6s1','r0'):[1.116815],
    ('s1','c6s1','r1'):[1.365350],
    ('s4','c6s4','r0'):[1.697969],
    ('s4','c6s4','r1'):[0.45]####carrier 1 cost assumed no data
    })

    and the constraints to the following


    ##### supply constraints
    segments=supply_dict.keys()
    supply_flow= model.addConstrs((gp.quicksum(flow.select(segment))<=supply_dict[segment]
    for segment in segments), name='segment')
    # #####demand constraints
    customers=demand_dict.keys()
    demand_flow= model.addConstrs((gp.quicksum(flow.select('*',customer,'*'))==demand_dict[customer]
    for customer in customers), name='customer')
    # ######## Carrier constraints
    express_flow=model.addConstrs((gp.quicksum(flow.select('*',customer,'r0'))>=express_demand[customer]
    for customer in customers), name='express')

    And that works just like I wanted!

    However, this last constraint is giving me an infeasible solution and I am not sure why

    carrier_flow=model.addConstrs((gp.quicksum(flow.select('*',customer,'r1'))>=minweight####carrier minimum
    for customer in customers), name='minimum')
    0
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    Hi Nestor,

    The Knowledge Base article How do I determine why my model is infeasible? might come in handy.

    Best regards,
    Jaromił

    0

投稿コメントは受け付けていません。