Find number of unique routes to specific node using Depth First Search
I have a directed graph with vertexes 123456. Using a depth first search, if I wanted to be able to find the number of unique routes from 1-4 (for example), how would I go about doing it? Here is my current DFS. private final Map<Character, Node> mNodes; private final List<Edge> mEdges; private List<Node> mVisited = new ArrayList<>(); int weight; int numberOfPaths; public DepthFirstSearch(Graph graph){ mNodes = graph.getNodes(); mEdges = new ArrayList<>(graph.getEdges()); for(Node node : mNodes.values()){ node.setVisited(false); } } public void depthFirstSearch(Node source){ source.setVisited