46#ifndef GUM_DOOR_CRITERIA_H
47#define GUM_DOOR_CRITERIA_H
113 std::size_t max_cardinality = 0,
114 bool only_minimal =
true,
115 bool stopAtFirst =
false);
145 std::size_t max_cardinality = 0,
146 bool only_minimal =
true);
177 std::size_t max_cardinality = 0,
178 bool only_minimal =
true,
179 bool stopAtFirst =
false);
209 std::size_t max_cardinality = 0,
210 bool only_minimal =
true);
Base classes for directed acyclic graphs.
Implements Backdoor and Frontdoor criteria utilities for a DAG.
static bool _isMinimalBackdoorAdjustment(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Check whether Z is a minimal backdoor adjustment set.
static std::optional< NodeSet > firstBackdoor(const DAG &dag, NodeId X, NodeId Y, const NodeSet &excluded_nodes=NodeSet(), std::size_t max_cardinality=0, bool only_minimal=true)
Directly return the first backdoor adjustment set if any.
static bool _existsUnblockedDirectedPath_(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z, NodeSet &visited)
static NodeSetVec enumerateBackdoorSets(const DAG &dag, NodeId X, NodeId Y, const NodeSet &excluded_nodes=NodeSet(), std::size_t max_cardinality=0, bool only_minimal=true, bool stopAtFirst=false)
Enumerate valid backdoor adjustment sets.
static bool hasBackdoorPath(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Test whether there exists an open backdoor path from X to Y given Z.
static NodeSetVec enumerateFrontdoorSets(const DAG &dag, NodeId X, NodeId Y, const NodeSet &excluded_nodes=NodeSet(), std::size_t max_cardinality=0, bool only_minimal=true, bool stopAtFirst=false)
Enumerate valid frontdoor adjustment sets.
static bool existsUnblockedDirectedPath(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Check whether there exists a directed path X->..->Y unblocked by Z.
static std::optional< NodeSet > nodesOnDirectedPaths(const DAG &dag, NodeId X, NodeId Y)
Compute nodes lying on some directed path from X to Y.
static bool satisfiesFrontdoorCriterion(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Check if Z satisfies the frontdoor criterion relative to (X, Y).
static bool satisfiesBackdoorCriterion(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Check if Z satisfies the backdoor criterion relative to (X, Y).
std::vector< NodeSet > NodeSetVec
Convenience type: list of candidate adjustment sets.
static NodeSet backdoorReach(const DAG &dag, NodeId X)
Compute the "backdoor reach" of a node.
static std::optional< NodeSet > firstFrontdoor(const DAG &dag, NodeId X, NodeId Y, const NodeSet &excluded_nodes=NodeSet(), std::size_t max_cardinality=0, bool only_minimal=true)
Directly return the first frontdoor adjustment set if any.
static bool _isMinimalFrontdoorAdjustment(const DAG &dag, NodeId X, NodeId Y, const NodeSet &Z)
Check whether Z is a minimal frontdoor adjustment set.
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities