Arborescence.Models.Specialized 0.16.0-preview

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

// Install Arborescence.Models.Specialized as a Cake Tool
#tool nuget:?package=Arborescence.Models.Specialized&version=0.16.0-preview&prerelease                

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 [1].
Int32IncidenceGraph represents a directed multigraph (permitting loops) with edges having their own identity [2].

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)
};
Int32AdjacencyGraph graph =
    Int32AdjacencyGraphFactory.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

[1] https://en.wikipedia.org/wiki/Multigraph#Directed_multigraph_(edges_without_own_identity)

[2] https://en.wikipedia.org/wiki/Multigraph#Directed_multigraph_(edges_with_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 190 1/11/2024
0.16.5 124 1/7/2024
0.16.4 130 1/2/2024
0.16.3 150 1/1/2024
0.16.2 177 7/28/2023
0.16.1 186 6/11/2023
0.16.0-preview 148 6/5/2023