A bipartite graph is projected into two one-mode networks
1 2 3 4 5 6 7 8
The input graph. It can be directed, but edge directions are ignored during the computation.
An optional vertex type vector to use instead of the
This argument can be used to specify the order of the
projections in the resulting list. If given, then it is considered as a
vertex id (or a symbolic vertex name); the projection containing this vertex
will be the first one in the result list. This argument is ignored if only
one projection is requested in argument
A character scalar to specify which projection(s) to calculate. The default is to calculate both.
Logical scalar, whether to remove the
Bipartite graphs have a
type vertex attribute in igraph, this is
FALSE for the vertices of the first kind and
for vertices of the second kind.
bipartite_projection_size calculates the number of vertices and edges
in the two projections of the bipartite graphs, without calculating the
projections themselves. This is useful to check how much memory the
projections would need if you have a large bipartite graph.
bipartite_projection calculates the actual projections. You can use
probe1 argument to specify the order of the projections in the
result. By default vertex type
FALSE is the first and
bipartite_projection keeps vertex attributes.
A list of two undirected graphs. See details above.
Gabor Csardi firstname.lastname@example.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
## Projection of a full bipartite graph is a full graph g <- make_full_bipartite_graph(10,5) proj <- bipartite_projection(g) graph.isomorphic(proj[], make_full_graph(10)) graph.isomorphic(proj[], make_full_graph(5)) ## The projection keeps the vertex attributes M <- matrix(0, nr=5, nc=3) rownames(M) <- c("Alice", "Bob", "Cecil", "Dan", "Ethel") colnames(M) <- c("Party", "Skiing", "Badminton") M <- sample(0:1, length(M), replace=TRUE) M g2 <- graph_from_incidence_matrix(M) g2$name <- "Event network" proj2 <- bipartite_projection(g2) print(proj2[], g=TRUE, e=TRUE) print(proj2[], g=TRUE, e=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.