Skip to contents

Checks if the given caugi graph is a Complete Partially Directed Acyclic Graph (CPDAG).

Usage

is_cpdag(cg)

Arguments

cg

A caugi_graph object.

Value

A logical value indicating whether the graph is a CPDAG.

Examples

cg_cpdag <- caugi_graph(
  A %---% B,
  A %-->% C,
  B %-->% C,
  class = "PDAG"
)
is_cpdag(cg_cpdag) # TRUE
#> [1] TRUE

cg_not_cpdag <- caugi_graph(
  A %---% B,
  A %---% C,
  B %-->% C,
  class = "PDAG"
)
is_cpdag(cg_not_cpdag) # FALSE
#> [1] FALSE