feat: Implement Pareto-front ranking integration with multi-criteria sorting

- Add RankingMode field to SearchOptions (fastest/fewest_transfers/cheapest)
- Update FindRoutesPareto to respect ranking mode when sorting
- Add ranking_mode query parameter to RouteSearch endpoint
- Add TestParetoFrontGeneration with subtests for all three modes

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-16 19:27:02 +03:00
parent 026b779cb3
commit d67bc5aca7
4 changed files with 226 additions and 20 deletions

View File

@@ -173,6 +173,9 @@ func RouteSearch(hc *HandlerContext, w http.ResponseWriter, r *http.Request) {
return
}
// Read ranking mode from query parameters (for UI controls)
rankingMode := r.URL.Query().Get("ranking_mode")
// Build query parameters for route search
// Use city codes as origin/destination identifiers
// In a full implementation, this would use Yandex /search, but for now
@@ -181,6 +184,8 @@ func RouteSearch(hc *HandlerContext, w http.ResponseWriter, r *http.Request) {
// Create search options with default max transfers
opts := routing.SearchOptions{
MaxTransfers: 5,
// Set ranking mode from UI query parameter if provided
RankingMode: rankingMode,
}
// Run Pareto-optimal route search using the graph