View source: R/create_matrices.R
| incidence_matrix | R Documentation | 
An incidence matrix has rows indexed by vertices and columns indexed by hyperedges. Each entry is non-zero if the associated vertex is a member of the associated hyperedge. For an oriented hypergraph, this returns a list of two matrices with the first representing incidence to one end of the hyperedges and the second representing incidence to the other end. For a directed hypergraph the first represents incidence to the tail of a hyperedge and the second represents incidence to the head.
incidence_matrix(hype, augment_oriented = TRUE, as_matrix = TRUE)
hype | 
 A hypergraph object  | 
augment_oriented | 
 Whether to augment an oriented hypergraph  | 
as_matrix | 
 Whether to coerce the result to a simple matrix  | 
It is hard to use the incidence matrices of oriented undirected hypergraphs
in calculations. The augment_oriented option turns the hypergraph into a
directed hypergraph, but each hyperedge is represented twice, once pointing
in each direction. This is much easier to use for further calculations.
An incidence matrix or a list of two incidence matrices.
h1 <- example_hype() incidence_matrix(h1) h2 <- example_hype(oriented = TRUE, directed = TRUE) incidence_matrix(h2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.