hypergraph_as_adjacency_matrix: Adjacency Matrix of a Hypergraph.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/as_adjacency.R

Description

Returns the adjacency matrix, computed from the incidence matrix.

Usage

1
2

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
   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

HyperG documentation built on March 4, 2021, 5:06 p.m.