Arborescence.Models 0.17.0

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

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

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 166 1/11/2024
0.16.5 136 1/7/2024
0.16.4 141 1/2/2024
0.16.3 111 1/1/2024
0.16.2 209 7/28/2023
0.16.1 242 6/11/2023
0.16.0 188 6/4/2023
0.15.0 313 1/17/2023
0.14.1 312 1/10/2023
0.14.0 279 1/7/2023
0.13.1 382 7/6/2021
0.13.0 387 6/27/2021
0.11.0 457 5/30/2021
0.10.0 398 5/29/2021
0.9.0 375 1/15/2021
0.8.0 404 1/6/2021
0.7.1 469 12/26/2020
0.7.0 529 12/25/2020
0.6.0 460 11/9/2020
0.5.0 465 10/24/2020
0.4.2 535 10/20/2020
0.4.1 516 10/14/2020
0.4.0 505 9/24/2020
0.3.2 473 9/6/2020
0.3.1 549 8/12/2020
0.3.0 480 7/30/2020
0.2.0 483 7/19/2020