Download the PHP package azaharizaman/nexus-routing without Composer
On this page you can find all versions of the php package azaharizaman/nexus-routing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download azaharizaman/nexus-routing
More information about azaharizaman/nexus-routing
Files in azaharizaman/nexus-routing
Package nexus-routing
Short Description Route optimization and vehicle routing problem (VRP) solver for Nexus ERP
License MIT
Informations about the package nexus-routing
Nexus\Routing
Route optimization and Vehicle Routing Problem (VRP) solver for the Nexus ERP system.
Overview
Nexus\Routing provides framework-agnostic algorithms for solving Traveling Salesman Problem (TSP) and Vehicle Routing Problem (VRP) with support for:
- TSP Optimization: Nearest-Neighbor with 2-Opt refinement
- Multi-Vehicle VRP: Google OR-Tools integration for complex constraints
- Offline Routing Cache: Gzip-compressed route storage (50MB limit)
- Constraint Validation: Time windows, vehicle capacity, service duration
- Route Metrics: Total distance, duration, constraint violations
This package depends on azaharizaman/nexus-geo for distance calculations and coordinates.
Installation
Features
1. TSP Optimization (Single Vehicle)
Optimizes route for a single vehicle visiting multiple stops:
Output:
2. VRP Optimization (Multi-Vehicle)
Assigns stops to multiple vehicles with capacity constraints:
3. Time Window Constraints
Enforce delivery time windows:
4. Offline Route Cache
Store optimized routes for offline mobile app access:
Cache Characteristics:
- Compression: Gzip compression (typically 80% reduction)
- Size Limit: 50MB per tenant
- TTL: 30 days (configurable)
- Versioning: Cache key includes route parameters hash
5. OR-Tools Integration
For complex VRP scenarios, integrate with Google OR-Tools Docker service:
Architecture
Package Structure
Algorithm Performance
| Algorithm | Stops | Vehicles | Time Complexity | Execution Time |
|---|---|---|---|---|
| Nearest-Neighbor | 50 | 1 | O(n²) | ~10ms |
| 2-Opt Refinement | 50 | 1 | O(n²) | ~50ms |
| VRP (Greedy) | 100 | 5 | O(n² × v) | ~200ms |
| OR-Tools (Meta) | 500 | 10 | Variable | 5-30s |
Cost Optimization Strategies
- Cache Reusable Routes: Store frequently-requested routes (e.g., daily delivery routes)
- Batch Optimization: Combine multiple route requests for OR-Tools
- Tiered Approach: Use TSP for <20 stops, VRP for 20-100, OR-Tools for >100
- Offline Priority: Deliver cache to mobile apps to reduce real-time API calls
Integration with Nexus\Geo
This package tightly integrates with Nexus\Geo:
Constraint Violation Logging
All constraint violations are logged for analytics:
Configuration
Configuration is managed in config/routing.php (in Atomy):
Testing
📖 Documentation
Package Documentation
- Getting Started Guide
- API Reference
- Integration Guide
- Examples
Additional Resources
IMPLEMENTATION_SUMMARY.md- Implementation progressREQUIREMENTS.md- RequirementsTEST_SUITE_SUMMARY.md- TestsVALUATION_MATRIX.md- Valuation
License
MIT License. See LICENSE for details.
Dependencies
azaharizaman/nexus-geo: Geospatial calculationspsr/log: Logging interface- Google OR-Tools (optional, via Docker)
Contributing
This package follows the Nexus monorepo Logic in Packages, Implementation in Applications architecture. All business logic stays framework-agnostic.