Interface GraphNode<T>

Represents a node in a graph. GraphNode

Example

const node: GraphNode<number> = {
id: "node1",
data: 42,
neighbors: { "0,1": node2, "0,2": node3, "0,3": node4 },
};

Type Parameters

  • T

    The type of data associated with the node.

Hierarchy

  • GraphNode

Properties

Properties

data: T

The data associated with the node.

id: `${number},${number}`

The unique identifier for the node.

neighbors: GraphNodeMap<T>

An array of neighboring nodes connected to this node.

parent: null | GraphNode<T>

Generated using TypeDoc