Added multigraph support for hamiltonian loop/path

This commit is contained in:
Unick Soft
2020-04-01 21:21:20 +02:00
parent fe4f14970b
commit aa1be3fae5
5 changed files with 88 additions and 12 deletions

View File

@@ -250,7 +250,23 @@ BaseAlgorithmEx.prototype.GetNodesPath = function(array, start, count)
var res = [];
for (var index = start; index < start + count; index++)
{
res.push(array[index].value);
if (array[index].type == 4)
{
res.push(array[index].value);
}
}
return res;
}
BaseAlgorithmEx.prototype.GetNodesEdgesPath = function(array, start, count)
{
var res = [];
for (var index = start; index < start + count; index++)
{
if (array[index].type == 4 || array[index].type == 5)
{
res.push(array[index].value);
}
}
return res;
}