knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This is replication code for the manuscript by Hu and Evans (2022).

library(imset)

Number of Bidirected Graphs that do not define the model

data(bidi5)

dm <- logical(length(bidi5))
for (i in seq_along(bidi5)) {
  dm[i] <- defines_mod(bidi5[[i]])
}

cat(sum(dm), " imsets define the model out of ", length(dm), "\n", sep="")

Which graph fails to define the model?

bidi5[[which(!dm)]]

Bidirected Graphs of size 6

We can take the same approach for graphs of size 6, but we don't evaluate it here for reasons of time.

data(bidi6)

dm <- logical(length(bidi6))
for (i in seq_along(bidi6)) {
  dm[i] <- defines_mod(bidi6[[i]])
}

cat(sum(dm), " imsets define the model out of ", length(dm), "\n", sep="")

Testing Decomposition

We can also check that the decomposition given in Section 5 gives the same results as the integer linear program.

dmZH <- logical(length(bidi5))

for (i in seq_along(bidi5)) {
  dmZH[i] <- test_decomp_ZH(bidi5[[i]])
}

which(dm != dmZH)


rje42/imset documentation built on March 20, 2023, 9:55 a.m.