Forum Discussion

FICO's avatar
FICO
Community Manager
9 months ago

How can I export an IIS in .lp format from mosel?

Hi! I have a model written in mosel. I know how to get the IIS when the model is infeasible but it seems I can only print the constraint and variable names from mosel.

I am looking for a procedure (or a function or just a way) to obtain from mosel the same result I get when I run the command 'iis -w some_file.lp' in the console. (https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/IIS.html)

Can anyone help?

Thanks

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    You can retrieve IIS into Mosel and display the set contents from Mosel, as shown in this example: FICO Xpress Optimization Examples Repository: Folio - Advanced modelling and solving tasks

    If you wish to print out IIS in matrix (LP-)format, you can directly use the corresponding command of the Optimizer console from within Mosel, for example

    command("iis -w 1 some_file.lp")

    If the IIS generation has not been invoked previous (eg via the Mosel subroutine getiis), then you need to use this sequence of commands:

    command("iis
    iis -w 1 some_file.lp")

    For further examples on using the Optimizer console commands from Mosel you may want to take a look at this set of examples: FICO Xpress Optimization Examples Repository: Using Optimizer Console for running matrices within Mosel

  • FICO's avatar
    FICO
    Community Manager

    Thanks Susanne!

    I ask another question. I see that sometimes the procedure getiis takes a lot of time. Is there a way to set a sort of timelimit for this procedure?

  • FICO's avatar
    FICO
    Community Manager

    IIS will respect the normal time limit controls.

    However, if it takes too long, a better option is to configure which restrictions IIS should try to test using the IISOPS control:

    https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/IISOPS.html

    For example, if the binary variables can never be relaxed (which is typically the case), then setting the 0th bit of this control will limit the amount of work greatly.