Skip to main content

Performance Optimization Guide

The VRP solver’s performance depends on multiple factors including problem size, constraint complexity, and configuration choices. This guide helps you understand and optimize solver performance for your specific use cases.

Performance Fundamentals

What Affects Solve Time?

Performance Scaling

The solver’s time complexity increases with:
  • Number of jobs (O(n))
  • Number of resources
  • Number of time windows
  • Basic constraints

Problem Size Guidelines

Small Problems (< 100 jobs)

Medium Problems (100-500 jobs)

Large Problems (500-2000 jobs)

Very Large Problems (> 2000 jobs)

Configuration for Performance

Essential Options

integer
Maximum solve time in milliseconds, passed as a query parameter on POST /v2/vrp/solve (and the /suggest and sync-solve endpoints) — not a body field. Balance between quality and speed.
The solver doesn’t expose separate construction-heuristic or local-search algorithm selection options — solve strategy is managed internally based on the problem.

Performance-Oriented Settings

Request
Body
Fast solutions with reasonable quality.

Distance Matrix Performance

Distance calculations significantly impact performance:

Matrix Types by Speed

1

Euclidean (Fastest)

  • No external API calls
  • Instant calculation
  • Lower accuracy
2

Routing Engine (Slower, most accurate)

  • Calls an external routing engine (OSM, TOMTOM, GOOGLE, or ANYMAP)
  • Real road distances and travel times
  • Most accurate
3

Pre-computed Custom Matrices (No calculation)

  • Skips on-the-fly distance calculation entirely
  • Best for stable location sets or multi-profile/time-sliced scenarios

Distance Matrix Optimization

Caching Strategy:
  1. Prefer customDistanceMatrices.profileMatrices for stable location sets, so distances are pre-computed once instead of recalculated per request
  2. Use options.euclidian: true for a fast approximation when road accuracy isn’t required
  3. Limit unique locations

Constraint Impact on Performance

Low Impact Constraints

  • Basic time windows
  • Simple capacity checks
  • Fixed assignments
  • Priority values

Medium Impact Constraints

  • Multiple time windows
  • Multi-dimensional capacity
  • Skill/tag matching
  • Soft time preferences

High Impact Constraints

  • Complex job relations
  • Many-to-many dependencies
  • Dynamic time calculations
  • Alternative evaluations
Performance Tips:
  • Minimize hard constraints
  • Avoid unnecessary job relations
  • Use reasonable time window widths
  • Limit alternative calculations

Hardware Requirements

Minimum Requirements

  • CPU: 2 cores
  • Memory: 4GB RAM
  • Network: 10 Mbps
  • Storage: 1GB free
  • CPU: 4 cores
  • Memory: 8GB RAM
  • Network: 50 Mbps
  • Storage: 5GB free

Performance Monitoring

The solver doesn’t expose internal solve telemetry (score-calculation counts, move-evaluation counts, time-to-first-feasible, or memory usage) through the API — there’s no built-in solve-performance endpoint. The response only reports the outcome of the solve; use these fields to gauge solution quality after the fact:
To compare configurations, measure wall-clock time from request to response externally and compare the resulting score across runs.

Optimization Strategies

1. Problem Decomposition

For very large problems, consider:
1

Geographic Clustering

Divide by regions or zones
2

Temporal Splitting

Separate by time periods
3

Resource Grouping

Partition by vehicle types
4

Priority Batching

Process high-priority first

2. Incremental Solving

Send POST /v2/vrp/solve?millis=60000 for phase 1, then POST /v2/vrp/solve?millis=120000 for phase 2. There’s no separate warmStart/solutionId field — warm-start the solver from a previous solution by setting each already-placed job’s initialResource (and optionally initialArrival/initialDepot) to what it resolved to last time.

3. Parallel Processing

When possible, run multiple scenarios:

4. Feature Toggling

Disable non-essential features for speed:

Common Performance Issues

Issue: Slow Initial Solutions

  • Long time to first feasible solution
  • Many jobs unassigned initially
  • Poor construction heuristic performance
  1. Relax hard constraints temporarily
  2. Enable partial planning
  3. Reduce initial problem size

Issue: Plateau in Optimization

  • Score stops improving
  • Move count remains high
  • No better solutions found
  1. Increase solve time (raise the millis query parameter)
  2. Adjust weight balance
  3. Add solution diversity

Issue: Memory Exhaustion

  • Out of memory errors
  • Slow garbage collection
  • System thrashing
  1. Reduce problem size
  2. Disable explanation
  3. Use geographic filtering

Best Practices

Performance Optimization Checklist:
  1. Start Simple: Begin with minimal constraints and features
  2. Measure Baseline: Record initial performance metrics
  3. Profile Problems: Identify specific bottlenecks
  4. Iterative Tuning: Make one change at a time
  5. Cache Aggressively: Reuse distance calculations
  6. Right-size Time: Don’t over-allocate solve time
  7. Monitor Production: Track real-world performance
  8. Document Settings: Record what works for your use case

Performance Benchmarks

Typical performance for well-configured problems:
Actual performance varies based on geographic distribution, constraint complexity, and hardware. Use these as rough guidelines only.

Constraint System

Understand constraint impact

Solution Quality

Balance speed vs quality

Cost Optimization

Optimize operational costs

Advanced Constraints

Complex constraint features