Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: SIMPLEX_STRATEGY_PRIMAL strategy fails #348

Closed
mckib2 opened this issue May 5, 2020 · 5 comments
Closed

BUG: SIMPLEX_STRATEGY_PRIMAL strategy fails #348

mckib2 opened this issue May 5, 2020 · 5 comments

Comments

@mckib2
Copy link
Contributor

mckib2 commented May 5, 2020

The following problem is solved correctly by all other simplex strategies except SIMPLEX_STRATEGY_PRIMAL:

import numpy as np
np.random.seed(0)
m_eq, m_ub, n = 10, 20, 50
c = np.random.rand(n)-0.5
A_ub = np.random.rand(m_ub, n)-0.5
b_ub = np.random.rand(m_ub)-0.5
A_eq = np.random.rand(m_eq, n)-0.5
b_eq = np.random.rand(m_eq)-0.5
lb = -np.random.rand(n)
ub = np.random.rand(n)
lb[lb<-np.random.rand()] = -np.inf
ub[ub>np.random.rand()] = np.inf

or the following MPS file:
simplex_primal_test.txt

The following options were used:

solver = simplex
simplex_strategy = 4
presolve = on # or off, both fail

The HiGHS call was run as follows:

./highs --options_file=opt simplex_primal_test.mps

The following simplex strategies were able to achieve optimal solution:

  SIMPLEX_STRATEGY_MIN,
  SIMPLEX_STRATEGY_DUAL,
  SIMPLEX_STRATEGY_DUAL_TASKS,
  SIMPLEX_STRATEGY_DUAL_MULTI,

I will also note that the simplex_strategy SIMPLEX_STRATEGY_NUM raises the following warning:

WARNING: checkOptionValue: Value 5 for option "simplex_strategy" is above upper bound of 4
Solving
@jajhall
Copy link
Sponsor Member

jajhall commented May 5, 2020

The primal simplex solver is WIP. Qi wrote it last summer, and I know that there are bugs in it. Please don't invite folk to use it via your wrapper. Once again, we don't have a mechanism for preventing users from setting option values that we need to use for development.

I note the example - which is from issue #280 - and will use it in debugging the primal simplex solver

@jajhall
Copy link
Sponsor Member

jajhall commented May 5, 2020

Actually, I've just tried to solve the LP given by the MPS file and, whether or not presolve is used, HiGHS returns the correct solution. This is regardless of the simplex options that's chosen - quite simply because no simplex solver needs to be used as the initial point is optimal.

Could you generate one of the random problems and send post it as an MPS file. I don't understand your use of the random function well enough to generate them myself. Thanks

@mckib2
Copy link
Contributor Author

mckib2 commented May 5, 2020

I will make a note to avoid using this option in production.

This shouldn't be the same example as in #280, I've made a mistake in uploading the incorrect file.

This should be the correct MPS file:
simplex_primal_test.txt

@jajhall
Copy link
Sponsor Member

jajhall commented May 5, 2020

I'm now reproducing the bug with this MPS file, thanks.

@mckib2
Copy link
Contributor Author

mckib2 commented Dec 19, 2021

This is no longer failing on current master, will close

@mckib2 mckib2 closed this as completed Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants