Summary
Bring VRP under the gRPC field_registry codegen so cpp/src/grpc/cuopt_routing.proto and the proto ↔ cpu_routing_problem_t conversion are generated (like the math-opt LP/MIP protos), replacing the hand-authored proto and the ~377-line hand-written cpp/src/grpc/grpc_routing_problem_mapper.cpp.
Follow-up to #1597, where this was intentionally deferred to keep that PR focused/landable (see thread).
Scope
- Model the routing messages in
field_registry.yaml: RoutingProblem, RoutingSolverSettings, RoutingSolution, and sub-messages (CostMatrix, CapacityDimension, VehicleBreak/PerVehicleBreaks/UniformBreakDimension, MatchEntry, PrecedenceEntry, ServiceTimeEntry, RoutingObjectiveFunction, InitialSolution).
- Generate
cuopt_routing.proto from the registry and delete the hand-authored file.
- Generate the proto ↔
cpu_routing_problem_t conversion and delete grpc_routing_problem_mapper.cpp.
- Extend
ci/verify_grpc_codegen.sh coverage to the routing proto/mapper.
Known blockers / considerations
- The routing sub-messages fit the existing
repeated_messages mechanism (cf. quadratic_constraints in field_registry.yaml).
- No proto3
map<> support in generate_conversions.py yet — RoutingSolution.objective_values is map<int32, double>. Either add map support to the generator or model it as parallel repeated key/value arrays.
- The current mapper has bespoke logic that doesn't fully fit the array-id chunked model: cost-matrix grouping by
vehicle_type, capacity dimensions (name + demand + capacity), per-vehicle service times (vehicle_id = -1 default), PDP pickup/delivery indices, breaks, vehicle/order matching, precedence, and initial solutions.
🤖 Generated with Claude Code
Summary
Bring VRP under the gRPC
field_registrycodegen socpp/src/grpc/cuopt_routing.protoand the proto ↔cpu_routing_problem_tconversion are generated (like the math-opt LP/MIP protos), replacing the hand-authored proto and the ~377-line hand-writtencpp/src/grpc/grpc_routing_problem_mapper.cpp.Follow-up to #1597, where this was intentionally deferred to keep that PR focused/landable (see thread).
Scope
field_registry.yaml:RoutingProblem,RoutingSolverSettings,RoutingSolution, and sub-messages (CostMatrix,CapacityDimension,VehicleBreak/PerVehicleBreaks/UniformBreakDimension,MatchEntry,PrecedenceEntry,ServiceTimeEntry,RoutingObjectiveFunction,InitialSolution).cuopt_routing.protofrom the registry and delete the hand-authored file.cpu_routing_problem_tconversion and deletegrpc_routing_problem_mapper.cpp.ci/verify_grpc_codegen.shcoverage to the routing proto/mapper.Known blockers / considerations
repeated_messagesmechanism (cf.quadratic_constraintsinfield_registry.yaml).map<>support ingenerate_conversions.pyyet —RoutingSolution.objective_valuesismap<int32, double>. Either add map support to the generator or model it as parallelrepeatedkey/value arrays.vehicle_type, capacity dimensions (name+demand+capacity), per-vehicle service times (vehicle_id = -1default), PDP pickup/delivery indices, breaks, vehicle/order matching, precedence, and initial solutions.🤖 Generated with Claude Code