Skip to main content

graph_compute_adjacency_matrix

graph_compute_adjacency_matrix(graph, result, node_indices)

Computes the adjacency matrix of a graph. Writes 1 to matrix elements where nodes are connected, leaves existing values where there are no connections. Does NOT zero-fill the matrix before writing.

Kind: global function

ParamTypeDescription
graphGraph.<T>Input graph.
resultSquareMatrixOutput: Adjacency matrix (modified in-place).
node_indicesMap.<T, number>Map from graph nodes to matrix indices.