![]() |
aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
|
Class building the essential graph from a BN. More...
#include <agrum/BN/algorithms/essentialGraph.h>
Public Member Functions | |
| EssentialGraph ()=default | |
| EssentialGraph (const DAGmodel &m) | |
| EssentialGraph (const DAGmodel &m, const PDAG &mg) | |
| EssentialGraph (const EssentialGraph &g) | |
| EssentialGraph & | operator= (const EssentialGraph &g) |
| ~EssentialGraph () | |
| PDAG | pdag () const |
| std::string | toDot () const |
| const NodeSet & | parents (NodeId id) const |
| wrapping MixedGraph::parents(id) | |
| const NodeSet & | children (NodeId id) const |
| wrapping MixedGraph::parents(id) | |
| NodeSet | parents (const NodeSet &ids) const |
| wrapping MixedGraph::parents(ids) | |
| NodeSet | children (const NodeSet &ids) const |
| wrapping MixedGraph::parents(ids) | |
| NodeSet | descendants (NodeId id) const |
| wrapping PDAG::descendants(id) | |
| NodeSet | ancestors (NodeId id) const |
| wrapping PDAG::ancestors(id) | |
| const NodeSet & | neighbours (NodeId id) const |
| wrapping MixedGraph::parents(id) | |
| Size | sizeArcs () const |
| wrapping MixedGraph::sizeArcs() | |
| const ArcSet & | arcs () const |
| wrapping MixedGraph::arcs() | |
| Size | sizeEdges () const |
| wrapping MixedGraph::sizeEdges() | |
| const EdgeSet & | edges () const |
| wrapping MixedGraph::edges() | |
| Size | sizeNodes () const |
| wrapping MixedGraph::sizeNodes() | |
| Size | size () const |
| wrapping MixedGraph::size() | |
| UndiGraph | skeleton () const |
| const NodeGraphPart & | nodes () const |
| wrapping MixedGraph::nodes() | |
| NodeProperty< NodeId > | connectedComponents () const |
| Returns the connected components of the essential graph. Each node maps to the id of its component root. | |
| NodeId | idFromName (std::string_view name) const |
| wrappping DAGModel::idFromName() | |
| const std::string & | nameFromId (NodeId node) const |
| wrappping .name() | |
Private Member Functions | |
| void | _buildEssentialGraph_ () |
| bool | _strongly_protected_ (NodeId a, NodeId b) const |
Static Private Member Functions | |
| static bool | _strongly_protected_ (MixedGraph mg, NodeId a, NodeId b) |
Private Attributes | |
| const DAGmodel * | _dagmodel_ |
| PDAG | _pdag_ |
Class building the essential graph from a BN.
Essential graph is a mixed graph (Chain Graph) that represents the class of markov equivalent Bayesian networks (with the same independence model).
The main goal of this class is to nest the algorithm to build the essential graph from a BN and to encapsulate the representation (as a MixedGraph) of the essential graph.
gum::operator<<(std::ostream&, const BayesNet<GUM_SCALAR>&).
Definition at line 76 of file essentialGraph.h.
|
default |
References EssentialGraph().
Referenced by EssentialGraph(), EssentialGraph(), and operator=().
|
explicit |
Definition at line 56 of file essentialGraph.cpp.
References _buildEssentialGraph_(), and _dagmodel_.
| gum::EssentialGraph::EssentialGraph | ( | const EssentialGraph & | g | ) |
Definition at line 60 of file essentialGraph.cpp.
References EssentialGraph(), _buildEssentialGraph_(), and _dagmodel_.
|
default |
|
private |
Definition at line 75 of file essentialGraph.cpp.
References _dagmodel_, _pdag_, _strongly_protected_(), gum::DiGraph::addArc(), gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::ArcGraphPart::arcs(), gum::ArcGraphPart::children(), gum::EdgeGraphPart::edges(), and gum::ArcGraphPart::eraseArc().
Referenced by EssentialGraph(), EssentialGraph(), and operator=().
|
staticprivate |
Definition at line 116 of file essentialGraph.cpp.
References gum::ArcGraphPart::existsArc(), gum::EdgeGraphPart::existsEdge(), and gum::ArcGraphPart::parents().
Definition at line 112 of file essentialGraph.cpp.
References _pdag_, and _strongly_protected_().
Referenced by _buildEssentialGraph_(), and _strongly_protected_().
| INLINE const ArcSet & gum::EssentialGraph::arcs | ( | ) | const |
wrapping MixedGraph::arcs()
Definition at line 76 of file essentialGraph_inl.h.
References _pdag_.
Referenced by skeleton().
wrapping MixedGraph::parents(ids)
Definition at line 64 of file essentialGraph_inl.h.
References _pdag_.
wrapping MixedGraph::parents(id)
Definition at line 60 of file essentialGraph_inl.h.
References _pdag_.
| INLINE NodeProperty< NodeId > gum::EssentialGraph::connectedComponents | ( | ) | const |
Returns the connected components of the essential graph. Each node maps to the id of its component root.
Definition at line 96 of file essentialGraph_inl.h.
References _pdag_.
wrapping PDAG::descendants(id)
Definition at line 66 of file essentialGraph_inl.h.
References _pdag_.
| INLINE const EdgeSet & gum::EssentialGraph::edges | ( | ) | const |
wrapping MixedGraph::edges()
Definition at line 80 of file essentialGraph_inl.h.
References _pdag_.
Referenced by skeleton().
| INLINE NodeId gum::EssentialGraph::idFromName | ( | std::string_view | name | ) | const |
wrappping DAGModel::idFromName()
Definition at line 88 of file essentialGraph_inl.h.
References _dagmodel_.
| INLINE const std::string & gum::EssentialGraph::nameFromId | ( | NodeId | node | ) | const |
wrapping MixedGraph::parents(id)
Definition at line 70 of file essentialGraph_inl.h.
References _pdag_.
| INLINE const NodeGraphPart & gum::EssentialGraph::nodes | ( | ) | const |
wrapping MixedGraph::nodes()
Definition at line 86 of file essentialGraph_inl.h.
References _pdag_.
Referenced by skeleton().
| EssentialGraph & gum::EssentialGraph::operator= | ( | const EssentialGraph & | g | ) |
Definition at line 65 of file essentialGraph.cpp.
References EssentialGraph(), _buildEssentialGraph_(), and _dagmodel_.
wrapping MixedGraph::parents(ids)
Definition at line 62 of file essentialGraph_inl.h.
References _pdag_.
wrapping MixedGraph::parents(id)
Definition at line 58 of file essentialGraph_inl.h.
References _pdag_.
| INLINE PDAG gum::EssentialGraph::pdag | ( | ) | const |
Definition at line 56 of file essentialGraph_inl.h.
References _pdag_.
| INLINE Size gum::EssentialGraph::size | ( | ) | const |
| INLINE Size gum::EssentialGraph::sizeArcs | ( | ) | const |
wrapping MixedGraph::sizeArcs()
Definition at line 74 of file essentialGraph_inl.h.
References _pdag_.
| INLINE Size gum::EssentialGraph::sizeEdges | ( | ) | const |
wrapping MixedGraph::sizeEdges()
Definition at line 78 of file essentialGraph_inl.h.
References _pdag_.
| INLINE Size gum::EssentialGraph::sizeNodes | ( | ) | const |
wrapping MixedGraph::sizeNodes()
Definition at line 82 of file essentialGraph_inl.h.
References _pdag_.
| UndiGraph gum::EssentialGraph::skeleton | ( | ) | const |
Definition at line 182 of file essentialGraph.cpp.
References _dagmodel_, gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), arcs(), edges(), nodes(), and gum::NodeGraphPart::setName().
| std::string gum::EssentialGraph::toDot | ( | ) | const |
Definition at line 152 of file essentialGraph.cpp.
References _dagmodel_, _pdag_, gum::List< Val >::exists(), and gum::List< Val >::insert().
|
private |
Definition at line 152 of file essentialGraph.h.
Referenced by EssentialGraph(), EssentialGraph(), EssentialGraph(), _buildEssentialGraph_(), idFromName(), nameFromId(), operator=(), skeleton(), and toDot().
|
private |
Definition at line 153 of file essentialGraph.h.
Referenced by EssentialGraph(), _buildEssentialGraph_(), _strongly_protected_(), ancestors(), arcs(), children(), children(), connectedComponents(), descendants(), edges(), neighbours(), nodes(), parents(), parents(), pdag(), size(), sizeArcs(), sizeEdges(), sizeNodes(), and toDot().