Problems Identified:
- Dead drone bug - drones removed permanently after first failure
- Broken 2-opt - had
if Falsedead code - No NFZ detour routing - only waiting
- Small search space - K=8 candidates only
- No caching - repeated expensive calculations
Changes:
- ✅ Fixed dead drone removal logic
- ✅ Corrected 2-opt edge calculations
- ✅ Added segment_nfz caching
- ✅ Implemented reachability filtering
Impact: +1.28 points (3.2% improvement)
Changes:
- ✅ Added perpendicular waypoint detours for circles
- ✅ Implemented corner bypass for rectangles
- ✅ Dynamic wait vs detour decision making
Impact: +0.65 points (1.6% improvement)
Changes:
- ✅ Expanded candidate pool K=8 → K=12
- ✅ Added Or-opt local search
- ✅ Implemented compute_wait caching
- ✅ Multiple ordering heuristics
Impact: +0.52 points (1.3% improvement)
| Test Case | Before | After | Speedup |
|---|---|---|---|
| Small (5 deliveries) | 50ms | 15ms | 3.3× |
| Medium (20 deliveries) | 800ms | 120ms | 6.7× |
| Large (80 deliveries) | 17s | 400ms | 42.5× |
| Test Case | Before | After | Improvement |
|---|---|---|---|
| Small | 4/5 (80%) | 5/5 (100%) | +20% |
| Medium | 12/20 (60%) | 15/20 (75%) | +25% |
| Large | 32/80 (40%) | 36/80 (45%) | +12.5% |
-
Greedy Scheduling: Pick earliest drone → plan trip → repeat
- No global coordination
- No look-ahead
- Suboptimal drone assignment
-
Local Search Only: 2-opt and Or-opt are local moves
- Can't escape local optima
- No diversification strategy
- Limited exploration
-
Simple NFZ Handling: Only 1-waypoint detours
- Misses complex multi-waypoint paths
- No time-space A* pathfinding
- Doesn't optimize detour timing
-
No Metaheuristics: Missing the big guns
- No simulated annealing
- No tabu search
- No large neighborhood search
- No genetic algorithms
while time_remaining:
# Destroy 20-30% of current solution
removed = destroy_routes(solution, destruction_rate=0.25)
# Rebuild with regret insertion
new_solution = repair_routes(removed, regret_heuristic)
# Accept if better (or with probability if SA)
if score(new_solution) > score(solution):
solution = new_solutiontemperature = initial_temp
while temperature > min_temp:
neighbor = perturb(current_solution)
delta = score(neighbor) - score(current_solution)
if delta > 0 or random() < exp(delta / temperature):
current_solution = neighbor
temperature *= cooling_ratebeam = [initial_solution]
while unassigned_deliveries:
candidates = []
for solution in beam:
for delivery in unassigned:
candidates.append(insert(solution, delivery))
# Keep top-K candidates
beam = sorted(candidates, key=score)[:beam_width]def astar_with_nfz(start, goal, start_time):
# State: (position, time)
# Cost: distance + time_penalty
# Heuristic: straight-line distance
open_set = [(0, start, start_time)]
while open_set:
cost, pos, time = heappop(open_set)
if pos == goal:
return reconstruct_path()
for neighbor in get_neighbors(pos):
if not in_nfz(neighbor, time + dist(pos, neighbor)):
heappush(open_set, ...)Theory: Deliver heavy packages early to reduce energy Reality: Deadline constraints dominate; heavy packages often far away Impact: -0.3 points
Theory: Choose charging stations strategically Reality: Most trips don't need charging; overhead not worth it Impact: No change
Theory: Prioritize urgent deliveries Reality: Already handled by deadline sorting Impact: +0.1 points (negligible)
One failed delivery (-100 points) equals:
- 1000 units of distance
- 2000 time units of makespan
Lesson: Maximize deliveries at all costs. Energy/time optimization is secondary.
On maps with long NFZ windows (T_end - T_start > 500):
- Waiting can add 300-500 time units per trip
- Detours often save 200-400 time units
- 1-waypoint detours cover 80% of cases
Lesson: Always try detours before waiting.
The dead drone bug caused:
- 50+ undelivered packages
- 5000+ point loss
- Drones sitting idle while deliveries failed
Lesson: Never permanently disable resources. Always retry.
Without caching:
- compute_wait() called 10,000+ times
- segment_nfz() recalculated repeatedly
- 17s runtime → timeout on large cases
Lesson: Memoize expensive geometry calculations.
After 2-opt + Or-opt:
- 95% of moves don't improve score
- Stuck in local optimum
- Need global perturbations
Lesson: Local search alone can't reach elite scores.
- Implement LNS with adaptive destroy/repair
- Add simulated annealing acceptance
- Multi-start with randomization
- Visibility graph construction
- Time-space A* pathfinding
- Multi-waypoint optimization
- Beam search for scheduling
- Column generation for assignment
- Parallel drone coordination
- Adaptive time budgeting
- Elite solution pool
- Hybrid metaheuristics
The journey from 39.57 → 42.02 taught me:
- Bugs are expensive - One line of code = 500 points
- Local ≠ Global - Greedy algorithms plateau fast
- Domain knowledge matters - NFZ geometry optimization is crucial
- Caching is critical - 42× speedup from memoization
- Elite level is different - Need metaheuristics, not just better heuristics
The gap to 90-100 isn't about coding better - it's about thinking differently. Elite contestants use fundamentally different search strategies that I haven't implemented yet.
This problem humbled me, and I learned more from the struggle than I would have from easy success.
Last Updated: May 26, 2026