Options
All
  • Public
  • Public/Protected
  • All
Menu

A base class for graph nodes.

Type parameters

  • T

    The type of the value stored in the node.

Hierarchy

Index

Constructors

constructor

Properties

neighbors

neighbors: GraphNodeBase<T>[]

The nodes adjacent to this one in the graph.

traversed

traversed: boolean

Stores whether a node has been traversed, used in some algorithms.

value

value: T

The value stored in a node.

Methods

_getComponent

  • Gets the connected component of a node in a graph. When called from a child class, the return type of this function will always match whatever the type of neighbors is.

    This function shouldn't be called directly: use getComponent instead.

    Parameters

    • reset: boolean

    Returns GraphNodeBase<T>[]

    The connected component of this.

getComponent

  • Gets the connected component of a node in a graph. When inherited, this method should have the return type of the associated graph class.

    Parameters

    • Default value reset: boolean = true

    Returns GraphBase<T>

    The connected component of this.

Generated using TypeDoc, the 1/31/2021 at 6:18:55 AM