<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Miles,<br>
<br>
Having solved a model the CbcModel is much modified e.g. average
change in objective when branching on integer variables, value of
best possible solution etc. Also a copy of solver at various
times has been solved. <br>
<br>
What is wrong with<br>
<br>
Cbc_Model * baseModel = Cbc_newModel();<br>
<br>
do what you like to build most of model<br>
<br>
while (wanted) {<br>
Cbc_Model * model = Cbc_clone(baseModel);<br>
<br>
adjust model <br>
<br>
Cbc_solve(model);<br>
<br>
use results<br>
<br>
Cbc_deleteModel(model);<br>
}<br>
<br>
Cbc_deleteModel(baseModel);<br>
<br>
If this is approximately what you want then it can be fine tuned.<br>
<br>
John Forrest<br>
<br>
<br>
On 26/05/14 02:35, Miles Lubin wrote:<br>
</div>
<blockquote
cite="mid:CAJLyeTkB7Rm14K6_Lm87eOkn9p=gg-yRWrZJNW4DmrjCEhaiCw@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I'm looking at supporting modification of the problem data
after solve in the C interface and have come across some
surprising behavior. </div>
<div><br>
</div>
<div>After solving using a CbcModel (using CbcMain1), the column
lower bounds (from CbcModel::getColLower) are changed to equal
the value of the optimal solution. I.e., a binary variable set
at 1 in the optimal solution will have a reported lower bound
of 1. I assume this is because the bounds are returned from
the internal Clp model. </div>
<div><br>
</div>
<div>Similarly, calling CbcModel::solver()->setColLower()
after solve to modify bounds doesn't seem to have any effect
on subsequent resolves (again using CbcMain1).</div>
<div><br>
</div>
<div>Is there a proper way to access and modify the original
problem data after a solve to avoid recreating the model from
scratch? If not, I'll simply not expose this functionality in
the C interface. Obviously one shouldn't expect to efficiently
hot-start the next MIP solve, but being able to modify a model
could be convenient for the user when solving a sequence of
related MIPs.<br>
</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Miles</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Cbc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/cbc">http://list.coin-or.org/mailman/listinfo/cbc</a>
</pre>
</blockquote>
<br>
</body>
</html>