Another trial

24 views
Skip to first unread message

B M

unread,
Oct 15, 2022, 3:31:21 PM10/15/22
to am...@googlegroups.com
And when i tried this :

minimize numberofrelays: sum{u in 1..Nmax} x[u];


           subject to Feasibility: 1 <= sum{u in 1..Nmax} x[u] <= Nmax;
 
 
 
 
  subject to Atleastonepath26:
  (x[2]  * x[1]  )  + (x[6]  * x[1]  )  + (x[7]  * x[1]  )  + (x[11]  * x[1]  )  
 
  + (x[2]  * x[3]  * x[1] )  + (x[6]  * x[11]  * x[1] ) + (x[8]  * x[2]  * x[1] ) + (x[11]  * x[7]  * x[1] )
  + (x[2]  * x[6]  * x[1] ) + (x[7]  * x[2]  * x[1] ) + (x[8]  * x[3]  * x[1] ) + (x[12]  * x[2]  * x[1] )
  + (x[2]  * x[7]  * x[1] ) + (x[7]  * x[3]  * x[1] ) + (x[8]  * x[6]  * x[1] ) + (x[12]  * x[6]  * x[1] )  
  + (x[6]  * x[2]  * x[1] ) + (x[7]  * x[6]  * x[1] ) + (x[8]  * x[7]  * x[1] ) + (x[12]  * x[7]  * x[1] )
           + (x[6]  * x[6]  * x[1] ) + (x[7]  * x[11]  * x[1] ) + (x[11]  * x[6]  * x[1] ) + (x[12]  * x[11]  * x[1] ) >= 1;   




No solution can be produced, and this what i get for different solvers:



ampl: solve;

MINOS 5.51: ignoring integrality of 25 variables

MINOS 5.51: infeasible problem (or bad starting guess).

103 iterations

Nonlin evals: constrs = 140, Jac = 140.

 

 

ampl: option solver cplex;

ampl: solve;

CPLEX 20.1.0.0: Constraint _scon[1] is a nonquadratic nonlinear constraint.

 

 

ampl: option solver CONOPT;

ampl: solve;

CONOPT 3.17A: ignoring integrality of 25 variables.

Locally optimal; objective 3.438384814

17 iterations; evals: nf = 18, ng = 0, nc = 148, nJ = 20, nH = 0, nHv = 4

ampl: display x;

x [*] :=

 1 1            6 0           11 0           16 0           21 0

 2 0.174926     7 0.276676    12 0           17 0           22 0

 3 1            8 0           13 0.0952279   18 0           23 0

 4 0            9 0.0065213   14 0           19 0           24 0

 5 0           10 0           15 0.885034    20 0           25 0

;

 

ampl: option solver IBM ILOG CPLEX CP Optimizer;

ampl: solve;

Cannot invoke IBMILOGCPLEXCPOptimizer: no such program.

ampl:

 

 

or

Sorry, a demo license is limited to 10 variables and

10 constraints and objectives




Please help.
Thank you.

AMPL Google Group

unread,
Oct 15, 2022, 8:26:25 PM10/15/22
to AMPL Modeling Language
Your model has variables that are required to take integer values, so MINOS and CONOPT cannot solve it, because they do not handle integer-valued variables. (As indicated by the message "ignoring integrality of 25 variables", they just drop the integrality restriction and try to solve the resulting continuous problem.)

Your constraint Atleastonepath26 has many cubic terms like (x[2] * x[3] * x[1]) and (x[6] * x[11] * x[1]), so CPLEX cannot solve it. (This is indicated by the message "Constraint _scon[1] is a nonquadratic nonlinear constraint"; you can use the AMPL command "print _sconname[1];" to see which constraint this message is referring to.)

Solvers in our standard distribution that will handle this problem include x-gurobi, knitro, baron, lindoglobal, and octeract. However, in the size-limited demo bundle, the only one of these that will accept more the 10 variables is x-gurobi. (That is why you are seeing "Sorry, a demo license is limited to 10 variables . . .".)


--
Robert Fourer
am...@googlegroups.com
{#HS:2039130796-112378#}
Reply all
Reply to author
Forward
0 new messages