protected void addTimeStamp(Integer current){
        time++;
        in.put(current, time);
        for (Integer neighbor : graph.getNeighbors(current)) {

            if(!in.containsKey(neighbor))
                addTimeStamp(neighbor);
        }
        time++;
        out.put(current, time);
    }
This is a graph with timestamps (in and out) in each vertex.
src/algo/graph/GraphWithTimeStamp.java