public static <V, E extends GEdge<V>> Set<E> getEdgesFrom(GDirectedGraph<V, E> g,
			Collection<V> vertices, boolean topDown) {

		GraphNavigator<V, E> navigator = null;
		if (topDown) {
			navigator = GraphNavigator.topDownNavigator();
		}
		else {
			navigator = GraphNavigator.bottomUpNavigator();
		}

		Set<E> edges = new HashSet<>();
		Set<V> newlyPending = new HashSet<>();

		Set<V> pending = new HashSet<>(vertices);
		while (!pending.isEmpty()) {
			for (V parent : pending) {

				Collection<E> outEdges = navigator.getEdges(g, parent);
				for (E e : outEdges) {
					V destination = navigator.getEnd(e);
					if (edges.add(e)) {
						newlyPending.add(destination);
					}
				}
			}
			pending = newlyPending;
			newlyPending = new HashSet<>();
		}
		return edges;
	}
Returns a set of all edges that are reachable from the given collection of vertices.

@param g the graph
@param vertices the vertices for which to get edges
@param topDown true for outgoing edges; false for incoming edges
@return the set of edges
Ghidra/Framework/Graph/src/main/java/ghidra/graph/GraphAlgorithms.java