Skip to content

Instantly share code, notes, and snippets.

@joshua-taylor
Created May 27, 2021 12:23
Show Gist options
  • Save joshua-taylor/06cdbf73d27529f22e767a2cdbaa445e to your computer and use it in GitHub Desktop.
Save joshua-taylor/06cdbf73d27529f22e767a2cdbaa445e to your computer and use it in GitHub Desktop.
constraint = LinearConstraint(np.ones(n_suppliers),lb=requiredOrder,ub=1000)
bnds = [(0,None) for i in range(n_suppliers)]
minimizer_kwargs = {"method": "SLSQP",
"bounds":bnds,
"constraints": constraint,
}
res=basinhopping(func,
[200,200,200],
stepsize=500,
niter=100,
minimizer_kwargs=minimizer_kwargs,
)
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment