47#ifndef GUM_CLIQUE_GRAPH_H
48#define GUM_CLIQUE_GRAPH_H
91 bool nodes_resize_policy =
true,
93 bool edges_resize_policy =
true);
246 std::string_view colorClique =
"burlywood",
247 std::string_view colorSep =
"palegreen")
const;
std::string toString() const override
friendly displays the content of the CliqueGraph
const NodeSet & separator(const Edge &edge) const
returns the separator included in a given edge
CliqueGraph(const CliqueGraph &from)
copy constructor
const NodeSet & separator(const NodeId clique1, const NodeId clique) const
returns the separator included in an edge specified by its extremities
void eraseNode(const NodeId node) override
removes a given clique from the clique graph
bool hasRunningIntersection() const
indicates whether the running intersection property holds
void _updateSeparators_(const NodeId clique1)
function used to update the separators when a clique is modified
virtual std::string mapToDot(double scaleClique, double scaleSep, double lenEdge, std::string_view colorClique="burlywood", std::string_view colorSep="palegreen") const
friendly displays the content of the map of the CliqueGraph in DOT format
void addNodeWithId(const NodeId id, const NodeSet &clique)
try to add a new clique to the graph
void addEdge(NodeId first, NodeId second) override
inserts a new edge between two cliques
virtual void eraseFromClique(const NodeId clique_id, const NodeId node_id)
remove a node from a clique
void clearEdges() override
removes all edges and their separators
NodeId addNode(const NodeSet &clique)
adds a new clique to the graph
std::string toDot() const override
friendly displays the content of the CliqueGraph in DOT format
virtual void setClique(const NodeId idClique, const NodeSet &new_clique)
changes the set of nodes included into a given clique and returns the new set
void addNodeWithId(const NodeId id) override
try to add a new clique to the graph
CliqueGraph & operator=(CliqueGraph &&from)
move operator
void eraseEdge(const Edge &edge) override
removes an edge (and its separator) from the clique graph
virtual void addToClique(const NodeId clique_id, const NodeId node_id)
changes the set of nodes included into a given clique and returns the new set
CliqueGraph(CliqueGraph &&from)
move constructor
bool _runningIntersectionDFS_(const NodeId clique, const NodeId from, _RunningIntersect_ &infos_DFS) const
function used for the computation of the running intersection property
void clear() override
removes all the cliques and separators from the graph (as well as their adjacent edges)
NodeId container(const NodeId idNode) const
returns the id of a clique containing the node the id of which is in argument
EdgeProperty< NodeSet > _separators_
the set of nodes contained into the separators
bool operator==(const CliqueGraph &from) const
checks whether two clique graphs are equal
~CliqueGraph() override
destructor
NodeId addNode() override
adds a new clique to the graph
CliqueGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
basic constructor: creates an empty clique graph
NodeProperty< NodeSet > _cliques_
the set of nodes contained into the cliques
const NodeSet & clique(const NodeId idClique) const
returns the set of nodes included into a given clique
std::vector< NodeId > containerPath(const NodeId node1, const NodeId node2) const
returns a path from a clique containing node1 to a clique containing node2
CliqueGraph & operator=(const CliqueGraph &from)
copy operator
bool isJoinTree() const
indicates whether the graph is a join tree
The base class for all undirected edges.
UndiGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
default constructor
inline source of basic clique graphs
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
HashTable< Edge, VAL > EdgeProperty
Property on graph elements.
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
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
CliqueGraph JoinTree
a join tree is a clique graph satisfying the running intersection property (but some cliques may be i...
CliqueGraph JunctionTree
a junction tree is a clique graph satisfying the running intersection property and such that no cliqu...
structure used for the computation of the running intersection property
NodeSet nodes_DFS_seen
set of the nodes examined during the current DFS
NodeSet nodes_other_components
structure indicating the nodes that belong to other connected components
NodeSet nodes_DFS_forbidden
the nodes that are currently forbidden by separators in the DFS
NodeSet visited_cliques
structure indicating for each clique whether it has been examined by a DFS (Depth First Search)
NodeProperty< NodeSet > cliques_DFS_chain
for each clique, the list of its nodes that require accessing the clique through a chain
static constexpr Size default_size
The default number of slots in hashtables.
Base classes for undirected graphs.