48#ifndef GUM_INCREMENTAL_TRIANGULATION_H
49#define GUM_INCREMENTAL_TRIANGULATION_H
253 std::vector< Edge >& notAffectedneighborClique,
259 std::vector< std::pair< NodeId, NodeId > >& merged_cliques,
261 const NodeSet& new_nodes_in_junction_tree)
const;
265 NodeSet& new_nodes_in_junction_tree);
269 const NodeSet& new_nodes_in_junction_tree);
The base class for all undirected edges.
bool _require_elimination_order_
a Boolean indicating wether we should update the elimination order
void _collectJTCliques_(const NodeId clique, const NodeId from, NodeProperty< bool > &examined)
a collect algorithm to compute, for each node, one container JT's clique
IncrementalTriangulation(const IncrementalTriangulation &from)
copy constructor
IncrementalTriangulation & operator=(const IncrementalTriangulation &from)
copy operator
const NodeProperty< NodeId > & createdJunctionTreeCliques() override
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
IncrementalTriangulation(const UnconstrainedTriangulation &triang_algo, const UndiGraph *theGraph, const NodeProperty< Size > *modal)
constructor
UndiGraph _graph_
the graph that needs be triangulated
const UndiGraph & triangulatedGraph() override
returns the triangulated graph
IncrementalTriangulation * copyFactory() const final
virtual copy constructor
const std::vector< NodeId > & eliminationOrder() override
returns an elimination ordering compatible with the triangulated graph
const CliqueGraph & junctionTree() override
returns a junction tree corresponding to the current graph
std::vector< NodeId > _elimination_order_
the current elimination ordering
~IncrementalTriangulation() override
destructor
CliqueGraph _junction_tree_
the junction tree computed so far
void _updateJunctionTree_(NodeProperty< bool > &all_cliques_affected, NodeSet &new_nodes_in_junction_tree)
update the junction tree
void _setUpConnectedTriangulation_(NodeId Mx, NodeId Mfrom, UndiGraph &theGraph, std::vector< Edge > ¬AffectedneighborClique, HashTable< NodeId, bool > &cliques_affected)
set-up the connected subgraph that needs be retriangulated
IncrementalTriangulation(IncrementalTriangulation &&from)
move constructor
NodeId createdMaxPrimeSubgraph(const NodeId id) override
returns the Id of the maximal prime subgraph created by the elimination of a given node during the tr...
NodeProperty< Idx > _reverse_elimination_order_
the elimination order (access by NodeId)
NodeId createdJunctionTreeClique(const NodeId id) override
returns the Id of the clique created by the elimination of a given node during the triangulation proc...
bool checkConsistency()
checks that the incremental triangulation is consistent
bool _require_created_JT_cliques_
a Boolean indicating whether we should compute the createdJTCliques
void eraseNode(const NodeId node)
removes a node from the graph (the join tree may need a triangulation update)
const CliqueGraph & maxPrimeSubgraphTree() override
returns the junction tree of the maximal prime subgraphs
NodeProperty< NodeId > _mps_of_clique_
indicate for each clique the MPS it belongs to
void _performAddNode_(const NodeId node)
adds a new node to T_mpd, the graph and the clique graph
NodeProperty< List< NodeId > > _mps_of_node_
for each node in graph, store the MPS containing the node
void _markAffectedMPSsByRemoveLink_(const NodeId My, const NodeId Mz, const Edge &edge)
mark the mps affected by the deletion of a given edge
Idx eliminationOrder(const NodeId) override
returns the number of a given node in the elimination order (0 = first node eliminated)
NodeProperty< bool > _mps_affected_
the set of MPS affected by a new triangulation
NodeProperty< std::vector< NodeId > > _cliques_of_mps_
indicate for each MPS its set of cliques in the junction tree
const CliqueGraph & eliminationTree() override
returns the elimination tree of a compatible ordering
void _performRemoveNode_(const NodeId node, const NodeId My, const NodeId Mz)
remove a given node from the T_mpd structure
NodeProperty< NodeId > _created_JT_cliques_
For each node, a clique that contains it.
CliqueGraph _T_mpd_
the maximal prime subgraph tree
const UndiGraph & graph() const
returns the current graph (that which is incrementally triangulated)
void setGraph(const UndiGraph *theGraph, const NodeProperty< Size > *domain_sizes) override
changes the current graph
void _computeMaxPrimeMergings_(const NodeId node, const NodeId from, std::vector< std::pair< NodeId, NodeId > > &merged_cliques, NodeProperty< bool > &mark, const NodeSet &new_nodes_in_junction_tree) const
used for computing the junction tree of the maximal prime subgraphs
const EdgeSet & fillIns() override
returns the fill-ins added by the triangulation algorithm
void eraseEdge(const Edge &edge)
removes an edge from the graph (the join tree may need a retriangulation)
bool _require_update_
a Boolean indicating whether the triangulation need be updated
IncrementalTriangulation & operator=(IncrementalTriangulation &&from)
move operator
IncrementalTriangulation(const UnconstrainedTriangulation &triangAlgo)
default constructor: initialize the triangulation with en empty graph
UnconstrainedTriangulation * _triangulation_
the triangulation algorithm that will be used incremantally
void clear() override
sets the graph to the empty graph
void updateTriangulation()
updates the triangulated graph using the modif list
NodeProperty< Size > _domain_sizes_
the domain sizes of the nodes
void addNode(const NodeId node, Size modal)
adds a new node to the graph
const UnconstrainedTriangulation & triangulationAlgo() const
returns the triangulation algorithm (useful for fine tuning it)
int _markAffectedMPSsByAddLink_(const NodeId My, const NodeId Mz, const NodeId X, const NodeId Y)
mark the mps affected by the insertion of a new edge
IncrementalTriangulation * newFactory() const final
virtual clone constructor
void _updateMaxPrimeSubgraph_(NodeProperty< bool > &cliques_affected, const NodeSet &new_nodes_in_junction_tree)
update the max prime subgraph
void addEdge(const NodeId X, const NodeId Y)
adds a new edge to the graph (the join tree may need a triangulation update)
void _collectEliminationOrder_(const NodeId node, const NodeId from, NodeProperty< bool > &examined, Idx &index)
a collect algorithm to compute elimination orderings
Generic doubly linked lists.
Triangulation()
default constructor
Interface for all triangulation methods without constraints on node elimination orderings.
Base class for undirected graphs.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
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 ...
Inline implementations for computing default triangulations of graphs.
gum is the global namespace for all aGrUM entities
base class for graph triangulations without constraints on nodes elimination ordering.