Add edge_foreach for graph data structure