| igraph Reference Manual |
|---|
int igraph_laplacian(const igraph_t *graph, igraph_matrix_t *res, igraph_bool_t normalized);
The graph Laplacian matrix is similar to an adjacency matrix but contains -1's instead of 1's and the vertex degrees are included in the diagonal. So the result for edge i--j is -1 if i!=j and is equal to the degree of vertex i if i==j. igraph_laplacian will work on a directed graph (although this does not seem to make much sense) and ignores loops.
The normalized version of the Laplacian matrix has 1 in the diagonal and -1/sqrt(d[i]d[j]) if there is an edge from i to j.
The first version of this function was written by Vincent Matossian.
Arguments:
|
Pointer to the graph to convert. |
|
Pointer to an initialized matrix object, it will be resized if needed. |
|
Whether to create a normalized Laplacian matrix. |
Returns:
Error code. |
Time complexity: O(|V||V|), |V| is the number of vertices in the graph.
| << 11. Spectral properties | 12. Non-simple graphs: multiple and loop edges >> |