code: public void reset()
     {
        unusedEdges.addAll(usedEdges);
        unusedNodes.addAll(usedNodes);
  
        usedEdges.clear();
        usedNodes.clear();
     }
docs: Takes all the used nodes and makes them unused.