Triordinal.DTree 2.4.2

dotnet add package Triordinal.DTree --version 2.4.2
                    
NuGet\Install-Package Triordinal.DTree -Version 2.4.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="Triordinal.DTree" Version="2.4.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Triordinal.DTree" Version="2.4.2" />
                    
Directory.Packages.props
<PackageReference Include="Triordinal.DTree" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Triordinal.DTree --version 2.4.2
                    
#r "nuget: Triordinal.DTree, 2.4.2"
                    
#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.
#:package Triordinal.DTree@2.4.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Triordinal.DTree&version=2.4.2
                    
Install as a Cake Addin
#tool nuget:?package=Triordinal.DTree&version=2.4.2
                    
Install as a Cake Tool

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.

Product 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. 
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
2.4.2 51 11/20/2026
2.4.1 87 11/14/2026
2.4.0 93 11/14/2026
2.3.0 109 10/30/2026
2.2.0 98 10/30/2026
2.1.0 98 10/29/2026
2.0.0 98 10/29/2026