Learn R Programming

HyperG (version 1.0.0)

as.bipartite: Hypergraph as a bipartite graph.

Description

Converts a hypergraph (or graph) into a bipartite graph.

Usage

as.bipartite(h)

Arguments

h

a hypergraph or a graph.

Value

an igraph bipartite graph.

Details

This converts a hypergraph or a graph into a bipartite graph, by taking the incidence matrix and treating this as the incidence matrix of a bipartite graph. It uses graph_from_incidence_matrix to perform the conversion.

See Also

graph_from_incidence_matrix.

Examples

Run this code
# NOT RUN {
   h <- hypergraph_from_edgelist(list(letters[1:3],
           letters[c(2,4,7)],
  		  	  letters[5:8]))
   g <- as.bipartite(h)


# }

Run the code above in your browser using DataLab