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

FIX: linprog_simplex: Fix bug in Phase 1 #727

Merged
merged 2 commits into from
Mar 14, 2024
Merged

FIX: linprog_simplex: Fix bug in Phase 1 #727

merged 2 commits into from
Mar 14, 2024

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Mar 12, 2024

Fix #725

Simplified instance:

c = np.array([-1,  1])
A_ub = np.array([[-2, -1], [1, 1]])
b_ub = np.array([-2, 1])
linprog_simplex(c=c, A_ub=A_ub, b_ub=b_ub)

Pre-bugfix version:

SimplexResult(x=array([0., 1.]), lambd=array([0., 1.]), fun=1.0, success=True, status=0, num_iter=4)

This bugfix version:

SimplexResult(x=array([ 1., -0.]), lambd=array([2., 3.]), fun=-1.0, success=True, status=0, num_iter=4)

Instances reported in #725:

c = np.array([-392.62555556, 1260.73744444])
A_ub = np.array([[1, 0.1], [-1, -0.1], [1, 1]])
b_ub = np.array([10,-10,10])
linprog_simplex(c=c, A_ub=A_ub, b_ub=b_ub)
SimplexResult(x=array([10., -0.]), lambd=array([   0.        , 1837.07      , 1444.44444444]), fun=-3926.2555556, success=True, status=0, num_iter=5)
c = np.array([-4.09555556,  4.59044444])
A_ub = np.array([[1, 0.1], [-1, -0.1], [1, 1]])
b_ub = np.array([9.1,-0.1,0.1])
linprog_simplex(c=c, A_ub=A_ub, b_ub=b_ub)
SimplexResult(x=array([ 0.1, -0. ]), lambd=array([0.        , 9.65111111, 5.55555555]), fun=-0.40955555600000004, success=True, status=0, num_iter=5)

@oyamad oyamad added bug ready and removed ready labels Mar 12, 2024
@coveralls
Copy link

Coverage Status

coverage: 93.041% (+0.009%) from 93.032%
when pulling 85ca2a1 on fix-linprog
into d7c2f52 on main.

@oyamad oyamad added the ready label Mar 12, 2024
@oyamad oyamad merged commit 0adb3ec into main Mar 14, 2024
10 checks passed
@oyamad oyamad deleted the fix-linprog branch March 14, 2024 01:41
@oyamad oyamad restored the fix-linprog branch March 14, 2024 01:41
@oyamad oyamad deleted the fix-linprog branch March 14, 2024 01:41
@oyamad
Copy link
Member Author

oyamad commented Mar 14, 2024

@mmcky It would be great if you could make a new release when you have time.. Thanks!

@mmcky
Copy link
Contributor

mmcky commented Mar 14, 2024

thanks @oyamad -- will look at this now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linprog incorrect answer
3 participants