public void dfs(int[] incoming, int begin, ArrayList<DirectedGraphNode> ans, HashMap<Integer, DirectedGraphNode> map, HashSet<Integer> visited) {
        if (ans.size() >= incoming.length)
            return;
        visited.add(begin);
        ans.add(map.get(begin));
        for (DirectedGraphNode node : map.get(begin).neighbors) {
            incoming[node.label] -= 1;
            if (incoming[node.label] == 0) {
                dfs(incoming, node.label, ans, map, visited);
            }
        }
    }