Added forEach iterator for graph.