[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] How to return the best MIP solution when the branch & cu
From: |
Michael Hennebry |
Subject: |
Re: [Help-glpk] How to return the best MIP solution when the branch & cut tree is exceeds memory limit (API implementation) |
Date: |
Wed, 28 Dec 2011 12:16:20 -0600 (CST) |
User-agent: |
Alpine 1.00 (DEB 882 2007-12-20) |
On Wed, 28 Dec 2011, Ruben Proano wrote:
I have been using GLPK as an API to solve a MIP problem coded in C++. The
model and glpk work well, but when the branch and cut tree is too large and
it exceeds the memory I allocated in the callback function, the program
halts. How can I change the call back function so that instead of halting
the program, it list the best solution it has found so far and continues
running.
I really appreciate your help,
I doubt that it can be done just by changing your callbacks.
You can probably get away with small alterations
to the memory allocation system.
In xmalloc, change the behaviour when malloc returns null.
You might need otherwise gratuitous globals to do what you want.
To continue at all, you will need to get the memory from somewhere.
Near the beginning of your code, use malloc to provide a reserve.
Set a flag when xmalloc dips into the reserve.
--
Michael address@hidden
"On Monday, I'm gonna have to tell my kindergarten class,
whom I teach not to run with scissors,
that my fiance ran me through with a broadsword." -- Lily