Learn R Programming

HyperG (version 1.0.0)

hypergraph_as_adjacency_matrix: 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.

Value

a (sparse) matrix.

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.

See Also

as_adjacency_matrix, Matrix.

Examples

Run this code
# NOT RUN {
   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

# }

Run the code above in your browser using DataLab