MCPcopy
hub / github.com/google/guava / reachableNodes

Method reachableNodes

guava/src/com/google/common/graph/Graphs.java:278–281  ·  view source on GitHub ↗

Returns the set of nodes that are reachable from {@code node}. Specifically, it returns all nodes {@code v} such that there exists a path (a sequence of adjacent outgoing edges) starting at {@code node} and ending at {@code v}. This implementation includes {@code node} as the first element in the re

(Graph<N> graph, N node)

Source from the content-addressed store, hash-verified

276 * @since 33.1.0 (present with return type {@code Set} since 20.0)
277 */
278 public static <N> ImmutableSet<N> reachableNodes(Graph<N> graph, N node) {
279 checkArgument(graph.nodes().contains(node), NODE_NOT_IN_GRAPH, node);
280 return ImmutableSet.copyOf(Traverser.forGraph(graph).breadthFirst(node));
281 }
282
283 // Graph mutation methods
284

Callers 1

reachableNodesMethod · 0.95

Calls 6

copyOfMethod · 0.95
forGraphMethod · 0.95
containsMethod · 0.65
nodesMethod · 0.65
checkArgumentMethod · 0.45
breadthFirstMethod · 0.45

Tested by

no test coverage detected