Arborescence.Traversal
0.17.0
dotnet add package Arborescence.Traversal --version 0.17.0
NuGet\Install-Package Arborescence.Traversal -Version 0.17.0
<PackageReference Include="Arborescence.Traversal" Version="0.17.0" />
paket add Arborescence.Traversal --version 0.17.0
#r "nuget: Arborescence.Traversal, 0.17.0"
// Install Arborescence.Traversal as a Cake Addin #addin nuget:?package=Arborescence.Traversal&version=0.17.0 // Install Arborescence.Traversal as a Cake Tool #tool nuget:?package=Arborescence.Traversal&version=0.17.0
Traversal — Arborescence Graph Library
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[^SB].
Basic usage
Let's consider this implicit adjacency graph[^IG]:
public readonly record struct Node(int Value);
public sealed class AdjacencyGraph : IOutNeighborsAdjacency<Node, IEnumerator<Node>>
{
public IEnumerator<Node> EnumerateOutNeighbors(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);
[^IG]: Implicit graph
https://en.wikipedia.org/wiki/Implicit_graph
[^SB]: Stack-based graph traversal ≠ depth first search
https://11011110.github.io/blog/2013/12/17/stack-based-graph-traversal.html
Product | Versions 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 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 | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 was computed. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net46 was computed. 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 | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Universal Windows Platform | uap was computed. uap10.0 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.1
- Arborescence.Abstractions (>= 0.17.0)
- Arborescence.Primitives (>= 0.17.0)
- System.Buffers (>= 4.5.1)
-
.NETStandard 1.3
- Arborescence.Abstractions (>= 0.17.0)
- Arborescence.Primitives (>= 0.17.0)
- System.Buffers (>= 4.5.1)
-
.NETStandard 2.0
- Arborescence.Abstractions (>= 0.17.0)
- Arborescence.Primitives (>= 0.17.0)
- System.Buffers (>= 4.5.1)
-
.NETStandard 2.1
- Arborescence.Abstractions (>= 0.17.0)
- Arborescence.Primitives (>= 0.17.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Arborescence.Traversal:
Package | Downloads |
---|---|
Arborescence.Traversal.Specialized
Graph traversal algorithms specialized for integer vertices from a contiguous range. Commonly used types: • Adjacency.EnumerableBfs<TNeighborEnumerator> • Adjacency.EnumerableDfs<TNeighborEnumerator> • Adjacency.EnumerableGenericSearch<TNeighborEnumerator> • Adjacency.EagerBfs<TNeighborEnumerator> • Adjacency.EagerDfs<TNeighborEnumerator> • Incidence.EnumerableBfs<TEdge, TEdgeEnumerator> • Incidence.EnumerableDfs<TEdge, TEdgeEnumerator> • Incidence.EnumerableGenericSearch<TEdge, TEdgeEnumerator> • Incidence.EagerBfs<TEdge, TEdgeEnumerator> • Incidence.EagerDfs<TEdge, TEdgeEnumerator> |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.17.0 | 451 | 1/11/2024 |
0.16.5 | 383 | 1/7/2024 |
0.16.4 | 427 | 1/2/2024 |
0.16.3 | 396 | 1/1/2024 |
0.16.2 | 468 | 7/28/2023 |
0.16.0 | 402 | 6/4/2023 |
0.15.3 | 502 | 2/9/2023 |
0.15.2 | 529 | 1/25/2023 |
0.15.1 | 692 | 1/18/2023 |
0.15.0 | 517 | 1/17/2023 |
0.14.0 | 544 | 1/7/2023 |
0.13.0 | 661 | 6/27/2021 |
0.12.0 | 588 | 6/9/2021 |
0.11.0 | 704 | 5/30/2021 |
0.10.0 | 635 | 5/29/2021 |
0.9.0 | 665 | 1/15/2021 |
0.8.1 | 684 | 1/8/2021 |
0.8.0 | 647 | 1/6/2021 |
0.7.1 | 727 | 12/26/2020 |
0.7.0 | 814 | 12/25/2020 |
0.6.0 | 740 | 11/9/2020 |
0.5.0 | 733 | 11/2/2020 |
0.3.2 | 716 | 9/6/2020 |
0.1.1 | 755 | 7/13/2020 |