The spectrum of a graph G is the set of the eigenvalues of the adjacency matrix A corresponding to G. For simple graphs, these eigenvalues are all real since A must be symmetric. The user should be aware that Macaulay 2 does not give exact values for these eigenvalues, they are numerical approximations, but it is still a good tool to use to check if two graphs are isomorphic; isomorphic graphs share the same spectrum although the converse is not necessarily true.
i1 : spectrum completeGraph 6 o1 = {-1, -1, -1, -1, -1, 5} o1 : List |
i2 : spectrum graphLibrary "petersen" o2 = {-2, -2, -2, -2, 1, 1, 1, 1, 1, 3} o2 : List |
The object spectrum is a method function.