Fix hamiltonpath for non multi graphs.

This commit is contained in:
Unick Soft 2020-05-03 21:25:54 +02:00
parent b4c9fdd62a
commit 4fbe526813

View File

@ -55,8 +55,16 @@ FindHamiltonianPath.prototype.resultCallback = function(pathObjects, properties,
var nodesEdgesPath = this.GetNodesEdgesPath(results, 1, results.length - 1);
var nodesPath = this.GetNodesPath(results, 1, results.length - 1);
outputResult["pathsWithEdges"] = [];
outputResult["pathsWithEdges"].push(nodesEdgesPath);
if (this.graph.isMulti())
{
outputResult["pathsWithEdges"] = [];
outputResult["pathsWithEdges"].push(nodesEdgesPath);
}
else
{
outputResult["paths"] = [];
outputResult["paths"].push(nodesEdgesPath);
}
this.selectedObjects = [];
for (var i = 0; i < pathObjects.length; i++)