[AMPL 16175] Sorry, minos cannot handle logical constraints. exit code 7 - MiniMax Problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[AMPL 16175] Sorry, minos cannot handle logical constraints. exit code 7 - MiniMax Problem

Claudio Jiang-2
Hi,
I'm a student who's trying to learn the basics of AMPL,

I wrote a model that's supposed to assign some shifts (TURNI) to some physicians (DOTTORI),
every shift has a weight (peso_turno), and I'm trying to minimize the maximum weight for the "most loaded" physician.
The problem is that when I try to solve it, AMPL gives me the following error:

"Sorry, minos cannot handle logical constraints. exit code 7 "

the MODEL is the following:

set DOTTORI;
set TURNI;

param copertura_turno {TURNI} >=0;
param peso_turno {TURNI} ;
var Assegnamento {DOTTORI, TURNI} binary ;

var z;

minimize caricoMassimo: z;
   
subject to MinMax:
    forall {d in DOTTORI}
        z > sum {t in TURNI}
            Assegnamento[d,t]*peso_turno[t];
             
subject to VincoloCopertura:
        forall {t in TURNI}
             sum {d in DOTTORI} Assegnamento[d,t] = copertura_turno [t];         

While the DATA are:

set TURNI        :=     1    2    3    4    ;
set DOTTORI:= dottore1    dottore2;

param:    peso_turno    copertura_turno :=
1    1       2
2    1       1
3    2       1
4    1       3;


Thank you in advance for any help!
   

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

[AMPL 16176] Re: Sorry, minos cannot handle logical constraints. exit code 7 - MiniMax Problem

Claudio Jiang-2
Ok, i solved the problem rewriting the MODEL in this way:

set DOTTORI;
set TURNI;

param copertura_turno {TURNI} >=0;
param tipo_turno {TURNI} ;
param peso_turno {TURNI} ;
var Assegnamento {DOTTORI, TURNI} binary ;

minimize caricoMassimo:
    max {d in DOTTORI}
        sum {t in TURNI}
            Assegnamento[d,t]*peso_turno[t];
                 
subject to VincoloCopertura {t in TURNI }:
             sum {d in DOTTORI} Assegnamento[d,t] = copertura_turno [t];        

and adjusting the DATA to:

set TURNI        :=     1    2    3    4    ;
set DOTTORI:= dottore1    dottore2;

param:    peso_turno        copertura_turno :=
1    1        2
2    1        1
3    2        1
4    1        2;


However I don't understand how i fixed the error, if someone could give me any explanation I'd be glad.

P.S.

I've just read that I should use CPLEX to solve my model, since MINOS is ignoring my "binary" constraint, however CPLEX (and GUROBI too) are returning me the following error: "contains a nonlinear objective", any help?

Thanks
            

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [AMPL 16179] Sorry, minos cannot handle logical constraints. exit code 7 - MiniMax Problem

AMPL mailing list
You need to reformulate your model. You can find a reference of modeling minmax problem in https://ampl.com/BOOK/CHAPTERS/20-piecewise.pdf (pp: 380 -382). Read the section and reformulate your problem. Let us know if you get any problem.

--
Paras Tiwari
[hidden email]
{#HS:560905969-5192#}
On Fri, Apr 13, 2018 at 11:28 PM UTC, Ampl Modeling Language <[hidden email]> wrote:
Ok, i solved the problem rewriting the MODEL in this way:

set DOTTORI;
set TURNI;

param copertura_turno {TURNI} >=0;
param tipo_turno {TURNI} ;
param peso_turno {TURNI} ;
var Assegnamento {DOTTORI, TURNI} binary ;

minimize caricoMassimo:
max {d in DOTTORI}
sum {t in TURNI}
Assegnamento[d,t]*peso_turno[t];

subject to VincoloCopertura {t in TURNI }:
sum {d in DOTTORI} Assegnamento[d,t] = copertura_turno [t];

and adjusting the DATA to:

set TURNI := 1 2 3 4 ;
set DOTTORI:= dottore1 dottore2;

param: peso_turno copertura_turno :=
1 1 2
2 1 1
3 2 1
4 1 2;


However I don't understand how i fixed the error, if someone could give me any explanation I'd be glad.

P.S.

I've just read that I should use CPLEX to solve my model, since MINOS is ignoring my "binary" constraint, however CPLEX (and GUROBI too) are returning me the following error: "contains a nonlinear objective", any help?

Thanks

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to



On Fri, Apr 13, 2018 at 9:07 PM UTC, Ampl Modeling Language <[hidden email]> wrote:
Hi,
I'm a student who's trying to learn the basics of AMPL,

I wrote a model that's supposed to assign some shifts (TURNI) to some physicians (DOTTORI),
every shift has a weight (peso_turno), and I'm trying to minimize the maximum weight for the "most loaded" physician.
The problem is that when I try to solve it, AMPL gives me the following error:

"Sorry, minos cannot handle logical constraints. exit code 7 "

the MODEL is the following:

set DOTTORI;
set TURNI;

param copertura_turno {TURNI} >=0;
param peso_turno {TURNI} ;
var Assegnamento {DOTTORI, TURNI} binary ;

var z;

minimize caricoMassimo: z;

subject to MinMax:
forall {d in DOTTORI}
z > sum {t in TURNI}
Assegnamento[d,t]*peso_turno[t];

subject to VincoloCopertura:
forall {t in TURNI}
sum {d in DOTTORI} Assegnamento[d,t] = copertura_turno [t];

While the DATA are:

set TURNI := 1 2 3 4 ;
set DOTTORI:= dottore1 dottore2;

param: peso_turno copertura_turno :=
1 1 2
2 1 1
3 2 1
4 1 3;


Thank you in advance for any help!


--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.