[Cbc] Artificial variables

Christos chtsolak at gmail.com
Wed Aug 29 11:42:42 EDT 2012


I will soon add binary variables (0-1) so won't be CBC a must?

And by using the command "OsiClpSolverInterface solver1;" and then using 
object solver1, don't i use Clp for now?

Thank you.

On 27/8/2012 21:57, acw at ascent.com wrote:
> 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.
>
> 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.
>
> 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.
>
> From: 	Christos <chtsolak at gmail.com>
> To: 	acw at ascent.com
> Cc: 	Allan Wechsler <acw at robson.ascent.com>, "cbc at list.coin-or.org" 
> <cbc at list.coin-or.org>
> Date: 	08/21/2012 02:06 PM
> Subject: 	Re: [Cbc] Artificial variables
>
>
> ------------------------------------------------------------------------
>
>
>
> Sorry for late responding but i didn't have access to internet.
>
> -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.
>
> -I attach a printscreen of the results. Using the commands "int 
> integers = solver1.getNumIntegers();" and
> "cout << "\nNumber of integers: " << integers;" as you can see i have 
> no integers...
>
> I use the command " OsiClpSolverInterface solver1;" so i think i am 
> not using Cbc, am i right?
>
> I do not know if there is a simple way to switch via solvers...
>
> -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.
>
> Any comments would be very useful.
>
>
> PS. Which software do you suggest to open mps files?
>
>
> Thank you very much for your time!
>
>
>
> Attachments: _https://dl.dropbox.com/u/12237320/DAS%20working.PNG_
>
> _https://dl.dropbox.com/u/12237320/DAS_Model.mps_
>
>
> On 17/8/2012 17:30, _acw at ascent.com_ <mailto:acw at ascent.com>wrote:
> 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.
>
> 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.
>
> From:	Christos _<chtsolak at gmail.com>_ <mailto:chtsolak at gmail.com>
> To:	_acw at ascent.com_ <mailto:acw at ascent.com>
> Cc:	Allan Wechsler _<acw at robson.ascent.com>_ 
> <mailto:acw at robson.ascent.com>, _"cbc at list.coin-or.org"_ 
> <mailto:cbc at list.coin-or.org>_<cbc at list.coin-or.org>_ 
> <mailto:cbc at list.coin-or.org>
> Date:	08/10/2012 04:52 PM
> Subject:	Re: [Cbc] Artificial variables
>
>
>
> ------------------------------------------------------------------------
>
>
>
> A lot of very useful info in one email! -many explanatory questions arise!
>
> Look under your sentences.
>
>
>
> On 10/8/2012 23:10, _acw at ascent.com_ <mailto:acw at ascent.com>wrote:
> The problem is certainly infeasibility.  Unboundedness is simply not 
> possible if all the variables have bounds.  Here are some random ideas.
>
> If you can do it without modifying your code too painfully, you might 
> try selectively disabling constraints to find an infeasible set.
>
> Because it is painful, i will try the other solutions first.
> 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.
>
> 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.
>
> 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..
>
> 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.
> All variables have positive coefficients and all have collb=0. I made 
> them -infinity but the defect became bigger
>
> 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.
>
> 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.
>
> This would be really useful. How can i use it through C++?
> 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.
> How can i make it write an .mps file? Do i need time to learn 
> something like CBC?
>
> Thank you
> From:	Christos _<chtsolak at gmail.com>_ <mailto:chtsolak at gmail.com>
> To:	_acw at ascent.com_ <mailto:acw at ascent.com>
> Cc:	Allan Wechsler _<acw at robson.ascent.com>_ 
> <mailto:acw at robson.ascent.com>, _"cbc at list.coin-or.org"_ 
> <mailto:cbc at list.coin-or.org>_<cbc at list.coin-or.org>_ 
> <mailto:cbc at list.coin-or.org>
> Date:	08/10/2012 03:59 PM
> Subject:	Re: [Cbc] Artificial variables
>
>
>
>
> ------------------------------------------------------------------------
>
>
>
> Thank you very much for you time and your valuable help.
>
> Yes, all the variables are bounded.. Some of them have equal low and 
> upper bounds. I tried by differing them, but the problem remains...
>
> 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).
>
> So, i almost agree that the defect is infeasibility.
>
> Can you suggest any trick to find it while trying to limit the objective?
>
> Thank you very much.
>
>
> On 10/8/2012 20:06, _acw at ascent.com_ <mailto:acw at ascent.com>wrote:
> 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.
>
> 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.
>
> 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.
>
> It should not be necessary to know any solver internals to figure out 
> what's wrong.
> From:	Christos _<chtsolak at gmail.com>_ <mailto:chtsolak at gmail.com>
> To:	_acw at ascent.com_ <mailto:acw at ascent.com>
> Cc:	_"cbc at list.coin-or.org"_ 
> <mailto:cbc at list.coin-or.org>_<cbc at list.coin-or.org>_ 
> <mailto:cbc at list.coin-or.org>, Allan Wechsler 
> _<acw at robson.ascent.com>_ <mailto:acw at robson.ascent.com>
> Date:	08/10/2012 12:37 PM
> Subject:	Re: [Cbc] Artificial variables
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
>
> I forgot to mention that it is a minimization problem , so i do not 
> know if there is any point in limiting objective.
>
> Sorry for the double mail.
>
> On 10/8/2012 19:24, _acw at ascent.com_ <mailto:acw at ascent.com>wrote:
> 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?
>
> 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.
>
> 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.
> From:	Christos _<chtsolak at gmail.com>_ <mailto:chtsolak at gmail.com>
> To:	_cbc at list.coin-or.org_ <mailto:cbc at list.coin-or.org>
> Date:	08/10/2012 09:32 AM
> Subject:	[Cbc] Artificial variables
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
>
>
> Hi, i have a model with around 10000 variable and 1500 equations.
>
> But i get the messages on the photo when i run it:_
> __http://imageshack.us/photo/my-images/39/dascd.png/_
>
> Is there any way to use artificial variable or something else in order
> to find the problematic equation?
>
> Thank you in advance
> _______________________________________________
> Cbc mailing list_
> __Cbc at list.coin-or.org_ <mailto:Cbc at list.coin-or.org>_
> __http://list.coin-or.org/mailman/listinfo/cbc_
>
>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20120829/d64f654e/attachment-0001.html>


More information about the Cbc mailing list