Learn R Programming

jti (version 1.0.0)

mpd: Maximal Prime Decomposition

Description

Find the maximal prime decomposition and its associated junction tree

Usage

mpd(x, save_graph = TRUE)

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

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

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

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.

Examples

Run this code

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)

Run the code above in your browser using DataLab