Learn R Programming

memnet (version 0.1.0)

get_adjlist: Get adjacency list

Description

Get list containing adjacent, i.e., neighboring, nodes for each node in the graph. Nodes are returned as their row indices of the adjacency matrix.

Usage

get_adjlist(adj)

Arguments

adj

numeric matrix specifying the adjacency matrix.

Value

A list of vectors containing the indices of adjacent nodes.

Examples

Run this code
# NOT RUN {
# generate watts strogatz graph
network = grow_ws(n = 6, k = 2, p = .5)

# transform to adjlist
get_adjlist(network)

# }

Run the code above in your browser using DataLab