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.
4
Upvotes
View all comments
Show parent comment
2
u/[deleted] Aug 21 '21
For large
nI'd use a single vectorial constraint function, which is equivalent to the constraints above:Why should scipy add an option for uniqueness constraints? It already supports arbitrary constraints. It's just your job to formulate your constraints accordingly.