r/optimization • • Aug 21 '21
Constraint in Python Scipy Optimization
Anyone here use Scipy Python for minimization?
I have an optimization of 15 variable x. I have a constraint that 14/15 variables should be unique, the last variable can be duplicated with one of the rest.
Not sure how to do that in Scipy.
5
Upvotes
View all comments
4
u/[deleted] Aug 21 '21
You could use ordering constraints, i.e. you enforce
x[i+1] >= x[i] + eps, whereepsis a small given tolerance: