public static List<Node[]> ComputePossibilities(List<Node[]> currentList, int depth)
{
if (depth == 0)
{
return currentList;
}
else
{
List<Node[]> ret = new();
foreach (Node[] path in currentList)
{
foreach (Node node in path)
{
foreach (Node nextNode in node.NextNodes)
{
ret.Add(path.ExceptNthOccurrenceOf(node, path.Count(x => x == node) - 1).Append(nextNode).ToArray());
}
}
}
if (ret.Count == 0)
{
return currentList;
}
else
{
return ComputePossibilities(ret, depth - 1);
}
}
}
public static List<Node[]> ComputePossibilities(List<Node[]> currentList, int depth)
{
if (depth == 0)
{
return currentList;
}
else
{
List<Node[]> ret = new();
foreach (Node[] path in currentList)
{
foreach (Node node in path)
{
foreach (Node nextNode in node.NextNodes)
{
ret.Add(path.ExceptNthOccurrenceOf(node, path.Count(x => x == node) - 1).Append(nextNode).ToArray());
}
}
}
if (ret.Count == 0)
{
return currentList;
}
else
{
return ComputePossibilities(ret, depth - 1);
}
}
}