![]() |
aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
|
Generic Bayes Ball algorithm (Shachter 1998) for directed graphs. More...
#include <utility>#include <agrum/agrum.h>#include <agrum/base/graphs/graphConcepts.h>#include <agrum/base/graphs/algorithms/generic/bayesBall_tpl.h>Go to the source code of this file.
Namespaces | |
| namespace | gum |
| gum is the global namespace for all aGrUM entities | |
| namespace | gum::graph |
Functions | |
| template<GUM_DiGraphable G> | |
| NodeSet | gum::graph::requisiteNodes (const G &g, const NodeSet &query, const NodeSet &Zhard=NodeSet(), const NodeSet &Zsoft=NodeSet()) |
Returns the Shachter-requisite nodes for query given evidence. | |
| template<GUM_DiGraphable G> | |
| NodeSet | gum::graph::dConnected (const G &g, const NodeSet &query, const NodeSet &Zhard=NodeSet(), const NodeSet &Zsoft=NodeSet()) |
Returns all nodes d-connected to query given evidence. | |
Generic Bayes Ball algorithm (Shachter 1998) for directed graphs.
Provides a single template function:
gum::graph::requisiteNodes(g, query, Zhard, Zsoft)
which computes the set of nodes d-connected to query given hard evidence Zhard and soft evidence Zsoft, using the Bayes Ball message-passing algorithm.
The algorithm operates purely on the graph structure (parents / children) and is therefore constrained by GUM_DiGraphable. It does not depend on any Bayesian-network–specific notion.
Complexity: O(n + e) in the number of nodes and arcs, versus O(n² + e) for the moralization-based approach.
Hard vs soft evidence
Definition in file bayesBall.h.