Skip to content

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 ​

qi: Demand of customer i, measured in a common load unit.

[ei,li]: Permitted service-start window of customer i; si is its service duration.

Depots define route endpoints and applicable time ranges. They are not customers requiring coverage.

2. Vehicle Types and Routes ​

Qv: Capacity of vehicle type v; mv is the available vehicle count; fv is the fixed cost of using one vehicle.

Route r is a depot-to-depot visit sequence for a specified vehicle type. air records whether it visits customer i.

3. Variables ​

1. Decision Variables ​

This context declares no solver decision variables. Route usage xr belongs to route compilation.

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 ​

customer(n): Node n is a customer.

depot(n): Node n is a depot.

visits(r,i): Route r visits customer i.

elementary(r): Route r visits no customer more than once.

5. Sets ​

C: Customers; V: vehicle types; N: customer and depot nodes.

Av: Directed arcs permitted for vehicle type v.

Rv: Feasible routes of type v; R is their union.

Cr: Customers visited by route r; Ar: its ordered traversed arcs.

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.

Lr=∑i∈Crqi,air={1,i∈Cr,0,i∉Cr.

2. Arrival, Waiting, and Service ​

Given travel time τijv for vehicle type v, arrival, service start, and departure at node j after node i are:

tjarr=tidep+τijv,tjstart=max{tjarr,ej},tjdep=tjstart+sj.

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.

cr=fv+∑(i,j)∈Arcijv,r∈Rv.

7. Assertions ​

Inputs and policies must preserve compatible units, nonnegative demand, and ordered time windows:

∀i∈C:qi≥0 ∧ ei≤li ∧ si≥0.

Let nk(r) denote the kth node of route r. An elementary route visits each customer at most once:

∀r∈R, ∀i∈C:#{k:nk(r)=i}≤1.

8. Constraints ​

1. Route Resource Feasibility [路线资源可行性] ​

Description: Routes must satisfy capacity and service-start windows, departing from and returning to permitted depots.

Lr≤Qv,ei≤tistart≤li,∀r∈Rv, ∀i∈Cr.

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 cr for phase II of route compilation. Route generation uses the phase objective and dual prices to calculate reduced cost.

10. Algorithm References ​

AlgorithmReferenced InDescription
Route validationInput and result analysisChecks depots, visits, capacity, service times, and units
Route resource recurrenceSection 6Accumulates load and computes waiting and service in visit order
Calculation policiesSection 6Supply distance, travel time, and cost

Kotlin VRP context source; Kotlin/Rust example entry points.

11. Ubiquitous Language ​

TermSymbolDefinition
Customeri∈CDemand node requiring service
Vehicle typev∈VCapacity, fixed cost, and available count
Router∈RvFeasible visit sequence for a vehicle type
Service starttistartTime service starts after arrival and waiting
Coverage coefficientairWhether a route visits a customer

12. Design Decisions ​

DecisionAlternativeRationale
Treat routes as domain objectsRedefine arc variables in every contextShares semantics across generation, compilation, and validation
Separate arrival from service startDisallow arrival before the ready timeModels waiting correctly
Separate resource validation from master rowsExpand route resources again in the masterPreserves route-column decomposition

13. Change Log ​

VersionChangeReason
1.1Aligned bilingual structure, time semantics, and variable ownershipAvoid treating domain attributes as solver variables