Constrained and multi-objective optimization. Handle inequality constraints, equality constraints, and multiple competing objectives with 99.99% accuracy on standard benchmarks.
import thalosforge as tf
# G06 constrained benchmark
def objective(x):
return (x[0]-10)**3 + (x[1]-20)**3
# Inequality constraints: g(x) <= 0
def g1(x):
return -(x[0]-5)**2 - (x[1]-5)**2 + 100
def g2(x):
return (x[0]-6)**2 + (x[1]-5)**2 - 82.81
result = tf.optimize(
objective,
bounds=[(13,100), (0,100)],
method='kestrel',
constraints=[
{'type': 'ineq', 'fun': g1},
{'type': 'ineq', 'fun': g2},
]
)
# Result: -6961.82 (optimal: -6961.81)
Real-world problems have constraints. Kestrel handles them.
Handle g(x) ≤ 0 constraints using penalty methods or feasibility rules. Active constraint identification ensures solutions lie exactly on constraint boundaries.
Support for h(x) = 0 constraints through augmented Lagrangian methods. Satisfy exact requirements like budget totals or conservation laws.
Generate Pareto-optimal fronts for problems with competing objectives. Return a set of trade-off solutions, not just a single point.
Adaptive penalty factors that increase as optimization progresses. Start with soft constraints, end with strict feasibility enforcement.
Constrained tournament selection that prioritizes feasible solutions. Never return an infeasible solution even during early iterations.
Constraint specification matches SciPy's interface. Drop-in replacement for constrained minimize—just change the method name.
Validated on standard constrained optimization test problems
Minimize (x₁-10)³ + (x₂-20)³ subject to two nonlinear inequality constraints. Kestrel finds the global optimum at the constraint boundary.
30-dimensional bi-objective problem. Kestrel generates a diverse Pareto front covering the full trade-off surface between objectives.
Where constraints define the problem
Maximize returns subject to risk constraints, position limits, and budget requirements. Handle inequality bounds on individual holdings and equality constraints on total allocation.
Optimize structural weight while satisfying stress limits, deflection bounds, and manufacturing constraints. Find feasible designs that meet all specifications.
Distribute limited resources across projects with capacity constraints, minimum commitments, and budget ceilings. Satisfy all requirements while maximizing value.
Minimize logistics costs subject to demand fulfillment, warehouse capacity, and transportation limits. Find optimal flows through constrained networks.
Request a trial to test Kestrel Pro on your specific constrained optimization challenges. Our team can help you formulate constraints and validate solutions.