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

GraphTheory

 PermuteVertices
 create copy of graph with permuted vertices
 IsomorphicCopy
 create isomorphic copy of graph

 Calling Sequence PermuteVertices(G, sigma) IsomorphicCopy(G, sigma)

Parameters

 G - graph sigma - (optional) a (permuted) list of the vertices of G

Description

 • The calling sequence PermuteVertices('G','sigma') returns a new graph H with Vertices(H) = sigma.  The list of neighbors data structure is reordered according to sigma so that the adjacency matrix of H will be different in general.  Attribute information, including vertex position information is also permuted according to sigma so that DrawGraph(H) will look identical to DrawGraph(G).
 • The calling sequence IsomorphicCopy('G','sigma') returns a new graph H where the list of neighbors data structure is reordered according to sigma but the vertex labels of H are the same as G. It also discards all attributes from G so that if H is drawn, it will not be obvious that H is isomorphic to G.
 • The calling sequence PermuteVertices('G') chooses a random permutation sigma of the vertices of G then returns H = PermuteVertices(G,sigma). Hence Vertices(H) is the permutation used.
 • The calling sequence IsomorphicCopy('G') chooses a random permutation sigma of the vertices of G and returns IsomorphicCopy('G','sigma').

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $G≔\mathrm{PathGraph}\left(5\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (1)
 > $\mathrm{Vertices}\left(G\right),\mathrm{Neighbors}\left(G\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]{,}\left[\left[{2}\right]{,}\left[{1}{,}{3}\right]{,}\left[{2}{,}{4}\right]{,}\left[{3}{,}{5}\right]{,}\left[{4}\right]\right]$ (2)
 > $H≔\mathrm{PermuteVertices}\left(G,\left[3,5,1,2,4\right]\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (3)
 > $\mathrm{Vertices}\left(H\right)$
 $\left[{3}{,}{5}{,}{1}{,}{2}{,}{4}\right]$ (4)
 > $\mathrm{Neighbors}\left(H\right)$
 $\left[\left[{2}{,}{4}\right]{,}\left[{4}\right]{,}\left[{2}\right]{,}\left[{3}{,}{1}\right]{,}\left[{3}{,}{5}\right]\right]$ (5)
 > $H≔\mathrm{IsomorphicCopy}\left(G,\left[3,5,1,2,4\right]\right)$
 ${H}{≔}{\mathrm{Graph 3: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (6)
 > $\mathrm{Vertices}\left(H\right),\mathrm{Neighbors}\left(H\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}\right]{,}\left[\left[{4}{,}{5}\right]{,}\left[{5}\right]{,}\left[{4}\right]{,}\left[{1}{,}{3}\right]{,}\left[{1}{,}{2}\right]\right]$ (7)
 > $H≔\mathrm{PermuteVertices}\left(G\right)$
 ${H}{≔}{\mathrm{Graph 4: an undirected graph with 5 vertices and 4 edge\left(s\right)}}$ (8)
 > $\mathrm{σ}≔\mathrm{Vertices}\left(H\right)$
 ${\mathrm{\sigma }}{≔}\left[{3}{,}{4}{,}{5}{,}{1}{,}{2}\right]$ (9)
 > $P≔\mathrm{PrismGraph}\left(3,3\right)$
 ${P}{≔}{\mathrm{Graph 5: an undirected graph with 6 vertices and 9 edge\left(s\right)}}$ (10)
 > $H≔\mathrm{IsomorphicCopy}\left(P,\left[4,1,2,6,5,3\right]\right)$
 ${H}{≔}{\mathrm{Graph 6: an undirected graph with 6 vertices and 9 edge\left(s\right)}}$ (11)
 > $\mathrm{DrawGraph}\left(P\right)$
 > $\mathrm{DrawGraph}\left(H,\mathrm{style}=\mathrm{spring}\right)$