This commit is contained in:
/usr/bin/nano
2020-01-25 15:14:42 +03:00
11 changed files with 84 additions and 75 deletions

View File

@@ -53,6 +53,7 @@ FloidAlgorithm.prototype.result = function(resultCallback)
// Remove all edges.
this.egdesCopy = this.graph.edges.slice();
this.removeAllEdges();
this.isGraphMulti = this.graph.isMulti();
this.graph.hasDirect = false;
@@ -206,7 +207,13 @@ FloidAlgorithm.prototype.restore = function()
for (var i = 0; i < this.egdesCopy.length; i ++)
{
this.graph.AddNewEdgeSafe(this.egdesCopy[i].vertex1, this.egdesCopy[i].vertex2, this.egdesCopy[i].isDirect, this.egdesCopy[i].weight);
var edge = this.graph.AddNewEdgeSafe(this.egdesCopy[i].vertex1,
this.egdesCopy[i].vertex2,
this.egdesCopy[i].isDirect,
this.egdesCopy[i].weight,
this.isGraphMulti);
//edge.model = this.egdesCopy[i].model;
}
}
@@ -216,6 +223,12 @@ FloidAlgorithm.prototype.updateMessage = function(save)
"<button type=\"button\" class=\"btn btn-default btn-xs\" id=\"showFloidMatrix\" style=\"float:right\">" + g_showDistMatrix + "</button>"
}
// Algorithm support multi graph
FloidAlgorithm.prototype.IsSupportMultiGraph = function ()
{
return false;
}
// Factory for connected components.
function CreateFloidAlgorithm(graph, app)
{