Add getNeighbors method to Graph.

This commit is contained in:
Oleksii Trekhleb
2018-04-11 08:42:17 +03:00
parent 04a2b08669
commit ddd7f9fe0d
2 changed files with 28 additions and 0 deletions

View File

@@ -25,6 +25,13 @@ export default class Graph {
return this.vertices[vertexKey];
}
/**
* @param {GraphVertex} vertex
*/
getNeighbors(vertex) {
return vertex.getNeighbors();
}
/**
* @param {GraphEdge} edge
* @returns {Graph}