Skip to content

Generate cuopt_routing.proto and VRP mapper via field_registry codegen #1616

Description

@ramakrishnap-nv

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

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions