-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.optimize
Milestone
Description
Describe your issue.
Hi,
According to the docs, integrality constraints for linear programming are supplied as a one-dimensions array containing an integer. However, apparently they are not always fulfilled, even when terminated successfully.
Thanks for the help.
Reproducing Code Example
import numpy as np
import scipy.optimize as spo
np.random.seed(10)
A = np.random.rand(10,10)
b, c = np.random.rand(10), np.random.rand(10)
spo.linprog(-c, A, b, integrality=np.array([1,], dtype="int"), method="highs")
Result
con: array([], dtype=float64)
crossover_nit: -1
eqlin: marginals: array([], dtype=float64)
residual: array([], dtype=float64)
fun: -0.03742097937820781
ineqlin: marginals: array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
residual: array([0.57099249, 0.8151632 , 0.04062182, 0.46254971, 0.76819817,
0.68370398, 0.57205104, 0. , 0.327102 , 0.54974553])
lower: marginals: array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
residual: array([ 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0.04224411, -0. ])
message: 'Optimization terminated successfully. (HiGHS Status 7: Optimal)'
nit: -1
slack: array([0.57099249, 0.8151632 , 0.04062182, 0.46254971, 0.76819817,
0.68370398, 0.57205104, 0. , 0.327102 , 0.54974553])
status: 0
success: True
upper: marginals: array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
residual: array([inf, inf, inf, inf, inf, inf, inf, inf, inf, inf])
x: array([ 0. , 0. , 0. , 0. , 0. ,
0. , 0. , 0. , 0.04224411, -0. ])
SciPy/NumPy/Python version information
1.9.1 1.22.4 sys.version_info(major=3, minor=9, micro=2, releaselevel='final', serial=0)
Metadata
Metadata
Assignees
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.optimize