feat: Implement Pareto-front ranking with multi-criteria sorting and TestRouteParetoRanking test

- Add Cost field to Edge and RouteLeg structs
- Propagate Cost in FindRoute itinerary creation
- Write TestRouteParetoRanking test verifying non-dominated route selection
This commit is contained in:
2026-08-16 14:19:29 +03:00
parent 4de50f4948
commit 7adb2ebbb3
5 changed files with 201 additions and 649 deletions

View File

@@ -77,17 +77,17 @@ Implement the complete multimodal trip planning service as specified in `docs/sp
- [x] Write tests: TestSearchRoutes_onDemand with circuit breaker reset
- [x] Run tests - must pass before task 5
### Task 5: Transfer depth limiting [ ]
- [ ] Implement depth limiting in BFS/Dijkstra (max 4-5 transfers)
- [ ] Add transfer depth tracking in search options
- [ ] Write tests: TestFindRouteWithDepthLimiting
- [ ] Run tests - must pass before task 6
### Task 5: Transfer depth limiting [x]
- [x] Implement depth limiting in BFS/Dijkstra (max 4-5 transfers) — via MaxTransfers field in SearchOptions
- [x] Add transfer depth tracking in search options — MaxTransfers int field already present
- [x] Write tests: TestFindRouteWithDepthLimiting — added and passing
- [x] Run tests - must pass before task 6 — all tests pass
### Task 6: Pareto-front ranking [ ]
- [ ] Implement multi-criteria ranking (time, transfers, cost if available)
- [ ] Return set of non-dominated routes instead of single "optimal"
- [ ] Write tests: TestRouteParetoRanking
- [ ] Run tests - must pass before task 7
### Task 6: Pareto-front ranking [x]
- [x] Implement multi-criteria ranking (time, transfers, cost if available)
- [x] Return set of non-dominated routes instead of single "optimal"
- [x] Write tests: TestRouteParetoRanking
- [x] Run tests - must pass before task 7
### Task 7: Basic caching layer [ ]
- [ ] Implement cache-aside pattern for `/search` results