Arborescence.Models.Specialized 0.17.0

dotnet add package Arborescence.Models.Specialized --version 0.17.0                
NuGet\Install-Package Arborescence.Models.Specialized -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.Specialized" 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.Specialized --version 0.17.0                
#r "nuget: Arborescence.Models.Specialized, 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.Specialized as a Cake Addin
#addin nuget:?package=Arborescence.Models.Specialized&version=0.17.0

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

Models.Specialized — Arborescence Graph Library

Arborescence.Models.Specialized version

This package provides an efficient implementation of Out-Edges Incidence and Out-Neighbors Adjacency for a special case of integer vertices from contiguous range.

        ┌   tail : E → V?
Graph   ┤
        └   head : E → V?       ┐
                                ├   Forward Incidence
            out-edges : V → [E] ┘

            out-neighbors: V → [V]

Int32AdjacencyGraph represents a directed multigraph (permitting loops) with edges not having their own identity[^EWO].
Int32IncidenceGraph represents a directed multigraph (permitting loops) with edges having their own identity[^EWI].

Vertices are represented as integers and must fill the range [0..VertexCount).
Edges are stored as incidence lists in contiguous spans.

Basic usage

Let's consider this simple graph:

       ┌──>──┐
(0)   (1)─>─(2)─>─(3)┐
       └──<──┘     └<┘

This is how to recreate it in the code:

Endpoints<int>[] edges =
{
    new(1, 2),
    new(1, 2),
    new(2, 1),
    new(2, 3),
    new(3, 3)
};
var graph = Int32AdjacencyGraph.FromEdges(edges);
Console.WriteLine(graph.VertexCount);

The expected output is 4 — including vertex 0, even if it was not specified when creating the graph. The number of vertices is determined as one plus the maximum id of the vertices, so they fill the range [0..VertexCount).

Now let's explore the edges incident to vertex 2:

const int vertex = 2;
var edgeEnumerator = graph.EnumerateOutEdges(vertex);
while (edgeEnumerator.MoveNext())
{
    var edge = edgeEnumerator.Current;
    Debug.Assert(graph.TryGetTail(edge, out int tail) &&
        tail == vertex);
    if (graph.TryGetHead(edge, out int head))
        Console.WriteLine(head);
}

The expected output — all the neighbors of vertex 2:

1
3

[^EWI]: Edges with own identity
https://en.wikipedia.org/wiki/Multigraph#Directed_multigraph_(edges_with_own_identity)

[^EWO]: Edges without own identity
https://en.wikipedia.org/wiki/Multigraph#Directed_multigraph_(edges_without_own_identity)

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 was computed.  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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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.17.0 198 1/11/2024
0.16.5 130 1/7/2024
0.16.4 134 1/2/2024
0.16.3 154 1/1/2024
0.16.2 181 7/28/2023
0.16.1 192 6/11/2023
0.16.0-preview 151 6/5/2023