Bug 93961 - Solver solution improper
Summary: Solver solution improper
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-06 03:09 UTC by bill.mceachen
Modified: 2015-10-26 06:19 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
calc file withe the solver setup (12.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-09-06 03:09 UTC, bill.mceachen
Details
Solver setup screen 1 of 3 (26.94 KB, image/png)
2015-09-06 12:45 UTC, bill.mceachen
Details
Solver setup screen 2 of 3 (31.37 KB, image/png)
2015-09-06 12:46 UTC, bill.mceachen
Details
Solver setup screen 3 of 3 (18.22 KB, image/png)
2015-09-06 12:47 UTC, bill.mceachen
Details
option LinearSolver output (21.66 KB, image/png)
2015-09-06 12:48 UTC, bill.mceachen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bill.mceachen 2015-09-06 03:09:03 UTC
Created attachment 118451 [details]
calc file withe the solver setup

I happened to be using Solver then updated to ver 5.0.1.2
I noticed a new option (Libre CoinMP etc).
I run a scenario and SCO solves it.
It appears Libre CoinMP prematurely returns a solution that is not correct.
I attach the file.  Hopefully the solver settings all are included.
CoinMP returns 35000 (immediately, maybe from initial values?)
SCO properly returns 377396.
For whatever reason, the other Libre Linear option complains and doesn't even proceed (also in my earlier 4.2 version I think)
The solver setup essentially is iterating integer 4 values constrained as
100<=A<=115, 200<=B<=215, 300<=C<=315, 400<=D<=415

the objective is to get (multiplication implied)
AB+AC+AD+BC+BD+CD = 377396

There are multiple solutions I believe

I am using Windows 10 64-bit, no idea what CPU.
Comment 1 Jean-Baptiste Faure 2015-09-06 07:10:56 UTC
If I understand correctly your optimization problem is not linear and CoinMP  solver is for linear problems only.

I do not see any solver configuration in your test file. Please describe exhaustively and step by step how you launch the solver on your data.

Set version to the value given in the problem description.

Best regards. JBF
Comment 2 bill.mceachen 2015-09-06 12:45:54 UTC
Created attachment 118463 [details]
Solver setup screen 1 of 3
Comment 3 bill.mceachen 2015-09-06 12:46:37 UTC
Created attachment 118464 [details]
Solver setup screen 2 of 3
Comment 4 bill.mceachen 2015-09-06 12:47:26 UTC
Created attachment 118465 [details]
Solver setup screen 3 of 3
Comment 5 bill.mceachen 2015-09-06 12:48:07 UTC
Created attachment 118466 [details]
option LinearSolver output
Comment 6 bill.mceachen 2015-09-06 12:54:58 UTC
(In reply to Jean-Baptiste Faure from comment #1)
ok, a couple of things.  The Solver info was missing because saving it as a new filename seemed to wipe it out (?).  
Anyway, if it is allowed, I will attach screenshots, though as you can see I need to use multiple - there's room to have listed all of my constraints in the window, that would be a clear suggestion for improvement.

As far as CoinMP not being applicable to the problem, that's fine, though surprising - so 3 of the 4 options can work only, it would be nice if the 4th was greyed out then.
Plus, it should not return any result, which can mislead a user that a proper results was found !

I will list cell contents here as well.

Target cell  $A$1
$A$1  =$A$2*$B$2+$A$2*$C$2+$A$2*$D$2+$B$2*$C$2+$B$2*$D$2+$C$2*$D$2
optimize to value=374223
by changing cells  $a$2:$d$2
Limiting Conditions
$A$2 integer
$A$2 <=115
$A$2>=100
$B$2 integer
$B$2 <=215
$B$2>=200
$C$2 integer
$C$2 <=315
$C$2>=300
$D$2 integer
$D$2 <=415
$D$2>=400

Results by option:
(I always checked options for non-neg and/or integer as applicable )

DEPS  113,203,302,414
SCO  102,214,313,403
LinearSolver  - fails to run, complains setup/constraints improper
CoinMP - immed returns a bad result

I always try to reinforce that I am appreciative of the software,
but hope feedback from a real-world user can be of use ...

Thanks
Comment 7 Jean-Baptiste Faure 2015-10-26 06:19:23 UTC
Thank you for the complementary data. Both SCO and and DEPS find a solution, but they are different.
There is no bug here, it is up to you to choose a optimization algorithm adapted to your problem. Until a solver try to solve your problem, it can't say if it will find a solution. And even if an optimization algorithm find something, it is up to you to check if it is really a solution.

Closing as NotABug.
Best regards. JBF