Add multigraph support. Visualization and some algorithms.

This commit is contained in:
Unick Soft
2019-10-05 16:11:40 +02:00
parent c580c5aef9
commit 063c2f9ec0
21 changed files with 367 additions and 85 deletions

View File

@@ -76,7 +76,7 @@ FindConnectedComponentNew.prototype.calculate = function(fillUpText = false)
for (j = 0; j < connectedVertex[stackElement.id].length; j++)
{
var nextVertex = connectedVertex[stackElement.id][j];
var connectedEdge = this.graph.FindEdge(stackElement.id, nextVertex.id);
var connectedEdge = this.graph.FindEdgeAny(stackElement.id, nextVertex.id);
if (stack.indexOf(nextVertex) < 0)
{
stack.push(nextVertex);
@@ -113,6 +113,12 @@ FindConnectedComponentNew.prototype.getPriority = function()
return 0;
}
// Algorithm support multi graph
FindConnectedComponentNew.prototype.IsSupportMultiGraph = function()
{
return true;
}
// Factory for connected components.
function CreateConnectedComponetsNew(graph, app)