Skip to contents

Compare Two Adjacency Lists

Usage

compare.adj.lists(adj.list1, adj.list2, verbose = FALSE)

Arguments

adj.list1

First adjacency list.

adj.list2

Second adjacency list.

verbose

Logical; print the indices of vertices with different neighbor sets. Defaults to FALSE.

Value

TRUE when each vertex has the same neighbor set in both lists, ignoring order; otherwise FALSE.

Examples

graph <- list(c(2L, 3L), 1L, 1L)
compare.adj.lists(graph, list(c(3L, 2L), 1L, 1L))
#> [1] TRUE