mpd: Maximal Prime Decomposition

View source: R/helper_mpd.R

mpdR Documentation

Maximal Prime Decomposition

Description

Find the maximal prime decomposition and its associated junction tree

Usage

mpd(x, save_graph = TRUE)

## S3 method for class 'matrix'
mpd(x, save_graph = TRUE)

## S3 method for class 'cpt_list'
mpd(x, save_graph = TRUE)

Arguments

x

Either a neighbor matrix or a cpt_list object

save_graph

Logical indicating if the moralized graph should be kept. Useful when x is a cpt_list object.

Value

- prime_ints: a list with the prime components, - flawed: indicating which prime components that are triangulated - jt_collect: the MPD junction tree prepared for collecting

Examples


library(igraph)
el <- matrix(c(
"A", "T",
"T", "E",
"S", "L",
"S", "B",
"L", "E",
"E", "X",
"E", "D",
"B", "D"),
 nc = 2,
 byrow = TRUE
)

g <- igraph::graph_from_edgelist(el, directed = FALSE)
A <- igraph::as_adjacency_matrix(g, sparse = FALSE)
mpd(A)

jti documentation built on April 12, 2022, 9:05 a.m.