lovasoa/highs-js

Simple QP with Hessian that isn't positive semidefinite produces non-error output in demo

fuglede opened this issue · 3 comments

Consider the following problem:

Maximize
 obj: [x1^2]/2
Bounds
 0 <= x1 <= 40
End

If I put this into the HiGHS CLI, I get the following output

$ highs qp.lp
Running HiGHS 1.2.2 [date: 2022-05-04, git hash: d1d9839b]
Copyright (c) 2022 ERGO-Code under MIT licence terms
ERROR:   Hessian has 1 diagonal entries in (0, 1] so is not negative semidefinite
Error loading file

but the online demo of highs-js gives the following output:

{
  "Status": "Optimal",
  "Columns": {
    "undefined": {
      "Index": 0,
      "Status": "0",
      "Lower": 40,
      "Upper": 0,
      "Primal": 0,
      "Dual": null
    }
  },
  "Rows": [],
  "IsLinear": true
}

If I change "Maximize" to "Minimize", HiGHS can solve it, but highs-js still gives "IsLinear": true which seems strange.

HiGHS certainly won't solve this problem with maximize since it's non-convex. A clearer message should be given, and Error loading file is incorrect. The file's read OK, but it corresponds to a problem that HiGHS cannot solve.

@jajhall And just to be clear, HiGHS failing is nice and expected. What's unexpected is that the highs-js demo still goes through with no error here.

Edit: It also fails on QPs in general, it seems, so the more appropriate feature request here is probably just "support QPs in highs-js".

I went through and debugged what's going on here. As it turns out, HiGHS itself does indeed produce a meaningful result even when it shouldn't, but that's a problem that has been resolved in one of the more recent versions of HiGHS, so I've added a PR (#15) which updates the version of HiGHS, as well as some of the parsing machinery required to support QPs in highs-js.