Triordinal.DTree
2.4.2
dotnet add package Triordinal.DTree --version 2.4.2
NuGet\Install-Package Triordinal.DTree -Version 2.4.2
<PackageReference Include="Triordinal.DTree" Version="2.4.2" />
<PackageVersion Include="Triordinal.DTree" Version="2.4.2" />
<PackageReference Include="Triordinal.DTree" />
paket add Triordinal.DTree --version 2.4.2
#r "nuget: Triordinal.DTree, 2.4.2"
#:package Triordinal.DTree@2.4.2
#addin nuget:?package=Triordinal.DTree&version=2.4.2
#tool nuget:?package=Triordinal.DTree&version=2.4.2
Triordinal.DTree
C# implementation of DTree, the incremental encoding of the topology of directed trees by two projections Q1 and Q2: node u reaches node v if and only if u precedes v in both. Reachability, including and/or queries over sets of nodes, is answered in O(1) or O(log k) by comparing positions, and stays valid under insertions without recomputation, because the insertion points of a new node are known in advance. How its two lists differ from one list (the Euler tour, EulerTree): One list and two lists.
dotnet add package Triordinal.DTree
using DirectedTrees; // DTree, DNode, constructed nodes, Projection (Q1, Q2)
var t = new DTree("P1");
t.Insert("A", "B");
t.Insert("B", "C");
t.CanReach("A", "C"); // true
t.PathToRoot("C"); // ["C", "B", "A"]
// Node handles skip the lookup by name:
DNode a = t.GetNode("A"), c = t.GetNode("C");
t.CanReach(a, c); // true, two position comparisons
// And/or queries on the topology, with constructed nodes:
t.Insert("A", "D");
t.VMin(new[] { "C", "D" }).ReachesAll("A"); // true
t.UMin(new[] { "B", "D" }).ReachedBySome("C"); // true
Triordinal.DTree.Euler.EulerTree is the tree on one list: DTree's Q1 with its closing cells, the classical Euler-tour encoding, with DTree's API except Q2. For trees it is faster than DTree's two lists and needs less memory. Both take Positions.Integer for integer positions instead of the default rational ones.
using Triordinal.DTree.Euler;
var e = new EulerTree("E1");
e.Insert("A", "B");
e.CanReach("A", "B"); // true
new DTree("P1", strict: true) makes queries throw for names that are not in the tree instead of answering false. Every operation checks its arguments before it changes anything, so an operation that throws leaves the tree as it was.
- Repository, Python implementation and documentation: https://github.com/EnisOlgac/Triordinal
- Paper: E. Olgac, "Topology and Structure of Directed Trees: An Incremental Encoding," IntechOpen, 2025. https://doi.org/10.5772/intechopen.1013408
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Triordinal.DList (>= 2.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.