is_decomposable: A test for decomposability in undirected graphs

Description Usage Arguments Value Examples

View source: R/helper_decomp_graphs.R

Description

This function returns TRUE if the graph is decomposable and FALSE otherwise

Usage

1

Arguments

adj

Adjacency list of an undirected graph

Value

Logial describing whether or not adj is decomposable

Examples

1
2
3
4
5
6
# 4-cycle:
adj <- list(a = c("b", "d"), b = c("a", "c"), c = c("b", "d"), d = c("a", "c"))
is_decomposable(adj) # FALSE
# Two triangles:
adj2 <- list(a = c("b", "d"), b = c("a", "c", "d"), c = c("b", "d"), d = c("a", "c", "b"))
is_decomposable(adj2) # TRUE

ess documentation built on May 31, 2021, 9:10 a.m.