VRP context model
1. Overview
The VRP context defines customers, depots, vehicle types, routes, and resource semantics shared by route generation and route compilation. It validates data and routes; it does not build the restricted master problem.
1. Dependent Contexts
Input adapters supply a unit-normalized instance. Calculation policies supply distance, travel time, and cost.
2. Concepts / Entities
1. Customers and Depots
Depots define route endpoints and applicable time ranges. They are not customers requiring coverage.
2. Vehicle Types and Routes
Route
3. Variables
1. Decision Variables
This context declares no solver decision variables. Route usage
2. Auxiliary Variables
This context declares no auxiliary solver variables. Route load, service times, and cost are domain calculations, not additional master variables.
4. Predicates
5. Sets
6. Intermediate Values
1. Load and Coverage Coefficients
Route load is the total demand of its visited customers. Coverage coefficients are route data, not binary master variables.
2. Arrival, Waiting, and Service
Given travel time
Early arrival permits waiting. A service-start window must not be interpreted as a prohibition on early arrival.
3. Route Cost
Route cost combines fixed cost and arc costs. Distance need not equal travel time or cost.
7. Assertions
Inputs and policies must preserve compatible units, nonnegative demand, and ordered time windows:
Let
8. Constraints
1. Route Resource Feasibility [路线资源可行性]
Description: Routes must satisfy capacity and service-start windows, departing from and returning to permitted depots.
These are route-construction and validation rules, not additional rows registered in the restricted master by this context. Cross-route customer coverage and fleet limits belong to route compilation.
9. Objective Function (if applicable)
This context has no independent optimization objective. It supplies route cost
10. Algorithm References
| Algorithm | Referenced In | Description |
|---|---|---|
| Route validation | Input and result analysis | Checks depots, visits, capacity, service times, and units |
| Route resource recurrence | Section 6 | Accumulates load and computes waiting and service in visit order |
| Calculation policies | Section 6 | Supply distance, travel time, and cost |
Kotlin VRP context source; Kotlin/Rust example entry points.
11. Ubiquitous Language
| Term | Symbol | Definition |
|---|---|---|
| Customer | Demand node requiring service | |
| Vehicle type | Capacity, fixed cost, and available count | |
| Route | Feasible visit sequence for a vehicle type | |
| Service start | Time service starts after arrival and waiting | |
| Coverage coefficient | Whether a route visits a customer |
12. Design Decisions
| Decision | Alternative | Rationale |
|---|---|---|
| Treat routes as domain objects | Redefine arc variables in every context | Shares semantics across generation, compilation, and validation |
| Separate arrival from service start | Disallow arrival before the ready time | Models waiting correctly |
| Separate resource validation from master rows | Expand route resources again in the master | Preserves route-column decomposition |
13. Change Log
| Version | Change | Reason |
|---|---|---|
| 1.1 | Aligned bilingual structure, time semantics, and variable ownership | Avoid treating domain attributes as solver variables |