Skip to contents

Checks if the given caugi graph is simple (no self-loops and no parallel edges).

Usage

is_simple(cg, force_check = FALSE)

Arguments

cg

A caugi object.

force_check

Logical; if TRUE, force a check against the compiled graph representation. If FALSE (default), return the declared simple property.

Value

A logical value indicating whether the graph is simple.

Examples

cg_simple <- caugi(
  A %-->% B,
  class = "DAG"
)
is_simple(cg_simple) # TRUE
#> [1] TRUE

cg_nonsimple <- caugi(
  A %-->% B,
  A %<->% B,
  class = "UNKNOWN",
  simple = FALSE
)
is_simple(cg_nonsimple) # FALSE
#> [1] FALSE