Artificial Intelligence · FIB-UPC
Desastres IA
Local search on a disaster-relief model: helicopters rescue groups at centers in an optimized order. Compare hill climbing vs simulated annealing — runs entirely in your browser.
Local Search
AIMA · Java + Python📋
State
Ordered queue of groups per helicopter
🔀
SWAP
Exchange two groups across positions
📊
Score
H2 = sum of all helicopter finish times
🔍
Search
HC climbs · SA explores with random jumps
Problem schematic
Helicopters leave bases and serve centers in an optimized order. Groups have sizes and priorities. Capacity: 15 people per trip, 10 min cooldown between sorties.
Heuristic functions
H1
Mix of makespan (max heli time) and total time, weighted to spread load
H2used in demo
Minimize sum of all helicopter completion times
H3
H1 + penalty for priority groups rescued late (urgency-aware)
Successor operators
SWAPGENERALREDUCIDOSWAP + GENERALSWAP + REDUCIDOStochastic
6 successor functions in Java (DesastresSuccessorFunction1–6). Demo uses SWAP. Hover for details.
⚡
Run the demo
HC / SA · 7 groups · 3 helicopters · runs in browser
How it works: Random 2D layout (seeded) with 2 bases and 7 groups. Colors = owning helicopter. HC picks the best SWAP neighbor until stuck; SA sometimes accepts worse moves to escape local minima.