assert length <= limit : "Found a path longer than limit.";
// Create the path and add to the result
Path path = new Path();
for (Node node : currPath)
{
path.addNode(node);
if (node.hasLabel(EDGE))
{
path.addEdge((Edge) node.getLabel(EDGE));
}
}
path.addNode(target);
if (!result.containsKey(target))
{
result.put(target, new HashMap<Integer, List<Path>>());
}