URouting 0.6.0

dotnet add package URouting --version 0.6.0
                    
NuGet\Install-Package URouting -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="URouting" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="URouting" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="URouting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add URouting --version 0.6.0
                    
#r "nuget: URouting, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package URouting@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=URouting&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=URouting&version=0.6.0
                    
Install as a Cake Tool

URouting

.NET bindings for the u-routing vehicle routing engine.

Features

  • Methods: nearest neighbour, Clarke-Wright savings, a genetic algorithm with route splitting, and adaptive large neighbourhood search
  • Time windows: every method keeps them. A merge, an insertion and every local-search move are taken only when the resulting route reaches each customer by its due time; a customer no route can reach on time comes back unassigned rather than being served late
  • Capacities: load is counted in whole units, and a fractional demand is refused rather than rounded
  • Fleet size: max_vehicles states how many routes a plan may use, and a plan that would need more is refused, naming both numbers

Installation

dotnet add package URouting

Usage

using URouting;

using var routing = new RoutingClient();

var solution = routing.SolveVrp(new
{
    depot_x = 0.0,
    depot_y = 0.0,
    customers = new[]
    {
        new { id = 1, x = 10.0, y = 5.0, demand = 10.0 },
        new { id = 2, x = -4.0, y = 8.0, demand = 15.0 },
        new { id = 3, x = 6.0,  y = -9.0, demand = 20.0 },
    },
    vehicles = new[] { new { capacity = 30.0 } },
    method = "savings",
});

Console.WriteLine(solution.GetProperty("total_distance").GetDouble());

The request is serialized with snake_case names, so anonymous objects can be written as above. The result is a System.Text.Json.JsonElement carrying routes, total_distance, num_vehicles, method_used and unassigned.

A request the solver cannot honour raises RoutingException. Message is readable text; Reason is a stable code to branch on and Details is the error body with the values behind it:

try
{
    client.SolveVrp(request);
}
catch (RoutingException ex) when (ex.Reason == "duplicate_id")
{
    var id = ex.Details!.Value.GetProperty("id").GetInt64();
    Console.WriteLine($"customer {id} appears twice");
}

The codes and their fields are listed in the crate README's Errors section.

Platforms

Windows, Linux and macOS (x64 and arm64). The native library ships inside the package; no separate install is needed.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 36 9/30/2026
0.5.1 32 9/30/2026
0.5.0 78 9/25/2026
0.4.0 89 9/13/2026
0.3.0 101 9/12/2026
0.2.3 133 4/2/2026