WLJS LogoWLJS Notebook

VertexOutComponentGraph

VertexOutComponentGraph[g, {v1, v2, ...}] gives the subgraph of the graph g generated by the vertices that have a directed path from at least one of v1, v2, ....

VertexOutComponentGraph[g, {v1, v2, ...}, k] gives the subgraph of g generated by vertices with a directed path of at most length k from at least one of v1, v2, ....

VertexOutComponentGraph[g, {v1, v2, ...}, {k}] gives the subgraph of g generated by vertices of length exactly k.

VertexOutComponentGraph[{v -> w, ...}, ...] uses rules v -> w to specify the graph g.

Examples

g = Graph[{1 -> 2, 2 -> 3, 3 -> 4, 1 -> 5}];
VertexOutComponentGraph[g, {1}]
VertexOutComponentGraph[g, {1}, 2]

Please visit the official Wolfram Language Reference for more details.

On this page