Incidence matrix of a bipartite graph
This function can return a sparse or dense incidence matrix of a bipartite network. The incidence matrix is an $n$ times $m$ matrix, $n$ and $m$ are the number of vertices of the two kinds.
get.incidence(graph, types=NULL, attr=NULL, names=TRUE, sparse=FALSE)
- The input graph. The direction of the edges is ignored in directed graphs.
- An optional vertex type vector to use instead of the
typevertex attribute. You must supply this argument if the graph has no
NULLor a character string giving an edge attribute name. If
NULL, then a traditional incidence matrix is returned. If not
NULLthen the values of the given edge attribute are included in the incid
- Logical scalar, if
TRUEand the vertices in the graph are named (i.e. the graph has a vertex attribute called
name), then vertex names will be added to the result as row and column names. Otherwise the ids of the vert
- Logical scalar, if it is
TRUEthen a sparse matrix is created, you will need the
Matrixpackage for this.
Bipartite graphs have a
type vertex attribute in
igraph, this is boolean and
FALSE for the vertices of the first
TRUE for vertices of the second kind.
- A sparse or dense matrix.
- Bipartite graph
- Two-mode network
- Incidence matrix
graph.incidence for the opposite operation.
g <- graph.bipartite( c(0,1,0,1,0,0), c(1,2,2,3,3,4) ) get.incidence(g)