76 return graph_.existsEdge(node1, node2);
94 }
catch ([[maybe_unused]] gum::NotFound& e) {
return false; }
102 return !
graph_.hasUndirectedPath(X, Y, Z);
106 return !
graph_.hasUndirectedPath(X, Y, Z);
110 return graph_.connectedComponents();
122 std::string_view Yname,
123 const std::vector< std::string >& Znames)
const {
128 const std::vector< std::string >& Ynames,
129 const std::vector< std::string >& Znames)
const {
Class representing probabilistic undirected model.
NodeId idFromName(std::string_view name) const override
Returns the NodeId of a variable given its name.
void _nameNodes_(NodeGraphPart &g) const
Names every node of g using variable(id).name() for each node id in g.
NodeSet nodeset(const std::vector< std::string > &names) const
transform a vector of names into a NodeSet
Class for node sets in graph.
NodeSet family(const NodeId id) const final
returns the node as a NodeSet (in mixed graph : family is the node and its parents
const NodeGraphPart & nodes() const final
Returns a named copy of the internal undirected graph: each node id is assigned the name of the corre...
bool existsEdge(const NodeId node1, const NodeId node2) const
return true if the edge node1-node2 exists in the UGModel
const UndiGraph & internalGraph() const
Returns a const reference to the internal (unnamed) graph. O(1), no copy. Use for stable references o...
bool exists(NodeId node) const final
Return true if this node exists in this graphical model.
UndiGraph graph_
The DAG of this Directed Graphical Model.
const EdgeSet & edges() const
return true if the edge node1-node2 exists in the UGModel
UndiGraph graph() const
Returns a named copy of the internal undirected graph: each node id is assigned the name of the corre...
bool isIndependent(NodeId X, NodeId Y, const NodeSet &Z) const final
check if X and Y are independent given Z
const NodeSet & neighbours(const NodeId id) const
returns the neighbours of a node as set of nodes
NodeProperty< NodeId > connectedComponents() const
Returns the connected components of the underlying undirected graph. Each node maps to the id of its ...
Size sizeEdges() const
Returns the number of arcs in this Directed Graphical Model.
Size size() const final
Returns the number of variables in this Directed Graphical Model.
Base class for undirected graphs.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities