48#ifndef GUM_INCREMENTAL_TRIANGULATION_H
49#define GUM_INCREMENTAL_TRIANGULATION_H
57#ifndef DOXYGEN_SHOULD_SKIP_THIS
59 class IncrementalTriangulationTestSuite;
250 std::vector< Edge >& notAffectedneighborClique,
256 std::vector< std::pair< NodeId, NodeId > >& merged_cliques,
258 const NodeSet& new_nodes_in_junction_tree)
const;
262 NodeSet& new_nodes_in_junction_tree);
266 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 operator
friend class gum_tests::IncrementalTriangulationTestSuite
to enable testunits to use check
void setGraph(const UndiGraph *theGraph, const NodeProperty< Size > *domain_sizes)
changes the current graph
IncrementalTriangulation & operator=(const IncrementalTriangulation &from)
copy operator
IncrementalTriangulation(const UnconstrainedTriangulation &triang_algo, const UndiGraph *theGraph, const NodeProperty< Size > *modal)
constructor
UndiGraph _graph_
the graph that needs be triangulated
void clear()
sets the graph to the empty graph
const std::vector< NodeId > & eliminationOrder()
returns an elimination ordering compatible with the triangulated graph
std::vector< NodeId > _elimination_order_
the current elimination ordering
CliqueGraph _junction_tree_
the junction tree computed so far
Idx eliminationOrder(const NodeId)
returns the number of a given node in the elimination order (0 = first node eliminated)
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
NodeProperty< Idx > _reverse_elimination_order_
the elimination order (access by NodeId)
const UndiGraph & triangulatedGraph()
returns the triangulated graph
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()
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
virtual IncrementalTriangulation * copyFactory() const final
virtual copy constructor
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
virtual IncrementalTriangulation * newFactory() const final
virtual clone constructor
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
NodeId createdJunctionTreeClique(const NodeId id)
returns the Id of the clique created by the elimination of a given node during the triangulation proc...
const UndiGraph & graph() const
returns the current graph (that which is incrementally triangulated)
const CliqueGraph & junctionTree()
returns a junction tree corresponding to 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
bool _check_()
checks that the incremental triangulation works properly
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
const NodeProperty< NodeId > & createdJunctionTreeCliques()
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
IncrementalTriangulation(const UnconstrainedTriangulation &triangAlgo)
default constructor: initialize the triangulation with en empty graph
NodeId createdMaxPrimeSubgraph(const NodeId id)
returns the Id of the maximal prime subgraph created by the elimination of a given node during the tr...
UnconstrainedTriangulation * _triangulation_
the triangulation algorithm that will be used incremantally
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
~IncrementalTriangulation()
destructor
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
const CliqueGraph & eliminationTree()
returns the elimination tree of a compatible ordering
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
const EdgeSet & fillIns()
returns the fill-ins added by the triangulation algorithm
Generic doubly linked lists.
Exception : operation not allowed.
Triangulation()
default constructor
Interface for all triangulation methods without constraints on node elimination orderings.
Base class for undirected graphs.
#define GUM_ERROR(type, msg)
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.