Arborescence.Models 0.16.2

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

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

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.
};
ListAdjacencyGraph<string, Dictionary<string, List<string>>> graph =
    ListAdjacencyGraphFactory<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.)

ListIncidenceGraph<string, int, Dictionary<int, string>, Dictionary<string, List<int>>> graph =
    ListIncidenceGraphFactory<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 was computed.  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 231 1/11/2024
0.16.5 176 1/7/2024
0.16.4 190 1/2/2024
0.16.3 164 1/1/2024
0.16.2 249 7/28/2023
0.16.1 286 6/11/2023
0.16.0 225 6/4/2023
0.15.0 333 1/17/2023
0.14.1 343 1/10/2023
0.14.0 312 1/7/2023
0.13.1 404 7/6/2021
0.13.0 412 6/27/2021
0.11.0 484 5/30/2021
0.10.0 422 5/29/2021
0.9.0 405 1/15/2021
0.8.0 427 1/6/2021
0.7.1 500 12/26/2020
0.7.0 552 12/25/2020
0.6.0 485 11/9/2020
0.5.0 486 10/24/2020
0.4.2 565 10/20/2020
0.4.1 546 10/14/2020
0.4.0 532 9/24/2020
0.3.2 500 9/6/2020
0.3.1 573 8/12/2020
0.3.0 510 7/30/2020
0.2.0 515 7/19/2020