Arborescence.Traversal 0.15.2

.NET Core 3.1 .NET Standard 1.3 .NET Framework 4.6.1
dotnet add package Arborescence.Traversal --version 0.15.2
NuGet\Install-Package Arborescence.Traversal -Version 0.15.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.Traversal" Version="0.15.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arborescence.Traversal --version 0.15.2
#r "nuget: Arborescence.Traversal, 0.15.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Arborescence.Traversal as a Cake Addin
#addin nuget:?package=Arborescence.Traversal&version=0.15.2

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

Traversal — Arborescence Graph Library

Arborescence.Traversal version

This package provides basic traversal algorithms for incidence and adjacency graphs:

  • generic search taking a frontier as a parameter,
  • breadth-first search (BFS), which is a special case of generic search with FIFO-queue as the frontier,
  • depth-first search (DFS), which is not a special case of generic search with LIFO-stack as the frontier [1].

Basic usage

Let's consider this implicit adjacency graph [2]:

public readonly record struct Node(int Value);

public sealed class AdjacencyGraph : IAdjacency<Node, IEnumerator<Node>>
{
    public IEnumerator<Node> EnumerateNeighbors(Node vertex) =>
        vertex.Value is < 0 or >= 10
            ? Enumerable.Empty<Node>().GetEnumerator()
            : EnumerateNeighborsIterator(vertex);

    private static IEnumerator<Node> EnumerateNeighborsIterator(
        Node vertex)
    {
        yield return new(vertex.Value >> 1);
        yield return new(vertex.Value << 1);
    }
}

This is how to traverse it in a breadth-first manner with an adjacency version of the algorithm:

AdjacencyGraph adjacencyGraph = new();
Node source = new(3);
IEnumerator<Node> vertexEnumerator =
    EnumerableBfs<Node>.EnumerateVertices(adjacencyGraph, source);
while (vertexEnumerator.MoveNext())
    Console.WriteLine(vertexEnumerator.Current);

[1] Stack-based graph traversal ≠ depth first search
https://11011110.github.io/blog/2013/12/17/stack-based-graph-traversal.html

[2] Implicit graph
https://en.wikipedia.org/wiki/Implicit_graph

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.3 netstandard1.4 netstandard1.5 netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Universal Windows Platform uap uap10.0
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
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.15.2 68 1/25/2023
0.15.1 112 1/18/2023
0.15.0 76 1/17/2023
0.14.0 91 1/7/2023
0.13.0 323 6/27/2021
0.12.0 212 6/9/2021
0.11.0 343 5/30/2021
0.10.0 296 5/29/2021
0.9.0 266 1/15/2021
0.8.1 295 1/8/2021
0.8.0 264 1/6/2021
0.7.1 315 12/26/2020
0.7.0 415 12/25/2020
0.6.0 337 11/9/2020
0.5.0 331 11/2/2020
0.3.2 321 9/6/2020
0.1.1 374 7/13/2020