DirectedAcyclicGraph

internal class DirectedAcyclicGraph<T>

Represents a directed acyclic graph (DAG) of generic type T.

This class is immutable and guarantees that the graph does not contain any cycles. It provides functionality to find the nearest common ancestor of two vertices in the graph (findNearestCommonVertex).

Use the Builder class or buildDag function to create a new instance of this class.

Type Parameters

T

The type of items in the graph.

Types

Link copied to clipboard
class Builder<T>
Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun findNearestCommonVertex(vertex1: T, vertex2: T): T?
Link copied to clipboard
fun <R> map(conversion: (T) -> R): DirectedAcyclicGraph<R>