GraphTheory
SeidelSwitch
construct Seidel switch graph from graph
Calling Sequence
Parameters
Options
Description
Examples
SeidelSwitch(G, S, opts)
G
-
undirected and unweighted graph
S
list of vertices of the graph
opts
one or more options as specified below
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.
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.
with⁡GraphTheory:
G≔CycleGraph⁡5
G≔Graph 1: an undirected graph with 5 vertices and 5 edge(s)
DrawGraph⁡G
Neighbors⁡G,1
2,5
H≔SeidelSwitch⁡G,1,2,inplace=false
H≔Graph 2: an undirected graph with 5 vertices and 7 edge(s)
Neighbors⁡H,1
2,3,4
Vertices 1 and 2 remain neighbors of each other
DrawGraph⁡H
Edges⁡H
1,2,1,3,1,4,2,4,2,5,3,4,4,5
SeidelSwitch⁡G,1,2
Graph 1: an undirected graph with 5 vertices and 7 edge(s)
Edges⁡G
See Also
Neighbors
Download Help Document