private void dfs(Graph<?> G, Object v) {
        this.marked.put(v, true);
        this.id.put(v, initId);
        for (Object temp : G.getAdjacentVertices(v)) {
            if (!marked.get(temp)) {
                dfs(G, temp);
            }
        }

    }