added algorithm condensation of the graph