<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I will soon add binary variables (0-1)
so won't be CBC a must?<br>
<br>
And by using the command <font size="3"> "OsiClpSolverInterface
solver1;"</font> and then using object solver1, don't i use Clp
for now?<br>
<br>
Thank you.<br>
<br>
On 27/8/2012 21:57, <a class="moz-txt-link-abbreviated" href="mailto:acw@ascent.com">acw@ascent.com</a> wrote:<br>
</div>
<blockquote
cite="mid:OF6FA46851.33241946-ON85257A67.00670A4F-85257A67.00683EE8@ascent.com"
type="cite"><font face="sans-serif" size="2">I'm glad you were
able to resolve your
problem by relaxing the bounds. I think that means that I don't
have
to examine the MPS file in detail; I did glance through it and
didn't see
anything particularly unusual.</font>
<br>
<br>
<font face="sans-serif" size="2">I don't know of any software that
is
used to "open" MPS files; they are just text files used to
express
optimization problems and solutions. It's actually fairly
old-fashioned;
other contributors to this list will probably be able to
recommend more
modern problem-file formats.</font>
<br>
<br>
<font face="sans-serif" size="2">Your problem is a pure linear
programming
problem, with no integer constraints. Because of this, using
Cbc
might be considered "overkill", using a tool that is much more
powerful and complicated than the one you need. I would
recommend
that you investigate Clp, which is a pure linear optimizer.
It's
likely that using Clp instead of Cbc will simplify your code a
lot.</font>
<br>
<br>
<table width="100%">
<tbody>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">From:</font>
</td>
<td><font face="sans-serif" size="1">Christos
<a class="moz-txt-link-rfc2396E" href="mailto:chtsolak@gmail.com"><chtsolak@gmail.com></a></font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">To:</font>
</td>
<td><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:acw@ascent.com">acw@ascent.com</a></font>
</td>
</tr>
<tr>
<td valign="top"><font color="#5f5f5f" face="sans-serif"
size="1">Cc:</font>
</td>
<td><font face="sans-serif" size="1">Allan Wechsler
<a class="moz-txt-link-rfc2396E" href="mailto:acw@robson.ascent.com"><acw@robson.ascent.com></a>,
<a class="moz-txt-link-rfc2396E" href="mailto:cbc@list.coin-or.org">"cbc@list.coin-or.org"</a> <a class="moz-txt-link-rfc2396E" href="mailto:cbc@list.coin-or.org"><cbc@list.coin-or.org></a></font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Date:</font>
</td>
<td><font face="sans-serif" size="1">08/21/2012 02:06 PM</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Subject:</font>
</td>
<td><font face="sans-serif" size="1">Re: [Cbc] Artificial
variables</font></td>
</tr>
</tbody>
</table>
<br>
<hr noshade="noshade">
<br>
<br>
<br>
<font size="3">Sorry for late responding but i didn't have access
to
internet.<br>
<br>
-I found the solution to my problems. I had to relax some bounds
as you
correctly suggested me, and thank you very much for that.<br>
<br>
-I attach a printscreen of the results. Using the commands "int
integers
= solver1.getNumIntegers();" and<br>
"cout << "\nNumber of integers: " << integers;"
as you can see i have no integers...<br>
<br>
I use the command " OsiClpSolverInterface solver1;" so i think
i am not using Cbc, am i right?<br>
<br>
I do not know if there is a simple way to switch via solvers...<br>
<br>
-I created the mps file and i attach it. I do not know how to
use it with
other solvers, so in short-term future i will contact you to
help me.<br>
<br>
Any comments would be very useful.<br>
<br>
<br>
PS. Which software do you suggest to open mps files?<br>
<br>
<br>
Thank you very much for your time!<br>
<br>
<br>
<br>
Attachments: </font><a moz-do-not-send="true"
href="https://dl.dropbox.com/u/12237320/DAS%20working.PNG"><font
color="blue" size="3"><u>https://dl.dropbox.com/u/12237320/DAS%20working.PNG</u></font></a><font
size="3"><br>
<br>
</font><a moz-do-not-send="true"
href="https://dl.dropbox.com/u/12237320/DAS_Model.mps"><font
color="blue" size="3"><u>https://dl.dropbox.com/u/12237320/DAS_Model.mps</u></font></a><font
size="3"><br>
<br>
<br>
On 17/8/2012 17:30, </font><a moz-do-not-send="true"
href="mailto:acw@ascent.com"><font color="blue" size="3"><u>acw@ascent.com</u></font></a><font
size="3">
wrote:</font>
<br>
<font face="sans-serif" size="2">I am no longer certain I
understand
what you are doing. You say "I do not understand what do you
mean integer variables ... I do not declare anywhere ..." Why
are
you using Cbc if none of your variables are declared to be
integer? If
all the variables are real-valued, you can use an LP solver
directly. All
the complexity of Cbc is to deal with variables that are
constrained to
have integer values.</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
After a solver has been loaded with a problem, the method
OsiSolverInterface.writeMps(const
char *filename) will save an MPS file whose name is the filename
plus the
extension ".mps". Once you have an MPS file, many people
on this mailing list will be able to help you, because they will
be able
to try their own solvers on your problem.</font><font size="3">
<br>
<br>
</font>
<table width="100%">
<tbody>
<tr valign="top">
<td width="9%"><font color="#5f5f5f" face="sans-serif"
size="1">From:</font><font size="3">
</font>
</td>
<td width="90%"><font face="sans-serif" size="1">Christos </font><a
moz-do-not-send="true" href="mailto:chtsolak@gmail.com"><font
color="blue" face="sans-serif" size="1"><u><chtsolak@gmail.com></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">To:</font><font
size="3">
</font>
</td>
<td><a moz-do-not-send="true" href="mailto:acw@ascent.com"><font
color="blue" face="sans-serif" size="1"><u>acw@ascent.com</u></font></a><font
size="3">
</font>
</td>
</tr>
<tr>
<td valign="top"><font color="#5f5f5f" face="sans-serif"
size="1">Cc:</font><font size="3">
</font>
</td>
<td><font face="sans-serif" size="1">Allan Wechsler </font><a
moz-do-not-send="true"
href="mailto:acw@robson.ascent.com"><font color="blue"
face="sans-serif" size="1"><u><acw@robson.ascent.com></u></font></a><font
face="sans-serif" size="1">,
</font><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u>"cbc@list.coin-or.org"</u></font></a><font
face="sans-serif" size="1">
</font><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u><cbc@list.coin-or.org></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Date:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">08/10/2012 04:52 PM</font><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Subject:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">Re: [Cbc] Artificial
variables</font></td>
</tr>
</tbody>
</table>
<br>
<font size="3"><br>
</font>
<hr noshade="noshade"><font size="3"><br>
<br>
</font><font color="#a00000" size="3"><br>
A lot of very useful info in one email! -many explanatory
questions arise!<br>
<br>
Look under your sentences.</font><font size="3"><br>
<br>
<br>
<br>
On 10/8/2012 23:10, </font><a moz-do-not-send="true"
href="mailto:acw@ascent.com"><font color="blue" size="3"><u>acw@ascent.com</u></font></a><font
size="3">
wrote: </font><font face="sans-serif" size="2"><br>
The problem is certainly infeasibility. Unboundedness is simply
not
possible if all the variables have bounds. Here are some random
ideas.</font><font size="3">
</font><font face="sans-serif" size="2"><br>
<br>
If you can do it without modifying your code too painfully, you
might try
selectively disabling constraints to find an infeasible set.</font><font
size="3">
<br>
</font><font color="#a00000" size="3"><br>
Because it is painful, i will try the other solutions first.</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
I assume you have some integer variables. If so, make sure that
their
bounds all include at least one integer. For instance, if X is
an
integer, but 0.3 <= X <= 0.82, then the problem is
infeasible because
there are no integers in that range.</font><font size="3"> <br>
</font><font color="#a00000" size="3"><br>
I do not understand what do you mean "integer variables" as soon
as i do not declare anywhere, i only pass the column and row
bounds, the
objective, the value, index, start matrices, and the number of
rows and
columns.<br>
<br>
But there are no such bound in any of the variables. Some have
equal bounds
(0), i do not know if this is a problem. I doesn't seems to be..</font><font
size="3"><br>
</font><font face="sans-serif" size="2"><br>
Look at your objective, and try removing the lower bounds on
some variables
with positive coefficients, or the upper bounds on some with
negative coefficients.
This might give you a better idea of the nature of the
infeasibility.</font><font size="3">
</font><font color="#a00000" size="3"><br>
All variables have positive coefficients and all have collb=0. I
made them
-infinity but the defect became bigger</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
<br>
Remember that an infeasibility is a distributed issue; you
cannot attribute
it to a single bound or constraint. The best you can hope for
is
to find a small subset of your bounds and constraints that is
still infeasible,
but is simple enough to understand.</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
<br>
You might want to try saving the problem as an MPS file (using
WriteMps),
so that you can more easily modify the problem and make your
debug cycle
simpler.</font><font size="3"> <br>
</font><font color="#a00000" size="3"><br>
This would be really useful. How can i use it through C++? <br>
As i mentioned C++ reads data from excel file, puts them in
matrices, builds
the model (ie the index, value, start, obj...) and calls the
solver.<br>
How can i make it write an .mps file? Do i need time to learn
something
like CBC?<br>
<br>
Thank you</font><font size="3"><br>
</font>
<table width="100%">
<tbody>
<tr valign="top">
<td width="9%"><font color="#5f5f5f" face="sans-serif"
size="1">From:</font><font size="3">
</font>
</td>
<td width="90%"><font face="sans-serif" size="1">Christos </font><a
moz-do-not-send="true" href="mailto:chtsolak@gmail.com"><font
color="blue" face="sans-serif" size="1"><u><chtsolak@gmail.com></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">To:</font><font
size="3">
</font>
</td>
<td><a moz-do-not-send="true" href="mailto:acw@ascent.com"><font
color="blue" face="sans-serif" size="1"><u>acw@ascent.com</u></font></a><font
size="3">
</font>
</td>
</tr>
<tr>
<td valign="top"><font color="#5f5f5f" face="sans-serif"
size="1">Cc:</font><font size="3">
</font>
</td>
<td><font face="sans-serif" size="1">Allan Wechsler </font><a
moz-do-not-send="true"
href="mailto:acw@robson.ascent.com"><font color="blue"
face="sans-serif" size="1"><u><acw@robson.ascent.com></u></font></a><font
face="sans-serif" size="1">,
</font><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u>"cbc@list.coin-or.org"</u></font></a><font
face="sans-serif" size="1">
</font><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u><cbc@list.coin-or.org></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Date:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">08/10/2012 03:59 PM</font><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Subject:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">Re: [Cbc] Artificial
variables</font></td>
</tr>
</tbody>
</table>
<br>
<font size="3"><br>
<br>
</font>
<hr noshade="noshade"><font size="3"><br>
<br>
<br>
Thank you very much for you time and your valuable help.<br>
<br>
Yes, all the variables are bounded.. Some of them have equal low
and upper
bounds. I tried by differing them, but the problem remains...<br>
<br>
I would try the option of limiting the objective but the code is
too complex
to add a new constrain in a few hours.. (The model is
constructed in C++
by reading an excel file).<br>
<br>
So, i almost agree that the defect is infeasibility.<br>
<br>
Can you suggest any trick to find it while trying to limit the
objective?<br>
<br>
Thank you very much.<br>
<br>
<br>
On 10/8/2012 20:06, </font><a moz-do-not-send="true"
href="mailto:acw@ascent.com"><font color="blue" size="3"><u>acw@ascent.com</u></font></a><font
size="3">
wrote: </font><font face="sans-serif" size="2"><br>
The objective is a linear combination of some set of variables.
Of
course I don't know what your objective function is, but let's
call it
F.</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
<br>
Since this is a minimization problem, I propose adding one more
constraint
to the problem, F >= -1e6. If unboundedness is the problem,
the
modified problem will solve with no trouble.</font><font
size="3"> </font><font face="sans-serif" size="2"><br>
<br>
In your first response, you mention variable bounds. Do you
have
bounds on all your variables? If you do, then my analysis is
probably
wrong and the difficulty is infeasibility rather than
unboundedness.</font><font size="3">
</font><font face="sans-serif" size="2"><br>
<br>
It should not be necessary to know any solver internals to
figure out what's
wrong.</font><font size="3"> </font>
<table width="100%">
<tbody>
<tr valign="top">
<td width="9%"><font color="#5f5f5f" face="sans-serif"
size="1">From:</font><font size="3">
</font>
</td>
<td width="90%"><font face="sans-serif" size="1">Christos </font><a
moz-do-not-send="true" href="mailto:chtsolak@gmail.com"><font
color="blue" face="sans-serif" size="1"><u><chtsolak@gmail.com></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">To:</font><font
size="3">
</font>
</td>
<td><a moz-do-not-send="true" href="mailto:acw@ascent.com"><font
color="blue" face="sans-serif" size="1"><u>acw@ascent.com</u></font></a><font
size="3">
</font>
</td>
</tr>
<tr>
<td valign="top"><font color="#5f5f5f" face="sans-serif"
size="1">Cc:</font><font size="3">
</font>
</td>
<td><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u>"cbc@list.coin-or.org"</u></font></a><font
face="sans-serif" size="1">
</font><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u><cbc@list.coin-or.org></u></font></a><font
face="sans-serif" size="1">,
Allan Wechsler </font><a moz-do-not-send="true"
href="mailto:acw@robson.ascent.com"><font color="blue"
face="sans-serif" size="1"><u><acw@robson.ascent.com></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Date:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">08/10/2012 12:37 PM</font><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Subject:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">Re: [Cbc] Artificial
variables</font></td>
</tr>
</tbody>
</table>
<br>
<font size="3"><br>
<br>
<br>
</font>
<hr noshade="noshade"><font size="3"><br>
<br>
<br>
I forgot to mention that it is a minimization problem , so i do
not know
if there is any point in limiting objective.<br>
<br>
Sorry for the double mail.<br>
<br>
On 10/8/2012 19:24, </font><a moz-do-not-send="true"
href="mailto:acw@ascent.com"><font color="blue" size="3"><u>acw@ascent.com</u></font></a><font
size="3">
wrote: </font><font face="sans-serif" size="2"><br>
No single constraint is responsible for an infeasibility.
Consider
a system with one variable, and two constraints, X >= 7 and X
<=
4. This system is obviously infeasible, but which of the two
constraints
is at fault?</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
<br>
In your case I suspect that the problem is unbounded rather than
infeasible,
because you have so few constraints and so many variables.
Unless
the problem has a very special structure, a problem with fewer
constraints
than variables is likely to be unbounded.</font><font size="3">
</font><font face="sans-serif" size="2"><br>
<br>
You can check this by adding a constraint that limits your
objective to,
say, 1e6. If the problem now solves, then unboundedness is
almost
certainly your difficulty.</font><font size="3"> </font>
<table width="100%">
<tbody>
<tr valign="top">
<td width="22%"><font color="#5f5f5f" face="sans-serif"
size="1">From:</font><font size="3">
</font>
</td>
<td width="77%"><font face="sans-serif" size="1">Christos </font><a
moz-do-not-send="true" href="mailto:chtsolak@gmail.com"><font
color="blue" face="sans-serif" size="1"><u><chtsolak@gmail.com></u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">To:</font><font
size="3">
</font>
</td>
<td><a moz-do-not-send="true"
href="mailto:cbc@list.coin-or.org"><font color="blue"
face="sans-serif" size="1"><u>cbc@list.coin-or.org</u></font></a><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Date:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">08/10/2012 09:32 AM</font><font
size="3">
</font>
</td>
</tr>
<tr valign="top">
<td><font color="#5f5f5f" face="sans-serif" size="1">Subject:</font><font
size="3">
</font>
</td>
<td><font face="sans-serif" size="1">[Cbc] Artificial
variables</font></td>
</tr>
</tbody>
</table>
<br>
<font size="3"><br>
<br>
<br>
<br>
</font>
<hr noshade="noshade"><tt><font size="2"><br>
<br>
<br>
Hi, i have a model with around 10000 variable and 1500
equations.<br>
<br>
But i get the messages on the photo when i run it:</font></tt><font
color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="http://imageshack.us/photo/my-images/39/dascd.png/"><tt><font
color="blue" size="2"><u>http://imageshack.us/photo/my-images/39/dascd.png/</u></font></tt></a><tt><font
size="2"><br>
<br>
Is there any way to use artificial variable or something else
in order
<br>
to find the problematic equation?<br>
<br>
Thank you in advance<br>
_______________________________________________<br>
Cbc mailing list</font></tt><font color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="mailto:Cbc@list.coin-or.org"><tt><font color="blue"
size="2"><u>Cbc@list.coin-or.org</u></font></tt></a><font
color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="http://list.coin-or.org/mailman/listinfo/cbc"><tt><font
color="blue" size="2"><u>http://list.coin-or.org/mailman/listinfo/cbc</u></font></tt></a><font
size="3"><br>
<br>
<br>
<br>
</font>
<br>
<br>
</blockquote>
<br>
</body>
</html>