AGENT SKILL

logistics-constraint-programming-metaheuristics-and-bounds

Use when exact methods are not the right tool or you need to judge a solution: constraint programming and where it beats MIP, metaheuristics including simulated annealing, tabu search and genetic algorithms, local search and large neighbourhood search as the workhorses of practical routing, and bounds and solution quality — how to know how good an answer is rather than assuming.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 5
Forks
3

01 前言 Front Matter

name
logistics-constraint-programming-metaheuristics-and-bounds
description
Use when exact methods are not the right tool or you need to judge a solution: constraint programming and where it beats MIP, metaheuristics including simulated annealing, tabu search and genetic algorithms, local search and large neighbourhood search as the workhorses of practical routing, and bounds and solution quality — how to know how good an answer is rather than assuming.

03 SKILL.md 正文

Logistics and Optimization Software: Constraint Programming, Metaheuristics, Local Search, and Bounds

Part 2 of 5 of the Logistics and Optimization Software reference (plugin logistics-software-optimization), covering §6–§9. Sibling skills: logistics-why-projects-fail-complexity-and-modeling (§0–§5), logistics-routing-packing-scheduling-and-network-design (§10–§16), logistics-inventory-forecasting-operations-and-solvers (§17–§24), logistics-reference (§25–§31). Section numbers are shared across the set; a reference written as §N → skill points into that sibling skill.

Currency: The algorithms and complexity results are permanent. Two areas are live. See §25 → logistics-reference for the solver landscape and the quantum and AI optimization claims.

⚠️ Scope. For engineers building or integrating logistics systems. Complements a data-engineering reference (pipelines), an operations reference (process), and a business reference (unit economics).

⚠️ GOTCHA boxes mark things that sink projects or silently produce wrong answers.

The three ideas that organize this document:

  1. ⚠️ Optimization projects almost never fail on the algorithm. They fail on data quality, on constraints nobody told you about, and on solutions the drivers refuse to run (§1 → logistics-why-projects-fail-complexity-and-modeling). The maths is the easy part and it is not where your time goes.
  2. ⚠️ NP-hard does not mean unsolvable — it means no guaranteed-fast exact method. Real instances with tens of thousands of stops are solved to within a few percent of optimal every night by well-engineered heuristics (§2 → logistics-why-projects-fail-complexity-and-modeling, §8).
  3. ⚠️ A 2% better solution that operations won't execute is worth 0%. Stability, explainability and consistency with yesterday's plan routinely matter more than the objective value (§1 → logistics-why-projects-fail-complexity-and-modeling, §26 → logistics-reference).

§6. Constraint Programming

⚠️ A different paradigm, and often better than MIP for scheduling and sequencing. CP works by constraint propagation — domain filtering — plus search, rather than by LP relaxation. ⚠️ Where CP wins: scheduling with precedence and resource constraints, rostering, problems with complex logical conditions, and anything with rich global constraints (alldifferent, cumulative, noOverlap, element). ⚠️ CP-SAT in particular (OR-Tools) is exceptionally strong on scheduling and has largely displaced hand-rolled approaches for those problems. ⚠️ Where MIP wins: problems with strong linear structure, cost-driven objectives, and where you need good bounds. ⚠️ Modern CP-SAT solvers hybridize — they include SAT-style clause learning and LP relaxations — so the paradigm boundary is blurrier than it was.


§7. Metaheuristics

⚠️ When exact methods don't fit the time budget. All of them are variations on "search the neighbourhood, sometimes accept worse, escape local optima."

LOCAL SEARCH / HILL CLIMBING   ⚠️ the base. Gets stuck
SIMULATED ANNEALING            accept worse with decreasing probability
TABU SEARCH                    ⚠️ forbid recent moves to escape cycles.
                               Historically very strong on VRP
GENETIC / EVOLUTIONARY         ⚠️ popular, and frequently OUTPERFORMED by
                               simpler LNS on routing. Popularity ≠ performance
ANT COLONY, PARTICLE SWARM     ⚠️ heavily published, rarely the best choice
   in production. Be sceptical of the metaphor-driven literature here
GRASP, VNS, ⚠️ LNS/ALNS        §8 — the ones that actually win
HYPER-HEURISTICS               choose among heuristics adaptively

⚠️ GOTCHA — the metaheuristic literature has a serious novelty problem. ⚠️ A large body of published "novel" nature-inspired metaheuristics (harmony search, various animal algorithms) has been criticized as rebranding existing methods with new metaphors, and comparisons are frequently against weak baselines on synthetic instances. This is a well-documented critique within the OR community. ⚠️ For routing, start with LNS — it is the practical state of the art and it is simple.


§8. ⚠️ Local Search and Large Neighbourhood Search

⚠️ This is what actually powers production routing engines, and it's conceptually simple.

⚠️ LNS / ALNS (Adaptive LNS)
  1. Start from any feasible solution
  2. DESTROY — remove part of it (random stops, a geographic cluster,
     a whole route, the most "expensive" stops)
  3. REPAIR — reinsert greedily or with a small exact solve
  4. Accept or reject; ⚠️ ADAPT the weights on destroy/repair operators
     based on which have been working
  5. Repeat until the time budget is gone

⚠️ Why it wins in practice:

  • ⚠️ It handles arbitrary messy constraints. The repair step just has to respect them; you never need a clean mathematical formulation of every business rule.
  • ⚠️ It's anytime. Stop whenever; you have a valid solution. This matches operational reality where you have 20 minutes, not "until optimal."
  • ⚠️ It warm-starts naturally, which is exactly what you need for §1 → logistics-why-projects-fail-complexity-and-modeling's stability requirement and for §23 → logistics-inventory-forecasting-operations-and-solvers's dynamic re-optimization.
  • It parallelizes reasonably.

⚠️ Classic VRP local search moves worth knowing: 2-opt and Or-opt (within a route), relocate and swap (between routes), 2-opt (cross-route tail exchange), and ⚠️ ejection chains.* Combined with LNS these cover most of what commercial engines do.


§9. Bounds and Solution Quality

⚠️ GOTCHA — without a bound you have no idea whether your heuristic is 2% or 40% from optimal, and "it produced a solution" tells you nothing. ⚠️ This is the single most common gap in home-grown optimizers.

⚠️ How to get a bound: the LP relaxation; a Lagrangian relaxation; a simplified problem (e.g. the assignment relaxation of a TSP); or a column-generation lower bound. ⚠️ Even a crude bound is transformative — it converts "the heuristic ran" into "we are within X%," which is the number that justifies further investment or closes the project. ⚠️ Benchmark against standard instance libraries: TSPLIB, CVRPLIB / Solomon and Gehring-Homberger for VRPTW, MIPLIB for MIP. ⚠️ And benchmark against the HUMAN baseline too, because that's the actual decision.


PART II — THE CORE PROBLEM FAMILY

04 同仓库更多 Skills

the-vibey-project
the-vibey-project/vibey

white-paper-writing

Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks "how should I structure this" for a long-form document.

★ 5
the-vibey-project
the-vibey-project/vibey

prose-technical-mechanics

Use when editing or writing prose at a technical/mechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.

★ 5
the-vibey-project
the-vibey-project/vibey

prose-mechanics

Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate/Jamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix "AI-sounding" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.

★ 5
the-vibey-project
the-vibey-project/vibey

narrative-structure

Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or "how should I structure this story/pitch/presentation" request.

★ 5
the-vibey-project
the-vibey-project/vibey

legal-brief-writing

Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic/neurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.

★ 5
the-vibey-project
the-vibey-project/vibey

journal-publishability-criteria

Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs/paper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.

★ 5