Defined in: packages/graph/src/grid-adjacency.ts:29
An Adjacency over a rows × columns board, where cell (row, column) is vertex row * columns + column.
Extends
Section titled “Extends”Properties
Section titled “Properties”vertexCount
Section titled “vertexCount”
readonlyvertexCount:number
Defined in: packages/graph/src/graph.ts:49
Vertices are the integers 0 … vertexCount - 1.
Inherited from
Section titled “Inherited from”directed
Section titled “directed”
readonlydirected:boolean
Defined in: packages/graph/src/graph.ts:51
Whether an edge from u to v leaves v without a way back to u.
Inherited from
Section titled “Inherited from”forEachNeighbor
Section titled “forEachNeighbor”
readonlyforEachNeighbor: (vertex,visit) =>void
Defined in: packages/graph/src/graph.ts:61
Call visit(neighbor, weight) once per stored edge out of vertex, in
ascending neighbor id, with parallel copies in insertion order. An
unweighted edge reports weight 1. A hand-written adjacency reports a
finite number: an algorithm reading it throws INVALID_VERTEX for a
neighbor outside the graph and INVALID_WEIGHT for any other weight.
Parameters
Section titled “Parameters”vertex
Section titled “vertex”number
(neighbor, weight) => void
Returns
Section titled “Returns”void
Throws
Section titled “Throws”With code INVALID_VERTEX when vertex is not in 0 … vertexCount - 1.
Inherited from
Section titled “Inherited from”
readonlyrows:number
Defined in: packages/graph/src/grid-adjacency.ts:30
columns
Section titled “columns”
readonlycolumns:number
Defined in: packages/graph/src/grid-adjacency.ts:31
readonlycell: (row,column) =>number
Defined in: packages/graph/src/grid-adjacency.ts:37
The vertex of the cell at (row, column).
Parameters
Section titled “Parameters”number
column
Section titled “column”number
Returns
Section titled “Returns”number
Throws
Section titled “Throws”With code INVALID_VERTEX when the position is off the board.