Arborescence.Models 0.16.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Arborescence.Models --version 0.16.4                
NuGet\Install-Package Arborescence.Models -Version 0.16.4                
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="Arborescence.Models" Version="0.16.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arborescence.Models --version 0.16.4                
#r "nuget: Arborescence.Models, 0.16.4"                
#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 Arborescence.Models as a Cake Addin
#addin nuget:?package=Arborescence.Models&version=0.16.4

// Install Arborescence.Models as a Cake Tool
#tool nuget:?package=Arborescence.Models&version=0.16.4                

Models — Arborescence Graph Library

Arborescence.Models version

This package provides a generic implementation of graph interfaces and collection concepts.

ListAdjacencyGraph<TVertex, TVertexMultimap> implements an adjacency graph as a dictionary that maps from a vertex to a list of its out-neighbors of type List<TVertex>.
ListIncidenceGraph<TVertex, TEdge, TEndpointMap, TEdgeMultimap> implements an incidence graph as a dictionary that maps from a vertex to a list of its out-edges of type List<TEdge>.

Basic usage

For example, we have four airports (Omsk, London, Istanbul, Taipei) and five unspecified flights connecting them:

  ┌───>───┐       ┌─>─┐
[LHR]─>─[IST]─>─[TPE] │
  └───<───┘       └───┘

[OMS]

We can create an adjacency graph as follows:

Dictionary<string, List<string>> neighborsByVertex = new(4)
{
    ["OMS"] = new(),
    ["LHR"] = new() { "IST", "IST" },
    ["IST"] = new() { "LHR" }
    // Let's add "TPE" later.
};
var graph = ListAdjacencyGraph<string>.Create(neighborsByVertex);
graph.TryAddVertex("TPE");
graph.AddEdge("IST", "TPE");
graph.AddEdge("TPE", "TPE");

IncidenceEnumerator<string, List<string>.Enumerator> flightsFromIstanbul =
    graph.EnumerateOutEdges("IST");
while (flightsFromIstanbul.MoveNext())
    Console.WriteLine(flightsFromIstanbul.Current);

Expected output is:

[IST, LHR]
[IST, TPE]

Now let's look at the actual flights that connect these airports:

        BA676
  ┌───────>───────┐             EVA5288
  │     TK1980    │      TK24     ┌─>─┐
[LHR]─────>─────[IST]─────>─────[TPE] │
  └───────<───────┘               └───┘
        BA677

[OMS]

The following is one of the ways you can create an incident graph. (For clarity, we represent flights as integers rather than strings.)

var graph = ListIncidenceGraph<string, int>.Create();
_ = graph.TryAddVertex("OMS");
_ = graph.TryAddEdge(676, "LHR", "IST");
_ = graph.TryAddEdge(1980, "LHR", "IST");
_ = graph.TryAddEdge(677, "IST", "LHR");
_ = graph.TryAddEdge(24, "IST", "TPE");
_ = graph.TryAddEdge(5288, "TPE", "TPE");

List<int>.Enumerator flightsFromIstanbul =
    graph.EnumerateOutEdges("IST");
while (flightsFromIstanbul.MoveNext())
    Console.WriteLine(flightsFromIstanbul.Current);

Expected output is:

677
24
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Arborescence.Models:

Package Downloads
Arborescence.Models.Specialized

Special graph data structures that provide efficient implementation when vertices are integers from a contiguous range. Commonly used types: • Int32AdjacencyGraph • Int32IncidenceGraph

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.17.0 239 1/11/2024
0.16.5 180 1/7/2024
0.16.4 194 1/2/2024
0.16.3 166 1/1/2024
0.16.2 251 7/28/2023
0.16.1 288 6/11/2023
0.16.0 229 6/4/2023
0.15.0 337 1/17/2023
0.14.1 345 1/10/2023
0.14.0 314 1/7/2023
0.13.1 406 7/6/2021
0.13.0 414 6/27/2021
0.11.0 486 5/30/2021
0.10.0 424 5/29/2021
0.9.0 407 1/15/2021
0.8.0 431 1/6/2021
0.7.1 502 12/26/2020
0.7.0 554 12/25/2020
0.6.0 487 11/9/2020
0.5.0 496 10/24/2020
0.4.2 567 10/20/2020
0.4.1 548 10/14/2020
0.4.0 534 9/24/2020
0.3.2 502 9/6/2020
0.3.1 577 8/12/2020
0.3.0 512 7/30/2020
0.2.0 520 7/19/2020