SupplyDemandSolver 1.1.5

dotnet add package SupplyDemandSolver --version 1.1.5                
NuGet\Install-Package SupplyDemandSolver -Version 1.1.5                
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="SupplyDemandSolver" Version="1.1.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SupplyDemandSolver --version 1.1.5                
#r "nuget: SupplyDemandSolver, 1.1.5"                
#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.
// Install SupplyDemandSolver as a Cake Addin
#addin nuget:?package=SupplyDemandSolver&version=1.1.5

// Install SupplyDemandSolver as a Cake Tool
#tool nuget:?package=SupplyDemandSolver&version=1.1.5                

NuGet

SupplyDemand

A simple matching algorithm for supply and demand, written in C#.

Example use

Simple matching:

var supply = new List<Supply> {
    new Supply { Id = 1, Capacity = 1 },
    new Supply { Id = 2, Capacity = 2 },
    new Supply { Id = 3, Capacity = 1 },
};

var demands = new List<Demand> {
    new Demand() { Id = 10, Allocation = null, SupplyPreference = new int[] { 2, 1, 3 } },
    new Demand() { Id = 11, Allocation = null, SupplyPreference = new int[] { 2, 1, 3 } },
    new Demand() { Id = 12, Allocation = null, SupplyPreference = new int[] { 2, 1, 3 } },
    new Demand() { Id = 13, Allocation = null, SupplyPreference = new int[] { 2, 1, 3 } },
};

var solver = new Solver(supply, demands);

Constraint matching:

Note: constraints are booleans. There can be up to 31 constraints.

var supply = new List<Supply> {
    new Supply { Id = 0, Capacity = 1 },
    new Supply { Id = 1, Capacity = 2 },
    new Supply { Id = 2, Capacity = 1 },
    new Supply { Id = 3, Capacity = 2, Categories = 8 },
};
var demands = new List<Demand> {
    new Demand() { Id = 10, Allocation = null, SupplyPreference = new int[] { 1, 0, 2 } },
    new Demand() { Id = 11, Allocation = null, SupplyPreference = new int[] { 1, 3, 2 } },
    new Demand() { Id = 12, Allocation = null, SupplyPreference = new int[] { 1, 0, 2 } },
    new Demand() { Id = 13, Allocation = null, SupplyPreference = new int[] { 1, 0, 2 } },
    new Demand() { Id = 14, Allocation = null, SupplyPreference = new int[] { 1, 0, 2 } },
    new Demand() { Id = 15, Allocation = null, SupplyPreference = new int[] { 1, 0, 2 } },
};

var solver = new Solver(supply, demands);
Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5.2

    • 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
1.1.5 504 3/23/2022
1.1.4 1,338 3/21/2017
1.1.1 1,110 1/29/2017
1.1.0 1,034 12/13/2016