When solve Stackelberg problems with MPEC type, shows 1 error that "571 rows 599 columns 12094 non-zeroes 13372 nl-code 9947 nl-non-zeros "

32 views
Skip to first unread message

lkc...@163.com

unread,
Apr 18, 2016, 9:17:17 AM4/18/16
to gamsworld
Help:



When I using GAMS to solve an Economic phenomenon based on Stacklberg Modle, once I operate the system ,some error occurs, the information shows in the below picture:

  Below is the whole program:

set i (*)
    j (*);
$load i j
parameters
    t(i,j) unit transport cost
    c(j) unit product cost
    sl(i) supply limit
    da(j) demand constant a
    db(j) demand constant b
    dl(j) demand limit;
$load t c sl da db dl
$ gdxin
display i,j,t,c,sl,da,db,dl;
set leader(i) /6/;
positive variables
    ps(i) supply price
    pd(j) demand price
    x(i,j) traffic volume between supply i to demand j;
variable benefitleader leader's benefit;
equations
    profit_leader leader's profit
    profit_follwer(i,j) follower's profit
    sb(i) supply balance
    deb(j) demand balance;
alias (i,ii);
x.lo(i,j)=0.01;
deb(j).. sum(i,x(i,j))=g=dl(j);
sb(i).. sl(i)=g=sum(j,x(i,j));
profit_follwer(i,j)$(not leader(i)).. t(i,j)+c(j)+ps(i)-pd(j)-exp(da(j))*sum(ii,x(ii,j))**db(j)=g=0;
profit_leader.. benefitleader =e=sum((i,j)$leader(i),exp(da(j))*sum(ii,x(i,j))**db(j)*x(i,j)-c(j)*x(i,j)-t(i,j)*x(i,j));
model sitanboge /sb.ps,deb.pd,profit_follwer.x,profit_leader/;
solve sitanboge using mpec max benefitleader;
option NLP=conopt;
display x.l,ps.l,pd.l;
Parameter report1(i,*) supply summary report
           report2(j,*) demand summary report ;
 report1(i,"supply") = sum(j,x.l(i,j)); report1(i,"capacity") = sl(i); report1(i,"prices") = ps.l(i);
 report2(j,"demandl") = dl(j);report2(j,"demand")=sum(i,x.l(i,j));  report2(j,"priced") = pd.l(j);

Display  report1,report2, x.l;


Sincerely ask for a solution to solve this problem !!!! 

Many Many Thanks !!!!!!



Renger van Nieuwkoop

unread,
Apr 18, 2016, 9:57:30 AM4/18/16
to gams...@googlegroups.com
Hi ??
Without the possibility of running your code (as you didn't send the input files) or at least information from the listing file with the exact error message, I must have superpowers to give you an answer (but perhaps others are better in guessing ).
Cheers
Renger 



Sent from my Samsung Note 4
--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

lkc...@163.com

unread,
Apr 18, 2016, 11:09:47 PM4/18/16
to gamsworld
Hi Renger;

Thanks for your reply!!

Attachment is my input file, looking forwarding your reply !
sitanboge.xlsx

Renger van Nieuwkoop

unread,
Apr 19, 2016, 9:19:20 AM4/19/16
to gams...@googlegroups.com

But then you should also send the code for reading the xlsx. Not that it is much work for me, but if the error is there, I won’t be able to reproduce your error.

Renger

lk

unread,
Apr 20, 2016, 3:17:01 AM4/20/16
to gams...@googlegroups.com
Hi Renger:
Sorry. It's my fault, here are the code for reading the xlsx.

$call GDXXRW.EXE sitanboge.xlsx dset=i rng=t!a2 rdim=1 dset=j rng=t!b1 cdim=1 par=sl rng=sl!a2 rdim=1 par=t rng=t! rdim=1 cdim=1 par=da rng=da!a2 rdim=1 par=db rng=db!a2 rdim=1 par=c rng=c!a2 rdim=1 par=dl rng=dl!a2 rdim=1
$gdxin sitanboge.gdx
  
Thanks !

Renger van Nieuwkoop

unread,
Apr 20, 2016, 4:01:08 AM4/20/16
to gams...@googlegroups.com

Hi

I had to change the following line to:

set leader(i) /6/; -> set leader(i) /s6/;

After that, I get the following error:

**** MCP pair sb.ps has unmatched equation

     sb(S6)

 

This means that there is one equation missing or one variable too much. (if you fix one of the prices, e.g., PS.FX(“s6”) = 1 the model starts solving but is infeasible.

Try to check your model formulation.

Additional material can be found in the GAMS model library (nash.gms has a Stackelberg) and Foundations of Network Optimization and Games, Chapter 10, by Friesz and Bernstein

Cheers

lk

unread,
Apr 21, 2016, 12:02:48 AM4/21/16
to gams...@googlegroups.com
Hi Renger:

Thanks so much, I have solved this problem. I deleted "$not leader(i)" in the "profit_follower" equation. But now aonther prolem is "infeasible solution: reduced gradient less than tolerance " ,I don't know where is going wrong...

please HELP!!

Again thank you very much !!!!! 

Renger van Nieuwkoop

unread,
Apr 21, 2016, 5:32:28 AM4/21/16
to gams...@googlegroups.com

THat would take too much of my time.

Sorry

lk

unread,
Apr 21, 2016, 5:33:41 AM4/21/16
to gams...@googlegroups.com
and it says infeassible solution..

lk

unread,
Apr 21, 2016, 5:40:01 AM4/21/16
to gams...@googlegroups.com
Hi Renger:

It's ok, thanks anyway.

LK
Reply all
Reply to author
Forward
0 new messages