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

GraphTheory

 GraphSpectrum
 compute spectrum of eigenvalues of a graph

 Calling Sequence GraphSpectrum(G, opt)

Parameters

 G - graph opt - (optional) the symbol exact or an equation of the form exact=true or false

Options

 • exact=true or false
 If exact or exact=true is specified, the eigenvalues are returned as exact expressions. If exact=false, the eigenvalues are returned as floating-point expressions. The default is false.

Description

 • The GraphSpectrum command returns the spectrum of the eigenvalues of the adjacency matrix of a specified graph. The output is a list $L$. Each element of $L$ is a list of size 2, where the first element is an eigenvalue and the second element is its multiplicity.
 • If argument exact or exact=true is provided, the eigenvalues are returned as exact expressions. Otherwise the eigenvalues are returned as floating-point expressions.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{C5}≔\mathrm{CycleGraph}\left(5\right)$
 ${\mathrm{C5}}{≔}{\mathrm{Graph 1: an undirected graph with 5 vertices and 5 edge\left(s\right)}}$ (1)
 > $\mathrm{GraphSpectrum}\left(\mathrm{C5}\right)$
 $\left[\left[{-1.618033990}{,}{2}\right]{,}\left[{0.6180339900}{,}{2}\right]{,}\left[{2.000000000}{,}{1}\right]\right]$ (2)
 > $\mathrm{GraphSpectrum}\left(\mathrm{C5},\mathrm{exact}\right)$
 $\left[\left[{-}\frac{\sqrt{{5}}}{{2}}{-}\frac{{1}}{{2}}{,}{2}\right]{,}\left[\frac{\sqrt{{5}}}{{2}}{-}\frac{{1}}{{2}}{,}{2}\right]{,}\left[{2}{,}{1}\right]\right]$ (3)
 > $f≔\mathrm{CharacteristicPolynomial}\left(\mathrm{C5},x\right)$
 ${f}{≔}{{x}}^{{5}}{-}{5}{}{{x}}^{{3}}{+}{5}{}{x}{-}{2}$ (4)
 > $\mathrm{factor}\left(f\right)$
 $\left({x}{-}{2}\right){}{\left({{x}}^{{2}}{+}{x}{-}{1}\right)}^{{2}}$ (5)