View source: R/create_matrices.R
adjacency_matrix | R Documentation |
An adjacency matrix is a square matrix with both rows and columns being indexed by vertices. For each entry, the number is proportional to the strength of the connection going from the vertex represented as the row and the vertex represented by the column. For undirected hypergraphs, this matrix is symmetric but this is usually not the case for directed.
adjacency_matrix(hype, normalise = FALSE, self_adj = FALSE, as_matrix = TRUE)
hype |
A hypergraph object |
normalise |
Whether the matrix should be normalised to either 1 or 0 |
self_adj |
Whether self adjacency should be represented |
as_matrix |
Whether the output should be coerced into a simple matrix |
Great care should be taken when using a hypergraph with mixed positive and negative real coefficients as there is a chance no adjacency will be registered for two adjacenct vertices. rhype does not check for these cases and they must be checked for by the user.
A matrix of adjacencies between vertices of a hypergraph.
h1 <- example_hype() adjacency_matrix(h1) h2 <- example_hype(oriented = TRUE, directed = TRUE) adjacency_matrix(h2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.