Skip to content

@graphty/algorithms / index / getConnectedComponent

Function: getConnectedComponent() ​

getConnectedComponent(graph, nodeId): NodeId[]

Defined in: algorithms/components/connected.ts:121

Get the connected component containing a specific node

Parameters ​

graph ​

Graph

The input graph (must be undirected)

nodeId ​

NodeId

The node ID to find the component for

Returns ​

NodeId[]

Array of node IDs in the same component as the specified node