OptimizationResponse

The body returned by every /optimize/* endpoint (and embedded under result in AsyncJobStatus once an async job completes).

Top-level fields

FieldTypeDescription
statusstringSolve outcome; see Status values below.
problem_idstringEcho of metadata.problem_id.
solve_time_msintegerWall-clock solve time in milliseconds.
routesRoute[]One entry per resource that was actually used.
unservedUnservedJob[]Jobs/pickup/delivery steps the solver did not serve.
scoreScoreBreakdownPresent unless output_options.include_score_breakdown=false.
diagnosticsSolverDiagnosticsPresent only when output_options.include_diagnostics=true.
infeasibility_reportInfeasibilityReportPresent only when status="infeasible".
warningsstring[]Non-fatal warnings (e.g. out-of-region jobs silently skipped by an adapter upstream).

Status values

statusMeaning
optimalProvably best solution found within the time limit.
feasibleValid solution found, optimality not proven (usually the time limit was hit first).
infeasibleNo valid solution exists for the given constraints. Check infeasibility_report.
timeoutTime limit expired before any solution was found.
errorInternal error.

Route

FieldTypeDescription
resource_idstringResource assigned to this route.
dayintegerMulti-day only: which day this route belongs to (0-indexed). null for single-day problems.
total_distanceintegerThis vehicle's total route distance (metres), mirrored from summary.total_distance so it is directly accessible without drilling into summary.
activitiesActivity[]Ordered list of stops/events on this route.
summaryRouteSummaryAggregate metrics for this route.
violationsRouteViolation[]Constraint violations detected on this route, if any.
Per-vehicle vs fleet-wide distance

Use route.total_distance (or route.summary.total_distance, identical value) for a single vehicle's distance. Use score.travel_distance for the fleet-wide total across every route.

RouteViolation

FieldTypeDescription
typestringOne of: time_window, capacity, max_travel_time, max_distance, max_tasks, skill.
messagestringHuman-readable description.
valuefloatObserved value that triggered the violation.
limitfloatConfigured limit that was exceeded.

Activity

FieldTypeDescription
typestringOne of the eight activity types below.
job_idstringSet for service activities.
shipment_idstringSet for pickup/delivery activities.
dump_station_idstringSet for reload activities.
location_indexintegerMatrix index of this activity's location.
arrival_time / departure_timeintegerSeconds; when the resource arrives/departs.
waiting_timeintegerTime spent waiting before service began (seconds).
service_timeintegerTime spent in service (seconds).
load_on_arrival / load_on_departureLoadSnapshotCumulative load state at arrival and departure.
distance_from_prev / time_from_previntegerDistance (metres) / time (seconds) from the previous activity.

Activity types

TypeMeaning
startRoute start at depot or start location.
endRoute end at depot or end location.
serviceJob service stop.
pickupPickup leg of a shipment.
deliveryDelivery leg of a shipment.
breakDriver break interval.
reloadCapacity reset at a dump station.
waitExplicit wait activity (early arrival at a time-windowed stop).

LoadSnapshot

FieldTypeDescription
totalintegerTotal load (single-capacity problems).
by_dimensionobjectMap of dimension name to current load (multi-capacity problems).

RouteSummary

FieldTypeDescription
total_distanceintegerTotal route distance (metres).
total_travel_timeintegerTotal travel time (seconds).
total_service_timeintegerTotal service time at stops (seconds).
total_waiting_timeintegerTotal waiting time (seconds).
total_timeintegerEnd time minus start time (seconds).
num_stopsintegerNumber of service stops.
num_jobsintegerNumber of jobs served.
max_load / max_loadsinteger / objectPeak load, single- or multi-capacity respectively.
costfloatTotal route cost.

UnservedJob

FieldTypeDescription
idstringJob, pickup step, or delivery step id.
typestringjob, pickup, or delivery.
reasonstringMachine-readable reason code; see below.
reason_detailstringHuman-readable explanation, populated by the Layer 0 feasibility analysis.

Unserved reason codes

CodeMeaning
no_feasible_vehicleNo resource is eligible at all (wrong skills, zone, etc.).
time_window_infeasibleNo resource can reach the job within its time window.
capacity_infeasibleDemand exceeds every available capacity.
skill_mismatchNo resource has the required skills.
zone_restrictionJob is in a zone with no eligible resource.
day_constraintPinned to a day when no resource is available.
penalty_too_lowSolver chose to drop the job; penalty was cheaper than insertion cost.
dropped_by_solverGeneric: solver dropped it for optimization reasons.

ScoreBreakdown

FieldTypeDescription
totalfloatTotal objective score (the weighted sum the solver actually optimized).
travel_distancefloatFleet-wide distance component, summed across all routes (metres). Use this for the total-distance-across-all-vehicles figure.
travel_timefloatFleet-wide travel time component (seconds).
fixed_vehicle_costfloatFixed cost for vehicles used.
penalty_droppedfloatPenalty for dropped optional jobs.
fairness_costfloatWorkload imbalance cost.
num_vehicles_usedintegerNumber of resources with at least one stop.
total is not a distance

score.total is the weighted objective value the solver minimized/maximized, not a raw distance figure — it can mix distance, time, fixed costs, and penalties depending on the active objective. For raw fleet-wide distance, always read score.travel_distance.

SolverDiagnostics

Returned only when output_options.include_diagnostics=true.

FieldTypeDescription
solver_status_codeintegerRaw solver status code.
num_nodesintegerNumber of routing nodes in the model.
num_vehicles_modeledintegerNumber of vehicles in the model, including virtual (multi-day) vehicles.
iterationsintegerNumber of search iterations.
search_logstring[]Verbose solver output lines, only when options.log_search=true.

InfeasibilityReport

Present only when status="infeasible".

FieldTypeDescription
guaranteed_unservableJobFeasibilityHint[]Jobs statically proven unservable by any active resource (Layer 0 analysis, always runs).
diagnostic_unservedstring[]Job ids dropped even in a relaxed solve where every job is optional (Stage 1) — the true root causes.
collective_bottleneckstringComma-separated constraint types found to be the minimum infeasibility set (Stage 2), when no individual job is the culprit.
collective_bottleneck_detailstringHuman-readable detail behind collective_bottleneck.
structural_issuebooleantrue when even the relaxed solve (Stage 1) found no solution at all — indicates a model-level problem, not a job-level one.
structural_hintstringHuman-readable hint accompanying structural_issue.

JobFeasibilityHint

FieldTypeDescription
job_idstringThe job in question.
feasible_resource_countintegerHow many active resources could serve this job in isolation. 0 means guaranteed unservable.
blocked_reasonsstring[]One human-readable entry per blocking resource.

Minimal response

{
  "status": "optimal",
  "problem_id": "v2-01-basic",
  "solve_time_ms": 47,
  "routes": [
    {
      "resource_id": "truck-1",
      "day": null,
      "total_distance": 17,
      "activities": [
        { "type": "start",   "location_index": 0, "arrival_time": 0, "departure_time": 0 },
        { "type": "service", "job_id": "j1", "location_index": 1, "arrival_time": 4, "departure_time": 4 },
        { "type": "service", "job_id": "j2", "location_index": 2, "arrival_time": 9, "departure_time": 9 },
        { "type": "end",     "location_index": 0, "arrival_time": 17, "departure_time": 17 }
      ],
      "summary": {
        "total_distance": 17, "total_time": 17,
        "num_stops": 2, "num_jobs": 2,
        "cost": 0.0
      }
    }
  ],
  "unserved": [],
  "score": {
    "total": 17.0, "travel_distance": 17.0,
    "num_vehicles_used": 1
  }
}

FieldGenius VRP API documentation. Generated from the engineering source of truth (.tex docs and app/ source).