networks(deprecated)/induce - Maple Help

networks

 induce
 induces a subgraph in a graph

 Calling Sequence induce(Eset, G) induce(Vset, G)

Parameters

 Eset - set of edges from G Vset - set of vertices from G G - graph or network

Description

 • Important:The networks package has been deprecated. Use the superseding command GraphTheory[InducedSubgraph]instead.
 • This routine creates a subgraph of G from either a set of vertices and their incident edges or a set of edges and their ends.
 • This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[induce](...).

Examples

Important:The networks package has been deprecated. Use the superseding command GraphTheory[InducedSubgraph]instead.

 > $\mathrm{with}\left(\mathrm{networks}\right):$
 > $G≔\mathrm{complete}\left(5\right):$
 > $\mathrm{induce}\left(\left\{1,2,3,4\right\},G\right)$
 ${\mathbf{proc}}\left({x}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{GRAPH}}{,}{2}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{if}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Edges}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Edges}}\right){≔}\left\{{}\right\}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_EdgeIndex}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_EdgeIndex}}\right){≔}{\mathrm{table}}{}\left({\mathrm{symmetric}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Head}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Head}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Tail}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Tail}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Eweight}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Eweight}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Ends}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Ends}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Vertices}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Vertices}}\right){≔}\left\{{}\right\}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Vweight}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Vweight}}\right){≔}{\mathrm{table}}{}\left({\mathrm{sparse}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Ancestor}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Ancestor}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Daughter}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Daughter}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Neighbors}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Neighbors}}\right){≔}{\mathrm{table}}{}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Status}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Status}}\right){≔}\left\{{'}{\mathrm{SIMPLE}}{'}\right\}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{elif}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{=}{\mathrm{_Emaxname}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{then}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{thisproc}}{}\left({\mathrm{_Emaxname}}\right){≔}{0}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{else}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{return}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{'}{\mathrm{procname}}{}\left({\mathrm{args}}\right){'}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end if}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (1)
 > $\mathrm{ends}\left(\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{3}{,}{4}\right\}\right\}$ (2)
 > $H≔\mathrm{induce}\left(\mathrm{incident}\left(1,G\right),G\right):$
 > $\mathrm{ends}\left(H\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{5}\right\}\right\}$ (3)