Fractional root node solution

281 views
Skip to first unread message

Akshay

unread,
Nov 30, 2016, 11:22:03 AM11/30/16
to AMPL Modeling Language
When running a MIP with AMPL/CPLEX and terminating at the root node with option cplex_options 'nodes=0', is there a variable suffix that stores the fractional values of the root node LP solution?

I am interested in obtaining the fractional solution because I want to implement some of my own cutting planes in AMPL, without having to code them through the callback interface in C/C++. 

Is the AMPL/CPLEX interface capable of returning any root node basis information?

Robert Fourer

unread,
Dec 1, 2016, 12:51:26 PM12/1/16
to am...@googlegroups.com
When it detects that you have sent a MIP, CPLEX returns only integer solutions; if CPLEX is stopped before an integer solution is found, it doesn't return anything. There isn't a way to get the root relaxation solution back into AMPL.

You can get a solution of the continuous relaxation of a MIP, however, by setting "option relax_integrality 1;" in AMPL, or by adding 'relax' to your cplex_options string. In the latter case it is best to also specify "option presolve 0;" in AMPL, so that AMPL does not make any presolve reductions that rely on integrality.

Bob Fourer
am...@googlegroups.com

=======

Akshay

unread,
Mar 2, 2019, 9:19:04 PM3/2/19
to AMPL Modeling Language
Hi Bob,

Writing back about this after 2 years with the same question: is it still not possible to obtain the fractional root node solution when solving a MIP in AMPL with Cplex, Gurobi, etc.? Is it possible to have this as a feature in future versions? It will be a really nice thing to have for someone who wants to quickly test some ideas on cutting planes and heuristics in AMPL but doesn't want to go through the hassle of C/C++ interface and callbacks.

- Akshay

AMPL Google Group

unread,
Mar 5, 2019, 2:55:05 PM3/5/19
to Ampl Modeling Language
There is still no option to ask for the fractional root node solution. However, the root node solution is computed by solving the continuous relaxation of the MIP, which you can get by setting an appropriate solver option. Is there some reason why requesting the continuous relaxation of the MIP would not be helpful for you? An example would be helpful.

--
Robert Fourer
am...@googlegroups.com
{#HS:792148353-37629#}
--
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 ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



Akshay Gupte

unread,
Mar 10, 2019, 9:48:06 AM3/10/19
to am...@googlegroups.com
I want to take advantage of the MIP solver's presolve techniques and also the cutting planes it adds to the LP relaxation at the root node. Then just before branching begins, I would like to add my own cutting planes to the current LP relaxation, which would be significantly different than the original LP because of presolve and cuts. I believe this is how most cutting plane experiments work, when implemented through callback interfaces in C, C++, etc. Hence, it would be nice if there is a AMPL suffix that stores the fractional solution after I have terminated MIP solve at root node by setting a node limit of 0.

A work-around of course is to reverse the experiment: solve the original LP relaxation as you mentioned, generate user cuts with respect to its solution, add them as user cuts or lazy constraints in AMPL, and then solve the model as a MIP and see how much root node gap reduction is obtained by user cuts. But it would be nice to be able to do the former experiment since that is the customary way and perhaps most editors/referees are expecting it.

You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/IscbR0zUDgU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.

To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.


--
Akshay Gupte

AMPL Google Group

unread,
Mar 11, 2019, 9:50:09 AM3/11/19
to Ampl Modeling Language
That is reasonable, though it's currently not supported by AMPL's MIP solver interfaces. We are currently investigating ways of making additional information available to users through callbacks, and will announce some possibilities for Python/Gurobi this spring.

--
Robert Fourer
am...@googlegroups.com
{#HS:792148353-37629#}
On Sun, Mar 10, 2019 at 1:48 PM UTC, Ampl Modeling Language <am...@googlegroups.com> wrote:
I want to take advantage of the MIP solver's presolve techniques and also the cutting planes it adds to the LP relaxation at the root node. Then just before branching begins, I would like to add my own cutting planes to the current LP relaxation, which would be significantly different than the original LP because of presolve and cuts. I believe this is how most cutting plane experiments work, when implemented through callback interfaces in C, C++, etc. Hence, it would be nice if there is a AMPL suffix that stores the fractional solution after I have terminated MIP solve at root node by setting a node limit of 0.

A work-around of course is to reverse the experiment: solve the original LP relaxation as you mentioned, generate user cuts with respect to its solution, add them as user cuts or lazy constraints in AMPL, and then solve the model as a MIP and see how much root node gap reduction is obtained by user cuts. But it would be nice to be able to do the former experiment since that is the customary way and perhaps most editors/referees are expecting it.



On Tue, Mar 5, 2019 at 7:54 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
There is still no option to ask for the fractional root node solution. However, the root node solution is computed by solving the continuous relaxation of the MIP, which you can get by setting an appropriate solver option. Is there some reason why requesting the continuous relaxation of the MIP would not be helpful for you? An example would be helpful.

--
Robert Fourer
am...@googlegroups.com


Akshay

unread,
Jan 30, 2021, 12:26:07 PM1/30/21
to AMPL Modeling Language
Hi Bob,

Inquiring again after two years --- is there any such feature in AMPL now ? You mentioned possibility of callbacks and Python/Gurobi back in 2019 but I don't see this mentioned on the AMPL website. Any information would be very helpful since I really prefer not having to code in lower-level languages if I just want to check if some cutting plane ideas work or not.

AMPL Google Group

unread,
Feb 1, 2021, 12:45:55 PM2/1/21
to AMPL Modeling Language
Hi Akshay,

Last year we had a preliminary implementation of callbacks from Gurobi to the AMPL Python API; see for example https://ampl.com/MEETINGS/TALKS/2019_06_Dublin_TA-49.pdf#page=35. There's a much more complete implementation now; we haven't finished the documentation needed to release it, but here's some information that will let you examine a pre-release version:


--
Robert Fourer
am...@googlegroups.com
{#HS:792148353-37629#}
On Sat, Jan 30, 2021 at 5:26 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hi Bob,

Inquiring again after two years --- is there any such feature in AMPL now ? You mentioned possibility of callbacks and Python/Gurobi back in 2019 but I don't see this mentioned on the AMPL website. Any information would be very helpful since I really prefer not having to code in lower-level languages if I just want to check if some cutting plane ideas work or not.
On Mon, Mar 11, 2019 at 1:49 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
That is reasonable, though it's currently not supported by AMPL's MIP solver interfaces. We are currently investigating ways of making additional information available to users through callbacks, and will announce some possibilities for Python/Gurobi this spring.


--
Robert Fourer
am...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages