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