View Issue Details

IDProjectCategoryView StatusLast Update
0000453HeurekaOptimizationpublic2021-11-29 10:36
ReporterPeder Assigned ToLinus  
PriorityurgentSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.17.7 
Fixed in Version2.18.0 
Summary0000453: False message that feasible solution is not found when solving optimization problem with SCIP
DescriptionSCIP version: latest (7.03)
Output from SCIP in "SCIPSoplex" output pane:
SCIP Status : problem is solved [optimal solution found]
Total Time : 133.00
  solving : 130.00
  presolving : 51.00 (included in solving)
  reading : 3.00
  copying : 0.00 (0 times copied the problem)
Original Problem :
  Problem name : D:\Users\nnn\Documents\Heureka\Projects\PlanWise\xxxxx\ModelsTemp\TempOptFile.lp (xxxx contains 'รค')

However, Heureka returns message that no feasible solution is found and user is not offered the possibility to save the solution.
TagsNo tags attached.
ProductPlanWise

Activities

Peder

2021-11-13 10:49

administrator   ~0000433

Last edited: 2021-11-14 16:34

Looked at the code and the solver status codes are not handled correctly. Proposal (could not find SCIP status codes right now, please check them on SCIP:s homepage.
See Code change proposal in branch SCIP_Update



...
 SolverResult result = new SolverResult(Name, isSolutionFeasible(), getSolverStatusCode() );
..

Method isSolutionFeasible() currently returns "feasible" for any solution! Change to something like this:
 
 private bool isSolutionFeasible()
        {
            string status = _status.ToLower();

            return (
                status.Contains("optimal solution found") ||
                status.Contains("problem is solved"));
        }

--SolverStatus code was never set to other than undefined! Try this instead:
private SolverStatus getSolverStatusCode()
        {
            string status = _status.ToLower();
            if (status.Contains("optimal solution found"))
            {
                return SolverStatus.Optimal;
            }
            if (status == "infeasible")
            {
                return SolverStatus.Infeasible;
            }
            if (status.Contains("gap limit reached"))
            {
                return SolverStatus.Optimal;
            }
            if (status.Contains("solution limit reached"))
            {
                return SolverStatus.Suboptimal;
            }
            if (status.Contains("unknown"))
            {
                return SolverStatus.Undefined;
            }
            if (status.Contains("interrupted"))
            {
                return SolverStatus.Aborted;
            }
            if (status.Contains("time limit reached"))
            {
                return SolverStatus.Timeout;
            }

            return SolverStatus.Undefined;

Also replace case-switch in proc_OutputDataReceived with the following if-block (accept special case of "optimal solution found")

if (_currentSection == "solve problem")
            {
                if (currentRow.StartsWith("SCIP Status"))
                {
                    // Status is presented something like this: "SCIP Status: problem is solved [optimal solution found]"
                    int firstBracket = currentRow.IndexOf('[');
                    int secondBracket = currentRow.IndexOf(']');

                    if (firstBracket < 0 || firstBracket >= currentRow.Length || secondBracket < 0 ||
                        secondBracket >= currentRow.Length)
                        return;

                    _status = currentRow.Substring(firstBracket + 1, secondBracket - firstBracket - 1);
                }
            }
            else if (_currentSection == "primal solution:" ||
                     _currentSection == "primal solution (original space):")
            {
                ....

Linus

2021-11-29 09:49

administrator   ~0000438

Now correctly parses the solver result from output of SCIP solver. Fixed by Peder

Issue History

Date Modified Username Field Change
2021-11-13 10:01 Peder New Issue
2021-11-13 10:49 Peder Note Added: 0000433
2021-11-13 10:50 Peder Note Edited: 0000433
2021-11-14 16:32 Peder Note Edited: 0000433
2021-11-14 16:34 Peder Note Edited: 0000433
2021-11-14 16:34 Peder Note Edited: 0000433
2021-11-29 09:49 Linus Assigned To => Linus
2021-11-29 09:49 Linus Status new => resolved
2021-11-29 09:49 Linus Resolution open => fixed
2021-11-29 09:49 Linus Fixed in Version => 2.18.0
2021-11-29 09:49 Linus Note Added: 0000438
2021-11-29 10:36 Linus Changeset attached => heureka trunk r21039