mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-04 00:36:45 +00:00
Fix hamiltonpath for non multi graphs.
This commit is contained in:
parent
b4c9fdd62a
commit
4fbe526813
@ -55,8 +55,16 @@ FindHamiltonianPath.prototype.resultCallback = function(pathObjects, properties,
|
|||||||
var nodesEdgesPath = this.GetNodesEdgesPath(results, 1, results.length - 1);
|
var nodesEdgesPath = this.GetNodesEdgesPath(results, 1, results.length - 1);
|
||||||
var nodesPath = this.GetNodesPath(results, 1, results.length - 1);
|
var nodesPath = this.GetNodesPath(results, 1, results.length - 1);
|
||||||
|
|
||||||
|
if (this.graph.isMulti())
|
||||||
|
{
|
||||||
outputResult["pathsWithEdges"] = [];
|
outputResult["pathsWithEdges"] = [];
|
||||||
outputResult["pathsWithEdges"].push(nodesEdgesPath);
|
outputResult["pathsWithEdges"].push(nodesEdgesPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outputResult["paths"] = [];
|
||||||
|
outputResult["paths"].push(nodesEdgesPath);
|
||||||
|
}
|
||||||
this.selectedObjects = [];
|
this.selectedObjects = [];
|
||||||
|
|
||||||
for (var i = 0; i < pathObjects.length; i++)
|
for (var i = 0; i < pathObjects.length; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user