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

Online Help

All Products    Maple    MapleSim

GraphTheory

 SeidelSwitch
 construct Seidel switch graph from graph

 Calling Sequence SeidelSwitch(G, S, opts)

Parameters

 G - undirected and unweighted graph S - list of vertices of the graph opts - one or more options as specified below

Options

 • inplace=truefalse
 Specifies whether the changes are applied to the original graph or to a copy. The default is true, meaning the original graph is changed.

Description

 • The SeidelSwitch command transforms the input graph to a new graph in such a way that, for each specified vertex, its neighbors become its non-neighbors and vice versa.
 • By default, the original graph is changed and the switching happens in place. By setting inplace=false the original graph remains unchanged.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{CycleGraph}\left(5\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected graph with 5 vertices and 5 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G\right)$
 > $\mathrm{Neighbors}\left(G,1\right)$
 $\left[{2}{,}{5}\right]$ (2)
 > $H≔\mathrm{SeidelSwitch}\left(G,\left[1,2\right],\mathrm{inplace}=\mathrm{false}\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected graph with 5 vertices and 7 edge\left(s\right)}}$ (3)
 > $\mathrm{Neighbors}\left(H,1\right)$
 $\left[{2}{,}{3}{,}{4}\right]$ (4)

Vertices 1 and 2 remain neighbors of each other

 > $\mathrm{DrawGraph}\left(H\right)$
 > $\mathrm{Edges}\left(H\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{4}{,}{5}\right\}\right\}$ (5)
 > $\mathrm{SeidelSwitch}\left(G,\left[1,2\right]\right)$
 ${\mathrm{Graph 1: an undirected graph with 5 vertices and 7 edge\left(s\right)}}$ (6)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}{,}\left\{{3}{,}{4}\right\}{,}\left\{{4}{,}{5}\right\}\right\}$ (7)

 See Also