Calls fn on every vertex that is either connected to vertex by an undirected edge or is at the target end of a directed edge.