Skip to content

create-graph-from-matrix ​

Guide: /guide/algorithms/graph/create-graph-from-matrix

Signature ​

ts
createGraphFromMatrix(matrix, fieldsList, type);

Params: ​

NameTypeRequiredDefaultDescription
matrixTypeArrayMatrix+Adjacency matrix N*N
fieldsListArray<T>+Ordered list of all vertices
typeEnumGraphType+UNDIRECTED/DIRECTED

Returns: ​

IGraph<T> ​


MIT Licensed