Skip to content

Commit 878b161

Browse files
committed
Fix number of shares so minimize can be solved
With 1000 shares, the solution does not exist. n_shares = 15 matches the article.
1 parent 7fada02 commit 878b161

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-scipy-cluster-optimize/minimize_constrained.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from scipy.optimize import minimize, LinearConstraint
33

44
n_buyers = 10
5-
n_shares = 1000
5+
n_shares = 15
66
np.random.seed(10)
77
prices = np.random.random(n_buyers)
88
money_available = np.random.randint(1, 4, n_buyers)

0 commit comments

Comments
 (0)