InducedSubgraph - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

GraphTheory

 InducedSubgraph
 construct induced subgraph

 Calling Sequence InducedSubgraph(G, S)

Parameters

 G - graph S - set or list of vertices

Description

 • The InducedSubgraph command returns the subgraph induced by a specified set (or list) of vertices.
 • To construct a subgraph using a set of edges, use the Subgraph command.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{C6}≔\mathrm{CycleGraph}\left(6\right)$
 ${\mathrm{C6}}{≔}{\mathrm{Graph 1: an undirected graph with 6 vertices and 6 edge\left(s\right)}}$ (1)
 > $H≔\mathrm{InducedSubgraph}\left(\mathrm{C6},\left[1,2,6\right]\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected graph with 3 vertices and 2 edge\left(s\right)}}$ (2)
 > $\mathrm{Vertices}\left(H\right)$
 $\left[{1}{,}{2}{,}{6}\right]$ (3)
 > $\mathrm{Edges}\left(H\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{6}\right\}\right\}$ (4)
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $P≔\mathrm{PetersenGraph}\left(\right)$
 ${P}{≔}{\mathrm{Graph 3: an undirected graph with 10 vertices and 15 edge\left(s\right)}}$ (5)
 > $\mathrm{DrawGraph}\left(P\right)$
 > $H≔\mathrm{InducedSubgraph}\left(P,\left[1,2,3,6,7,9\right]\right)$
 ${H}{≔}{\mathrm{Graph 4: an undirected graph with 6 vertices and 6 edge\left(s\right)}}$ (6)
 > $\mathrm{DrawGraph}\left(H\right)$