Graph.path() method

Every vertex reachable from one vertex, in the order a depth-first walk finds them.

Signature:

path(vertex: T): IterableIterator<T>;

Parameters

Parameter

Type

Description

vertex

T

Vertex to start from.

Returns:

IterableIterator<T>

An iterator over the reachable vertices.

Remarks

The reachable SET, not the longest path — each vertex appears once however many routes lead to it, and the starting vertex is the first entry. Reading it as a path is what makes a cyclic graph look as though it terminates.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.