MCPcopy
hub / github.com/trekhleb/javascript-algorithms / getVerticesIndices

Method getVerticesIndices

src/data-structures/graph/Graph.js:169–176  ·  view source on GitHub ↗

* @return {object}

()

Source from the content-addressed store, hash-verified

167 * @return {object}
168 */
169 getVerticesIndices() {
170 const verticesIndices = {};
171 this.getAllVertices().forEach((vertex, index) => {
172 verticesIndices[vertex.getKey()] = index;
173 });
174
175 return verticesIndices;
176 }
177
178 /**
179 * @return {*[][]}

Callers 4

getAdjacencyMatrixMethod · 0.95
Graph.test.jsFile · 0.80
bfTravellingSalesmanFunction · 0.80
hamiltonianCycleFunction · 0.80

Calls 2

getAllVerticesMethod · 0.95
getKeyMethod · 0.45

Tested by

no test coverage detected