## package spectral

`import "gonum.org/v1/gonum/graph/spectral"`

Package spectral provides graph spectral analysis functions.

### Index ¶

### Types ¶

#### type Laplacian ¶

type Laplacian struct { // Matrix holds the Laplacian matrix. mat.Matrix // Nodes holds the input graph nodes. Nodes []graph.Node // Index is a mapping from the graph // node IDs to row and column indices. Index map[int64]int }

Laplacian is a graph Laplacian matrix.

#### func NewLaplacian ¶

func NewLaplacian(g graph.Undirected) Laplacian

NewLaplacian returns a Laplacian matrix for the simple undirected graph g. The Laplacian is defined as D-A where D is a diagonal matrix holding the degree of each node and A is the graph adjacency matrix of the input graph. If g contains self edges, NewLaplacian will panic.

#### func NewRandomWalkLaplacian ¶

NewRandomWalkLaplacian returns a damp-scaled random walk Laplacian matrix for the simple graph g. The random walk Laplacian is defined as I-D^(-1)A where D is a diagonal matrix holding the degree of each node and A is the graph adjacency matrix of the input graph. If g contains self edges, NewRandomWalkLaplacian will panic.

#### func NewSymNormLaplacian ¶

func NewSymNormLaplacian(g graph.Undirected) Laplacian

NewSymNormLaplacian returns a symmetric normalized Laplacian matrix for the simple undirected graph g. The normalized Laplacian is defined as I-D^(-1/2)AD^(-1/2) where D is a diagonal matrix holding the degree of each node and A is the graph adjacency matrix of the input graph. If g contains self edges, NewSymNormLaplacian will panic.

### Source Files ¶

doc.go laplacian.go

- Version
- v0.14.0 (latest)
- Published
- Aug 19, 2023
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 5 hours ago –

Tools for package owners.