incidence_matrix {HyperG}R Documentation

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.

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.

Value

A sparse incidence matrix.

Author(s)

David J. Marchette dmarchette@gmail.com

Examples

	set.seed(2343)
   g <- sample_gnp(10,.1)
	h <- hypergraph_from_edgelist(list(1:3,3:4,c(3,5,7)))
	

[Package HyperG version 1.0.0 Index]