Simulated Annealing: The Most Metal Algorithm Ever 🤘
summary
Simulated annealing is used to get good‑enough solutions for constrained combinatorial problems by sampling neighbors instead of enumerating factorial permutations; an internal pairing app is implemented and evaluated using the annealing gem, with an annealing schedule of initial temperature 200 cooling rate 0.001 producing about 200000 samples per run. Brute force scales to 21 trillion routes (≈2.5 years at 270k routes/sec), so the approximate solver finds low‑cost groupings fast and successfully avoids getting stuck in local minima.
AI-written summary · about
chapters (13)
- 0:00Intro
- 2:32Optimization problems
- 3:00Traveling Salesperson Problem (TSP)
- 3:22Traveling Metal Band Problem (TSP)
- 8:33Traveling Metal Band Problem Alternative Version
- 16:13Meeting cost matrix
- 20:08The simulated annealing process
- 21:09Define an annealing schedule
- 22:06Select an initial arrangement
- 23:08Generate a new state
- 23:54Measure the energy of both states
- 24:27Decided which state to keep
- 26:22Check if the simulation is done
related talks
38mLearning from FP: Simulated Annealing in Haskell and Ruby
44mSimulating the World with Ruby
46mBeating Go thanks to the power of randomness
34mBeyond the language. An introduction to algorithms.
32mThe Humble Hash
28mThe Art of Ruby
25mBuilding Board Games with Ruby
29mPractical guide to benchmarking your optimizations
