dag_from_pdag: Extend a PDAG to a DAG using the Dor-Tarsi Algorithm

View source: R/operations.R

dag_from_pdagR Documentation

Extend a PDAG to a DAG using the Dor-Tarsi Algorithm

Description

Given a Partially Directed Acyclic Graph (PDAG), this function attempts to extend it to a Directed Acyclic Graph (DAG) by orienting the undirected edges while preserving acyclicity and all existing directed edges. The procedure implements the Dor-Tarsi algorithm.

If the PDAG cannot be consistently extended to a DAG, the function will raise an error.

Usage

dag_from_pdag(cg, PDAG)

Arguments

cg

A caugi object of class "PDAG", "MPDAG", or "CPDAG".

PDAG

Deprecated alias for cg. Use cg instead.

Value

A caugi object of class "DAG" representing a DAG extension of the input PDAG.

References

Dor, D., & Tarsi, M. (1992). "A simple algorithm to construct a consistent extension of a partially directed acyclic graph".

See Also

Other operations: condition_marginalize(), count_dags(), enumerate_dags(), exogenize(), latent_project(), meek_closure(), moralize(), mutate_caugi(), normalize_latent_structure(), skeleton()

Examples

pdag <- caugi(
  A %---% B,
  B %---% C,
  class = "PDAG"
)
dag <- dag_from_pdag(pdag)
edges(dag)


caugi documentation built on Oct. 28, 2026, 1:07 a.m.