Retrieve CPLEX file from AIMMS

468 views
Skip to first unread message

bart....@gmail.com

unread,
Feb 24, 2014, 5:17:14 AM2/24/14
to ai...@googlegroups.com
Hello,

Currently, I am facing problems when solving my model. I sincerely hope someone can help me with this problem.
I found a server that I could use to solve the problem, however the serves contains CPLEX instead of AIMMS.
Is it possible to retrieve the CPLEX input file generated from within AIMMS to use this as a input file for the CPLEX executable on this server?

I have added my MIP in case someone knows a more efficient way to formulate the problem. 

In anticipation of your response.

Bart Essink


ArcRouting.prj

Marcel Hunting

unread,
Feb 24, 2014, 7:31:18 AM2/24/14
to ai...@googlegroups.com
Hi Bart,

You can print a MPS, LP or SAV file by setting the corresponding CPLEX option, and such a file can be read by CPLEX. But why do you want to run on the server; is it because the server uses more powerful hardware? If CPLEX has issues solving your model in AIMMS than you can also expect that running with a CPLEX executable on the server.

By the way, attaching a .prj file is not sufficient. You also have to add the .amb file. Or, even better, you can export the AIMMS project to an .aimmspack file and post that one.

Best regards,

Marcel Hunting
AIMMS Software Developer

bart....@gmail.com

unread,
Feb 24, 2014, 8:27:02 AM2/24/14
to ai...@googlegroups.com
Hello Marcel,

Thanks for your reaction. I retrieved to LP formulation. Now, I am having problems with entering this into CPLEX.
I get your point regarding CPLEX, however this server is more powerful than my computer. Furthermore, most problems were in the area of memory allocation errers and extensive running time. I hope this server can solve the model....

Thanks for your comment on attaching files. I believe it is alright now.

Bart




Op maandag 24 februari 2014 13:31:18 UTC+1 schreef Marcel Hunting:
ArcRouting.aimmspack

Marcel Hunting

unread,
Feb 26, 2014, 6:55:18 AM2/26/14
to ai...@googlegroups.com
Hi Bart,

The objective that you use in your model contains a constant term, namely

   (FixedCostsSaltStorage)+(TruckPrice * NumberOfTrucks)+(Aanlooptijd*Personnelprice)

Unfortunately, this constant term is not passed to CPLEX. The 'MIP relative optimality tolerance', set to 0.1 in your project, is compared with the MIP gap calculated by CPLEX based on the objective that CPLEX uses, so without the constant term. Therefore AIMMS/CPLEX does not terminate even if the gap displayed in the progress window is smaller than 10% (the gap calculated in the progress window is calculated including the constant term).

I realize this is confusing and we will try to see whether we can improve this. As a workaround I suggest to introduce a new variable FixedObj with definition

   (FixedCostsSaltStorage)+(TruckPrice * NumberOfTrucks)+(Aanlooptijd*Personnelprice)

and replace the above constant term by FixedObj in the definition of objective variable Costs. Then CPLEX and AIMMS are in sync as the objective no longer contains a constant term. After this modification the model (using the first case) was solved in less than 10 seconds on my computer.

Best regards,

Marcel

Bart Essink

unread,
Feb 27, 2014, 7:30:18 AM2/27/14
to ai...@googlegroups.com
Hello Marcel,

Thank you for your reaction. I also appreciate that you have found a problem within my model.
The constant term has been replaced. I was not aware of this issue. Unfortunately, this did not solve my problem.

For quite some time now I am struggling with an MIP model. Mostly, I get a memory allocation error (even on a 64 bit PC with lots of RAM). I have many variables (200 million). I have rewritten the problem, because I thought the amount of variables was too large. However, even if I reduce the amount of variables (by swapping nodes to arcs, or drastically simplifying the problem) to 33.000 the model cannot be solved.

I am at the end of my rope and I hope you could provide me with some insights. It could be that some constraint can be formulated more efficiently, or that I am using the wrong solver, or ...?

I added two aimmsprojects. The first is the most extensive formulation of my problem. The AcrToArc is the formulization in which arcs and nodes are swapped. The amount of variables is reduced drastically. I also tried models that have similarities with both aimmsprojects. For example: omit the variable ArcSalting, omitting the trucks (k). Unfortunately, so far without result

Best regards,

Bart

Ps: the data in the sets and parameters obviously is dummy data. However, the real problem will show similarities with the data.


