Added multi graph supports for some algorithms.

This commit is contained in:
Oleg Sh
2020-01-25 13:18:26 +02:00
parent 7f3ae378c9
commit 0059cebea0
8 changed files with 83 additions and 74 deletions

View File

@@ -120,6 +120,21 @@ Graph.prototype.FindEdge = function(id1, id2)
return this.FindEdgeAny(id1, id2);
}
Graph.prototype.FindEdgeById = function(edgeId)
{
var res = null;
for (var i = 0; i < this.edges.length; i++)
{
if (this.edges[i].id == edgeId)
{
res = this.edges[i];
break;
}
}
return res;
}
Graph.prototype.FindEdgeAny = function(id1, id2)
{
var res = null;