View source: R/structural.properties.R
laplacian_matrix | R Documentation |
The Laplacian of a graph.
laplacian_matrix(
graph,
weights = NULL,
sparse = igraph_opt("sparsematrices"),
normalization = c("unnormalized", "symmetric", "left", "right"),
normalized
)
graph |
The input graph. |
weights |
An optional vector giving edge weights for weighted Laplacian
matrix. If this is |
sparse |
Logical scalar, whether to return the result as a sparse
matrix. The |
normalization |
The normalization method to use when calculating the Laplacian matrix. |
normalized |
Deprecated, use |
The Laplacian Matrix of a graph is a symmetric matrix having the same number of rows and columns as the number of vertices in the graph and element (i,j) is d[i], the degree of vertex i if if i==j, -1 if i!=j and there is an edge between vertices i and j and 0 otherwise.
The Laplacian matrix can also be normalized, with several conventional normalization methods. “unnormalized” Unnormalized Laplacian. “symmetric” Symmetric normalized Laplacian. “left” Left-stochastic normalized Laplacian. “right” Right-stochastic normalized Laplacian.
The weighted version of the Laplacian simply works with the weighted degree instead of the plain degree. I.e. (i,j) is d[i], the weighted degree of vertex i if if i==j, -w if i!=j and there is an edge between vertices i and j with weight w, and 0 otherwise. The weighted degree of a vertex is the sum of the weights of its adjacent edges.
A numeric matrix.
Gabor Csardi csardi.gabor@gmail.com
g <- make_ring(10)
laplacian_matrix(g)
laplacian_matrix(g, normalization = "unnormalized")
laplacian_matrix(g, normalization = "unnormalized", sparse = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.