--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Probeersel2variabeleset11trucks280nodes120steps.aimmspack
ArcToArc.aimmspack

Marcel Hunting

unread,
Feb 28, 2014, 8:08:26 AM2/28/14
to ai...@googlegroups.com
Hi Bart,

200 million variables is very large. With 200 million variables you need a very good computer with lots of memory (and it might take a very long time to run it). So I prefer to run the other project :-) Good that you have rewritten the problem.

How should I run the project (ArcToArc)? I loaded the only case and then ran procedure MainExecution, and then the model appeared to be infeasible (I used CPLEX). Is that also what you did and observed?

Best regards,

Marcel

Bart Essink

unread,
Mar 6, 2014, 2:57:50 AM3/6/14
to ai...@googlegroups.com
Hallo Marcel,

Thank you for your response.
No, an infeasible solution was not what I experienced. I runned the model for more than 30 hours no and still got no solution.

The amount of variables has drastically been reduced to 330.000. Is that still too many?

Best regards,
Bart
ArcToArc.aimmspack

Marcel Hunting

unread,
Mar 11, 2014, 6:09:18 AM3/11/14
to ai...@googlegroups.com
Hi Bart,

After loading the only case in the project and running MainExecution, the model appeared to be infeasible because the constraint MustCrossSome is empty. That was caused by the constraint MustCrossSome(i) with definition

   sum[(k,t), Routing(k,t,i)]>=MustCross(i)

while variable Routing has index domain (k,i,t). Therefore I swapped the 't' and 'i' in the definition of MustCrossSome after which CPLEX started solving.

The model in its current form appears to be very hard. The relaxed version (in which all integer variables are made continuous) already takes more than 10 hours to solve (I terminated the run).

Best regards,

Marcel

Bart Essink

unread,
Mar 12, 2014, 7:56:43 AM3/12/14
to ai...@googlegroups.com

Hi Marcel,

 

Thank you for your response. I was afraid this would have been your response.

 

Even if I eliminate the concept of trucks (this reduces the number of variables with a factor 11) in the problem and formulate the problem as a heuristic (thus, solve the ILP for every truck and force the model to serve X arcs per run so that eventually all arcs will be served) it takes extensive computational time and I am not sure if I will obtain a feasible solution.

 

I do not believe I can rewrite the problem in order to make it less hard.

 

Is there no other solver available that can deal more easily with binary variables? Is it not possible to use AIMMS to solve this via an ILP formulation? Can the problem be formulated more efficiently?

 

Best regards,

Bart

ArcToArc.aimmspack

Bart Essink

unread,
Mar 12, 2014, 8:59:48 AM3/12/14
to ai...@googlegroups.com
Sorry, I added an incomplete aimmspack.

Bart
ArcToArc.aimmspack

Marcel Hunting

unread,
Mar 13, 2014, 6:24:23 AM3/13/14
to ai...@googlegroups.com
Hi Bart,

At this point it is not clear whether there exists a feasible solution to your problem. It might be that the problem is actually infeasible, which could be a reason for the poor performance. It would be good to first try a smaller instance (with less trucks) and see if then the problem can be solved.

Best regards,

Marcel

Bart Essink

unread,
Mar 13, 2014, 6:40:29 AM3/13/14
to ai...@googlegroups.com
Hi Marcel,

I have tried that many times and I am pretty sure that the problem is feasible.

Regardless of whether I reduce the number of steps, arcs or trucks I obtain feasible results. Therefore, I do not believe that the model is infeasible. 
As a result, I modeled the problem as a heuristic, in other words, iteratively solve the ILP for a single truck. Computational time tends to increase drastically with each iteration.

As this is an ILP problem. Do you believe solving the problem with CPLEX is actually possible? 

Best regards,

Bart


--
You received this message because you are subscribed to the Google Groups "AIMMS - The Modeling System" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aimms+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcel Hunting

unread,
Mar 14, 2014, 9:48:07 AM3/14/14
to ai...@googlegroups.com
Hi Bart,

Looking better at your project of March 6, the data for AdjacentArcs seems to contain two odd pairs, namely (137,1) and (1,125). If these pairs should be included then I think it is possible to construct an optimal solution by hand. If these pairs should not be included then the problem is infeasible.

Best regards,

Marcel
Reply all
Reply to author
Forward
0 new messages