code: private Set<Deque<Archive>> findPaths(Graph<Archive> graph, Archive target) {
  
          // path is in reversed order
          Deque<Archive> path = new LinkedList<>();
          path.push(target);
  
          Set<Edge<Archive>> visited = new HashSet<>();
  
          Deque<Edge<Archive>> deque = new LinkedList<>();
          deque.addAll(graph.edgesFrom(target));
          if (deque.isEmpty()) {
              return makePaths(path).collect(Collectors.toSet());
          }
  
          Set<Deque<Archive>> allPaths = new HashSet<>();
          while (!deque.isEmpty()) {
              Edge<Archive> edge = deque.pop();
  
              if (visited.contains(edge))
                  continue;
  
              Archive node = edge.v;
              path.addLast(node);
              visited.add(edge);
  
              Set<Edge<Archive>> unvisitedDeps = graph.edgesFrom(node)
                      .stream()
                      .filter(e -> !visited.contains(e))
                      .collect(Collectors.toSet());
  
              trace("visiting %s %s (%s)%n", edge, path, unvisitedDeps);
              if (unvisitedDeps.isEmpty()) {
                  makePaths(path).forEach(allPaths::add);
                  path.removeLast();
              }
  
              // push unvisited adjacent edges
              unvisitedDeps.stream().forEach(deque::push);
  
  
              // when the adjacent edges of a node are visited, pop it from the path
              while (!path.isEmpty()) {
                  if (visited.containsAll(graph.edgesFrom(path.peekLast())))
                      path.removeLast();
                  else
                      break;
              }
          }
  
         return allPaths;
      }
docs: Returns all paths reachable from the given targets.