spectral graph theory library
In mathematics, spectral graph theory is the study of the properties of a graph in relationship to the characteristic polynomial, eigenvalues, and eigenvectors of matrices associated with the graph, such as its adjacency matrix or Laplacian matrix.
$ npm install spektra
-
Eigenvalues
const { eigenvalues } = require('spectra'); const A = [[1, 2], [2, 1]]; const eig = eigenvalues(A); console.log(eig); // [3, -1]
-
Determinant
const { determinant } = require('spectra'); const A = [[1, 2], [2, 1]]; const det = determinant(A); console.log(det); // -3
-
Mean
const { mean } = require('spectra'); const A = [[1, 2], [2, 1]]; const m = mean(A); console.log(m); // 1.5
- Adjacency matrix
- Laplacian matrix.
- Characteristic polynomial
- Cospectrality
There are many ways to contribute to Spectra.
- Submit bugs and help us verify fixes as they are checked in.
- Review the source code changes.