hypergraph_as_adjacency_matrix {HyperG}R Documentation

Adjacency Matrix of a Hypergraph.

Description

Returns the adjacency matrix, computed from the incidence matrix.

Usage

hypergraph_as_adjacency_matrix(h)
hadjacency(h)

Arguments

h

a hypergraph.

Details

The adjacency matrix is a weighted adjacency matrix corresponding to code(t(M) diagonal of the matrix set to 0. hadjacency is an alias for the longer named function.

Value

a (sparse) matrix.

Author(s)

David J. Marchette dmarchette@gmail.com

See Also

as_adjacency_matrix, Matrix.

Examples

   h <- hypergraph_from_edgelist(list(1:4,2:5))
	hypergraph_as_adjacency_matrix(h)

# returns:
# 5 x 5 Matrix of class "dgeMatrix"
#   1 2 3 4 5
# 1 0 1 1 1 0
# 2 1 0 2 2 1
# 3 1 2 0 2 1
# 4 1 2 2 0 1
# 5 0 1 1 1 0


[Package HyperG version 1.0.0 Index]