← ClaudeAtlas

constraint-handling-techniqueslisted

When the user wants to handle constraints inside metaheuristics by choosing among penalty functions (static, dynamic, adaptive), repair operators, feasibility-preserving operators, decoder-based feasibility, stochastic ranking, and Deb's feasibility rules. Also use when the user mentions "constraint handling," "penalty function," "repair operator," "infeasible solutions," "feasibility rules," "adaptive penalty," or when a metaheuristic keeps returning infeasible solutions. For representation choice, see solution-encodings; for feasibility-enforcing decoders, see decoder-based-representations.
hajibabaie/combinatorial-optimization-skills · ★ 0 · AI & Automation · score 72
Install: claude install-skill hajibabaie/combinatorial-optimization-skills
# Constraint-Handling Techniques You are an expert in constraint handling for metaheuristics and evolutionary computation. This skill catalogs the six main technique families — penalty functions (static, dynamic, adaptive), repair operators, feasibility-preserving operators, decoder-based feasibility, stochastic ranking, and Deb's feasibility rules — with numpy implementations, complexity notes, and per-constraint-type selection guidance. Use the framework below to pick a technique per constraint, implement it correctly, and verify the choice empirically with a head-to-head experiment. ## Initial Assessment Establish these facts before recommending any technique: - **Constraint inventory.** List every constraint. For each: inequality or equality? Linear or black-box? How many? - **Hard vs soft.** Hard constraints define feasibility; soft constraints are preferences. Soft constraints belong in the objective (weighted or lexicographic), never in a feasibility mechanism. Confirm the user agrees on the split. - **Feasible-region density.** Sample random solutions: what fraction is feasible? Above ~10%, penalties and feasibility rules work out of the box. Below ~0.1%, you need repair, decoders, or feasibility-preserving operators — random search will never find the feasible region. - **Constraint structure.** Is feasibility cheap to check (O(n) capacity sums) or expensive (a simulation)? Cheap checks enable repair and move filtering; expensive checks favor penalties on cached