Constraint causes infeasibility

27 views
Skip to first unread message

Cenderze

unread,
Apr 26, 2015, 6:09:28 AM4/26/15
to am...@googlegroups.com
Hello!

I'm doing an optimization which purpose is to investigate whether it is possible to deduct products from other company's storage facilities. For this I've defined:

    set T ordered;  #The set of time periods
    set I;          #The set of storage facilities
    set J;          #The set of "company delivery" nodes. In practice represents a set of companies (each company resides in one node only)
    set V;          #The set of vehicles
    set A;          #Set of product types (assortments)
    set LINKS within {I,J}; #Representation of which company j owns which storage facility i.
    set ALLES within {I,J}; #All tuples of (i,j).
    set N;    # I union J. 

     var x{N,N,V,T,A} integer >= 0; #Flow from some origin within N to a destination within N using vehicle V, in time T, for product A.
     var l{I,TimeU,A} >= 0; # Supply at supply node I in time period T. 

    subject to Constraint8 {t in T, j in J, a in A}:
sum{i in I: (i,j) in LINKS} l[i,t,a] >= sum{v in V, (ih,jh) in ALLES} x[ih,j,v,t,a];

Here constraint8 describes that in order for a company j to deduct supplies from a storage facility ih owned by _another_ company jh, this cannot be possible if not company j has at least the same amount of supply of product a in that timeperiod available at their own supply facilities i. I.e. company j were to deduct 3 units of product a from company jh, company j's total supply l must equal to at least 3 for that particular assortment.

The program wont return any x variables if I "manipulate" the program so that I let my daily demand constraint (not present here) to be 3, wherein company 2's initial supply at each node is 3 (and I replace the >= with > in Constraint8). This should render me a solution where company 2 uses its own supply facilities to ensure the demand is met. However, the program becomes infeasible. And looking at Constraint8 I think it has to do with it having to be greater than x for all ih,jh in ALLES. The problem is though since ALLES includes all possible combinations, Constraint8 tells me that I must supply strictly more than it deducts, which causes the infeasibility.

What I've tried is:

    subject to Constraint8 {t in T, j in J, a in A}:
     sum{i in I: (i,j) in LINKS} l[i,t,a] >= sum{v in V, (ih,jh) in ALLES: i <> ih} x[ih,j,v,t,a];

which gave error and

    subject to Constraint8 {t in T, j in J, a in A}:
sum{i in I: (i,j) in LINKS} l[i,t,a] >= sum{v in V, (ih,jh) in ALLES DIFF LINKS} x[ih,j,v,t,a];

which also gave error. 

Can anybody see a way around this? Is there for instance a way to do a set PossibleLinks[j] = "All j which is present in ALLES, but not in (i,j) in LINKS"?

Thanks in advance

Robert Fourer

unread,
Apr 27, 2015, 9:12:49 PM4/27/15
to am...@googlegroups.com
The last version of your constraint seems OK, except that the set difference operator should be written in lowercase (diff rather than DIFF).

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of Cenderze
Sent: Sunday, April 26, 2015 5:09 AM
To: am...@googlegroups.com
Subject: [AMPL 10350] Constraint causes infeasibility

I'm doing an optimization which purpose is to investigate whether it is possible to deduct products from other company's storage facilities. For this I've defined:

.......
Reply all
Reply to author
Forward
0 new messages