Learn R Programming

HyperG (version 1.0.0)

incidence_matrix: Graph Incidence Matrix.

Description

Converts a graph to an incidence matrix. Not the bipartite version.

Usage

incidence_matrix(g)
hypergraph_as_incidence_matrix(h)

Arguments

g

a graph or hypergraph.

h

a hypergraph.

Value

A sparse incidence matrix.

Details

An incidence matrix has gorder(g) columns and gsize(g) rows. incidence_matrix can be called on either a graph or a hypergraph. It calls hypergraph_as_incidence_matrix in the latter case.

Examples

Run this code
# NOT RUN {
	set.seed(2343)
   g <- sample_gnp(10,.1)
	h <- hypergraph_from_edgelist(list(1:3,3:4,c(3,5,7)))
	
# }

Run the code above in your browser using DataLab