How to define the empinfo file dynamically

Solver related questions
Post Reply
Posts: 11
Joined: 2 years ago

How to define the empinfo file dynamically

Post by jshengdb » 7 months ago

Hi everyone,

Currently I am trying to use a decomposition method to solve a large-scale equilibrium problem, and at each iteration I am trying to solve a small equilibrium subproblem. The trick I use is that if the whole problem has a set m = /m1, m2, m3/, I can define a dynamic set mm(n), and each time just let m('mk') = yes and others to be none, then I am able to solve a subproblem with variables and equations with just index 'mk'. However, since now I am trying to solve an equilibrium subproblem with emp solver, I find this will be difficult since the empinfo file is usually defined at the beginning and I don't know how to update it every iteration. Could anyone help me to solve this problem?

P.S. another way I could use is reformulating the problem into MCP and solve it directly use MCP solver to avoid this issue, but since my problem is complicated so I think it is better to avoid this reformulation process.


User avatar
Posts: 113
Joined: 3 years ago
Location: Fairfax, VA

Re: How to define the empinfo file dynamically

Post by dirkse » 7 months ago


I encourage you and anyone else using EMP to browse EMPLIB (the library of EMP models that comes with GAMS) to pick up some useful information and techniques. Especially if you are stuck or thinking "There must be a better way to do this!?!", browsing can be a good source of fresh ideas.

In this case, I chose (somewhat randomly) the model negishi. It uses a put file to write the info file. The put file is generated at execution time, so you can create it on the fly as part of a loop.

The scarfemp-dem model is also a good one to look at - it uses a loop to create the EMP info file. The file is not created in a loop, but adding that is straightforward.


Post Reply