aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::UnconstrainedTriangulation Class Referenceabstract

Interface for all triangulation methods without constraints on node elimination orderings. More...

#include <unconstrainedTriangulation.h>

Inheritance diagram for gum::UnconstrainedTriangulation:
Collaboration diagram for gum::UnconstrainedTriangulation:

Public Member Functions

Accessors / Modifiers
virtual UnconstrainedTriangulationnewFactory () const =0
 returns a fresh triangulation (over an empty graph) of the same type as the current object
virtual UnconstrainedTriangulationcopyFactory () const =0
 virtual copy constructor
virtual ~UnconstrainedTriangulation ()
 destructor
Accessors / Modifiers
double maxLog10CliqueDomainSize ()
 returns the max of log10DomainSize of the cliques in the junction tree.
const NodeProperty< Size > * domainSizes () const
 returns the domain sizes of the variables of the graph to be triangulated

Protected Member Functions

Constructors / Destructors
 UnconstrainedTriangulation (const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
 default constructor
 UnconstrainedTriangulation (const UndiGraph *graph, const NodeProperty< Size > *dom, const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
 constructor with a given graph
 UnconstrainedTriangulation (const UnconstrainedTriangulation &)
 forbid copy constructor except in newfactory
 UnconstrainedTriangulation (UnconstrainedTriangulation &&)
 forbid move constructor except in children's constructors

Protected Attributes

EliminationSequenceStrategyelimination_sequence_strategy_ {nullptr}
 the elimination sequence strategy used by the triangulation
JunctionTreeStrategyjunction_tree_strategy_ {nullptr}
 the junction tree strategy used by the triangulation
const NodeProperty< Size > * domain_sizes_ {nullptr}
 the domain sizes of the variables/nodes of the graph

Private Member Functions

UnconstrainedTriangulationoperator= (const UnconstrainedTriangulation &)
 forbid copy operator
void _triangulate_ ()
 the function that performs the triangulation
void _computeEliminationTree_ ()
 returns an elimination tree from a triangulated graph
void _computeMaxPrimeJunctionTree_ ()
 computes the junction tree of the maximal prime subgraphs
void _computeRecursiveThinning_ ()
 removes redondant fill-ins and compute proper elimination cliques and order
void _computeMaxPrimeMergings_ (const NodeId node, const NodeId from, std::vector< Arc > &merged_cliques, NodeSet &mark) const
 used for computing the junction tree of the maximal prime subgraphs

Private Attributes

const UndiGraph_original_graph_ {nullptr}
 a pointer to the (external) original graph (which will be triangulated)
UndiGraph _triangulated_graph_
 the triangulated graph
EdgeSet _fill_ins_
 the fill-ins added during the whole triangulation process
std::vector< NodeId_elim_order_
 the order in which nodes are eliminated by the algorithm
NodeProperty< NodeId_reverse_elim_order_
 the elimination order (access by NodeId)
NodeProperty< NodeSet_elim_cliques_
 the cliques formed by the elimination of the nodes
CliqueGraph _elim_tree_
 the elimination tree computed by the algorithm
const CliqueGraph_junction_tree_ {nullptr}
 the junction tree computed by the algorithm
CliqueGraph _max_prime_junction_tree_
 the maximal prime subgraph junction tree computed from the junction tree
NodeProperty< NodeId_node_2_max_prime_clique_
 indicates which clique of the max prime junction tree was created by the elmination of a given node (the key of the table)
bool _has_triangulation_ {false}
 a boolean indicating whether we have parformed a triangulation
bool _has_triangulated_graph_ {false}
 a boolean indicating whether we have constructed the triangulated graph
bool _has_elimination_tree_ {false}
 a boolean indicating whether the elimination tree has been computed
bool _has_junction_tree_ {false}
 a boolean indicating whether the junction tree has been constructed
bool _has_max_prime_junction_tree_ {false}
 indicates whether a maximal prime subgraph junction tree has been constructed
bool _has_fill_ins_ {false}
 indicates whether we actually computed fill-ins
bool _minimality_required_ {false}
 indicates whether the triangulation must be minimal
std::vector< EdgeSet_added_fill_ins_
 a vector containing the set of fill-ins added after each node elimination (used by recursive thinning)
bool _we_want_fill_ins_ {false}
 a boolean indicating if we want fill-ins list with the standard triangulation method

Accessors / Modifiers

virtual void setGraph (const UndiGraph *graph, const NodeProperty< Size > *domsizes)
 initialize the triangulation data structures for a new graph
const EdgeSetfillIns ()
 returns the fill-ins added by the triangulation algorithm
const std::vector< NodeId > & eliminationOrder ()
 returns an elimination ordering compatible with the triangulated graph
Idx eliminationOrder (const NodeId)
 returns the index of a given node in the elimination order (0 = first node eliminated)
const NodeProperty< NodeId > & reverseEliminationOrder ()
 returns a table indicating, for each node, at which step it was deleted by the triangulation process
const UndiGraphtriangulatedGraph ()
 returns the triangulated graph
const CliqueGrapheliminationTree ()
 returns the elimination tree of a compatible ordering
const CliqueGraphjunctionTree ()
 returns a compatible junction tree
NodeId createdJunctionTreeClique (const NodeId id)
 returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process
const NodeProperty< NodeId > & createdJunctionTreeCliques ()
 returns the Ids of the cliques of the junction tree created by the elimination of the nodes
const CliqueGraphmaxPrimeSubgraphTree ()
 returns a junction tree of maximal prime subgraphs
NodeId createdMaxPrimeSubgraph (const NodeId id)
 returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process
void clear ()
 reinitialize the graph to be triangulated to an empty graph
void setMinimalRequirement (bool)
 sets/unset the minimality requirement
virtual bool isMinimalityRequired () const final
 indicates wether minimality is required
void setFillIns (bool)
 sets/unsets the record of the fill-ins in the standard triangulation procedure
const UndiGraphoriginalGraph () const
 returns the graph to be triangulated
EliminationSequenceStrategyeliminationSequenceStrategy () const
 returns the elimination sequence strategy used by the triangulation
JunctionTreeStrategyjunctionTreeStrategy () const
 returns the junction tree strategy used by the triangulation
virtual void initTriangulation_ (UndiGraph &graph)
 the function called to initialize the triangulation process

Detailed Description

Interface for all triangulation methods without constraints on node elimination orderings.

Definition at line 64 of file unconstrainedTriangulation.h.

Constructor & Destructor Documentation

◆ ~UnconstrainedTriangulation()

gum::UnconstrainedTriangulation::~UnconstrainedTriangulation ( )
virtual

destructor

Definition at line 90 of file unconstrainedTriangulation.cpp.

90 {
91 // for debugging purposes
92 GUM_DESTRUCTOR(UnconstrainedTriangulation);
93 }
UnconstrainedTriangulation(const UnconstrainedEliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor

References UnconstrainedTriangulation().

Here is the call graph for this function:

◆ UnconstrainedTriangulation() [1/4]

gum::UnconstrainedTriangulation::UnconstrainedTriangulation ( const UnconstrainedEliminationSequenceStrategy & elimSeq,
const JunctionTreeStrategy & JTStrategy,
bool minimality = false )
protected

default constructor

Parameters
elimSeqthe elimination sequence used to triangulate the graph
JTStrategythe junction tree strategy used to create junction trees
minimalitya Boolean indicating whether we should enforce that the triangulation is minimal w.r.t. inclusion

Definition at line 57 of file unconstrainedTriangulation.cpp.

60 : StaticTriangulation(elimSeq, JTStrategy, minimality) {
61 // for debugging purposes
62 GUM_CONSTRUCTOR(UnconstrainedTriangulation);
63 }
StaticTriangulation(const EliminationSequenceStrategy &elimSeq, const JunctionTreeStrategy &JTStrategy, bool minimality=false)
default constructor: without any graph

References gum::StaticTriangulation::StaticTriangulation(), and UnconstrainedTriangulation().

Referenced by UnconstrainedTriangulation(), UnconstrainedTriangulation(), UnconstrainedTriangulation(), UnconstrainedTriangulation(), ~UnconstrainedTriangulation(), copyFactory(), newFactory(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnconstrainedTriangulation() [2/4]

gum::UnconstrainedTriangulation::UnconstrainedTriangulation ( const UndiGraph * graph,
const NodeProperty< Size > * dom,
const UnconstrainedEliminationSequenceStrategy & elimSeq,
const JunctionTreeStrategy & JTStrategy,
bool minimality = false )
protected

constructor with a given graph

Parameters
graphthe graph to be triangulated, i.e., the nodes of which will be eliminated
domthe domain sizes of the nodes to be eliminated
elimSeqthe elimination sequence used to triangulate the graph
JTStrategythe junction tree strategy used to create junction trees
minimalitya Boolean indicating whether we should enforce that the triangulation is minimal w.r.t. inclusion
Warning
note that, by aGrUM's rule, the graph and the modalities are not copied but only referenced by the elimination sequence algorithm.

Definition at line 66 of file unconstrainedTriangulation.cpp.

71 : StaticTriangulation(theGraph, domsizes, elimSeq, JTStrategy, minimality) {
72 // for debugging purposes
73 GUM_CONSTRUCTOR(UnconstrainedTriangulation);
74 }

References gum::StaticTriangulation::StaticTriangulation(), and UnconstrainedTriangulation().

Here is the call graph for this function:

◆ UnconstrainedTriangulation() [3/4]

gum::UnconstrainedTriangulation::UnconstrainedTriangulation ( const UnconstrainedTriangulation & from)
protected

forbid copy constructor except in newfactory

copy constructor

Definition at line 77 of file unconstrainedTriangulation.cpp.

77 :
78 StaticTriangulation(from) { // for debugging purposes
79 GUM_CONS_CPY(UnconstrainedTriangulation);
80 }

References gum::StaticTriangulation::StaticTriangulation(), and UnconstrainedTriangulation().

Here is the call graph for this function:

◆ UnconstrainedTriangulation() [4/4]

gum::UnconstrainedTriangulation::UnconstrainedTriangulation ( UnconstrainedTriangulation && from)
protected

forbid move constructor except in children's constructors

move constructor

Definition at line 83 of file unconstrainedTriangulation.cpp.

83 :
84 StaticTriangulation(std::move(from)) {
85 // for debugging purposes
86 GUM_CONS_MOV(UnconstrainedTriangulation);
87 }

References gum::StaticTriangulation::StaticTriangulation(), and UnconstrainedTriangulation().

Here is the call graph for this function:

Member Function Documentation

◆ _computeEliminationTree_()

void gum::StaticTriangulation::_computeEliminationTree_ ( )
privateinherited

returns an elimination tree from a triangulated graph

Definition at line 341 of file staticTriangulation.cpp.

341 {
342 // if there already exists an elimination tree, no need to compute it again
343 if (_has_elimination_tree_) return;
344
345 // if the graph is not triangulated, triangulate it
347
348 // create the nodes of the elimination tree
349 _elim_tree_.clear();
350
351 auto size = Size(_elim_order_.size());
352 for (auto i = NodeId(0); i < size; ++i)
353 _elim_tree_.addNodeWithId(i, _elim_cliques_[_elim_order_[i]]);
354
355 // create the edges of the elimination tree: join a node to the one in
356 // its clique that is eliminated first
357 for (auto i = NodeId(0); i < size; ++i) {
358 NodeId clique_i_creator = _elim_order_[i];
359 const NodeSet& list_of_nodes = _elim_cliques_[clique_i_creator];
360 Idx child = _original_graph_->bound() + 1;
361
362 for (const auto node: list_of_nodes) {
363 auto it_elim_step = _reverse_elim_order_[node];
364
365 if ((node != clique_i_creator) && (child > it_elim_step)) child = it_elim_step;
366 }
367
368 if (child <= _original_graph_->bound()) {
369 // WARNING: here, we assume that the nodes of the elimination tree are
370 // indexed from 0 to n-1
371 _elim_tree_.addEdge(i, child);
372 }
373 }
374
376 }
NodeProperty< NodeId > _reverse_elim_order_
the elimination order (access by NodeId)
bool _has_triangulation_
a boolean indicating whether we have parformed a triangulation
NodeProperty< NodeSet > _elim_cliques_
the cliques formed by the elimination of the nodes
const UndiGraph * _original_graph_
a pointer to the (external) original graph (which will be triangulated)
bool _has_elimination_tree_
a boolean indicating whether the elimination tree has been computed
void _triangulate_()
the function that performs the triangulation
std::vector< NodeId > _elim_order_
the order in which nodes are eliminated by the algorithm
CliqueGraph _elim_tree_
the elimination tree computed by the algorithm
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
Size Idx
Type for indexes.
Definition types.h:79
Size NodeId
Type for node ids.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...

References _elim_cliques_, _elim_order_, _elim_tree_, _has_elimination_tree_, _has_triangulation_, _original_graph_, _reverse_elim_order_, and _triangulate_().

Here is the call graph for this function:

◆ _computeMaxPrimeJunctionTree_()

void gum::StaticTriangulation::_computeMaxPrimeJunctionTree_ ( )
privateinherited

computes the junction tree of the maximal prime subgraphs

Definition at line 411 of file staticTriangulation.cpp.

411 {
412 // if there already exists a max prime junction tree, no need
413 // to recompute it
415
416 // if there is no junction tree, create it
418
419 // the maximal prime subgraph join tree is created by aggregation of some
420 // cliques. More precisely, when the separator between 2 cliques is not
421 // complete in the original graph, then the two cliques must be merged.
422 // Create a hashtable indicating which clique has been absorbed by some
423 // other
424 // clique.
425 NodeProperty< NodeId > T_mpd_cliques(_junction_tree_->size());
426
427 for (const auto clik: _junction_tree_->nodes())
428 T_mpd_cliques.insert(clik, clik);
429
430 // parse all the separators of the junction tree and test those that are not
431 // complete in the orginal graph
432 std::vector< Arc > merged_cliques;
433
434 NodeSet mark;
435
436 for (const auto clik: _junction_tree_->nodes())
437 if (!mark.contains(clik)) _computeMaxPrimeMergings_(clik, clik, merged_cliques, mark);
438
439 // compute the transitive closure of merged_cliques. This one will contain
440 // pairs (X,Y) indicating that clique X must be merged with clique Y.
441 // Actually clique X will be inserted into clique Y.
442 for (unsigned int i = 0; i < merged_cliques.size(); ++i) {
443 T_mpd_cliques[merged_cliques[i].tail()] = T_mpd_cliques[merged_cliques[i].head()];
444 }
445
446 // now we can create the max prime junction tree. First, create the cliques
447 for (const auto& elt: T_mpd_cliques)
448 if (elt.first == elt.second)
449 _max_prime_junction_tree_.addNodeWithId(elt.second, _junction_tree_->clique(elt.second));
450
451 // add to the cliques previously created the nodes of the cliques that were
452 // merged into them
453 for (const auto& elt: T_mpd_cliques)
454 if (elt.first != elt.second)
455 for (const auto node: _junction_tree_->clique(elt.first)) {
456 try {
457 _max_prime_junction_tree_.addToClique(elt.second, node);
458 } catch (DuplicateElement const&) {}
459 }
460
461 // add the edges to the graph
462 for (const auto& edge: _junction_tree_->edges()) {
463 NodeId node1 = T_mpd_cliques[edge.first()];
464 NodeId node2 = T_mpd_cliques[edge.second()];
465
466 if (node1 != node2) {
467 try {
468 _max_prime_junction_tree_.addEdge(node1, node2);
469 } catch (DuplicateElement const&) {}
470 }
471 }
472
473 // compute for each node which clique of the max prime junction tree was
474 // created by the elimination of the node
475 const NodeProperty< NodeId >& node_2_junction_clique
476 = junction_tree_strategy_->createdCliques();
477
478 for (const auto& elt: node_2_junction_clique)
479 _node_2_max_prime_clique_.insert(elt.first, T_mpd_cliques[elt.second]);
480
482 }
bool _has_junction_tree_
a boolean indicating whether the junction tree has been constructed
JunctionTreeStrategy * junction_tree_strategy_
the junction tree strategy used by the triangulation
void _computeMaxPrimeMergings_(const NodeId node, const NodeId from, std::vector< Arc > &merged_cliques, NodeSet &mark) const
used for computing the junction tree of the maximal prime subgraphs
const CliqueGraph & junctionTree()
returns a compatible junction tree
NodeProperty< NodeId > _node_2_max_prime_clique_
indicates which clique of the max prime junction tree was created by the elmination of a given node (...
CliqueGraph _max_prime_junction_tree_
the maximal prime subgraph junction tree computed from the junction tree
bool _has_max_prime_junction_tree_
indicates whether a maximal prime subgraph junction tree has been constructed
const CliqueGraph * _junction_tree_
the junction tree computed by the algorithm
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.

References _computeMaxPrimeMergings_(), _has_junction_tree_, _has_max_prime_junction_tree_, _junction_tree_, _max_prime_junction_tree_, _node_2_max_prime_clique_, gum::Set< Key >::contains(), gum::HashTable< Key, Val >::insert(), junction_tree_strategy_, and junctionTree().

Here is the call graph for this function:

◆ _computeMaxPrimeMergings_()

void gum::StaticTriangulation::_computeMaxPrimeMergings_ ( const NodeId node,
const NodeId from,
std::vector< Arc > & merged_cliques,
NodeSet & mark ) const
privateinherited

used for computing the junction tree of the maximal prime subgraphs

Definition at line 379 of file staticTriangulation.cpp.

382 {
383 mark << node;
384
385 for (const auto other_node: _junction_tree_->neighbours(node))
386 if (other_node != from) {
387 const NodeSet& separator = _junction_tree_->separator(node, other_node);
388 // check that the separator between node and other_node is complete
389 bool complete = true;
390
391 for (auto iter_sep1 = separator.begin(); iter_sep1 != separator.end() && complete;
392 ++iter_sep1) {
393 auto iter_sep2 = iter_sep1;
394
395 for (++iter_sep2; iter_sep2 != separator.end(); ++iter_sep2) {
396 if (!_original_graph_->existsEdge(*iter_sep1, *iter_sep2)) {
397 complete = false;
398 break;
399 }
400 }
401 }
402
403 // here complete indicates whether the separator is complete or not
404 if (!complete) merged_cliques.push_back(Arc(other_node, node));
405
406 _computeMaxPrimeMergings_(other_node, node, merged_cliques, mark);
407 }
408 }

References _computeMaxPrimeMergings_(), _junction_tree_, _original_graph_, gum::Set< Key >::begin(), and gum::Set< Key >::end().

Referenced by _computeMaxPrimeJunctionTree_(), and _computeMaxPrimeMergings_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _computeRecursiveThinning_()

void gum::StaticTriangulation::_computeRecursiveThinning_ ( )
privateinherited

removes redondant fill-ins and compute proper elimination cliques and order

Definition at line 203 of file staticTriangulation.cpp.

203 {
204 // apply recursive thinning (fmint, see Kjaerulff (90), "triangulation of
205 // graphs - algorithms giving small total state space")
206 NodeId node1, node2;
207 bool incomplete;
208 std::vector< NodeId > adj;
209 EdgeSet T_prime;
211
212 for (const auto node: _triangulated_graph_)
213 R.insert(node, 0);
214
215 // the FMINT loop
216 if (_added_fill_ins_.size() > 0) {
217 for (auto iter = _added_fill_ins_.rbegin(); iter != _added_fill_ins_.rend(); ++iter) {
218 if (iter->size()) {
219 // here apply MINT to T_i = _added_fill_ins_[i]
220 EdgeSet& T = *iter;
221
222 // compute R: by default, R is equal to all the nodes in the graph
223 // when R[...] >= j (see the j in the loop below), this means that the
224 // node belongs to an extremal edge in R
225 for (std::size_t k = 0; k < _elim_order_.size(); ++k)
226 R[_elim_order_[k]] = 0; // WARNING: do not replace R[ _elim_order_[k]] by
227
228 // R[k] because the node ids may not be
229 // consecutive numbers
230
231 // apply MINT while some edges can possibly be deleted
232 bool require_mint = true;
233
234 for (unsigned int j = 0; require_mint; ++j) {
235 // find T' (it is equal to the edges (v,w) of T such that
236 // the intersection of adj(v,G) and adj(w,G) is complete and such
237 // that
238 // v and/or w belongs to an extremal node in R
239 for (const auto& edge: T) {
240 node1 = edge.first();
241 node2 = edge.second();
242
243 // check if at least one extremal node belongs to R
244 if ((R[node1] < j) && (R[node2] < j)) continue;
245
246 // check if the intersection of adj(v,G) and adj(w,G) is a
247 // complete subgraph
248 if (_triangulated_graph_.neighbours(node2).size()
249 < _triangulated_graph_.neighbours(node1).size()) {
250 NodeId tmp = node1;
251 node1 = node2;
252 node2 = tmp;
253 }
254
255 incomplete = false;
256
257 // find the nodes belonging to the intersection of adj(v,G)
258 // and adj(w,G)
259 for (const auto adjnode: _triangulated_graph_.neighbours(node1))
260 if (_triangulated_graph_.existsEdge(node2, adjnode)) adj.push_back(adjnode);
261
262 // check if the intersection is complete
263 for (unsigned int k = 0; k < adj.size() && !incomplete; ++k) {
264 for (unsigned int m = k + 1; m < adj.size(); ++m) {
265 if (!_triangulated_graph_.existsEdge(adj[k], adj[m])) {
266 incomplete = true;
267 break;
268 }
269 }
270 }
271
272 adj.clear();
273
274 if (!incomplete) {
275 T_prime.insert(edge);
276 R[node1] = j + 1;
277 R[node2] = j + 1;
278 }
279 }
280
281 // compute the new value of T (i.e. T\T') and update the
282 // triangulated graph
283 for (const auto& edge: T_prime) {
284 T.erase(edge);
285 _triangulated_graph_.eraseEdge(edge);
286
287 if (_has_fill_ins_) _fill_ins_.erase(edge);
288 }
289
290 if (T_prime.size() == 0) require_mint = false;
291
292 T_prime.clear();
293 }
294 }
295 }
296 }
297
298 // here, the recursive thinning has removed all the superfluous edges.
299 // Hence some cliques have been split and, as a result, the elimination
300 // order has changed. We should thus compute a new perfect ordering. To
301 // do so, we use a Maximal Cardinality Search: it has indeed the nice
302 // property that, when the graph is already triangulated, it finds a
303 // compatible order of elimination that does not require any edge addition
304
305 // a structure storing the number of neighbours previously processed
306 PriorityQueue< NodeId, unsigned int, std::greater< unsigned int > > numbered_neighbours(
307 std::greater< unsigned int >(),
308 _triangulated_graph_.size());
309
310 for (Size i = 0; i < _elim_order_.size(); ++i)
311 numbered_neighbours.insert(_elim_order_[i], 0);
312
313 // perform the maximum cardinality search
314 if (_elim_order_.size() > 0) {
315 for (Size i = Size(_elim_order_.size()); i >= 1; --i) {
316 NodeId ni = NodeId(i - 1);
317 NodeId node = numbered_neighbours.pop();
318 _elim_order_[ni] = node;
319 _reverse_elim_order_[node] = ni;
320
321 for (const auto neighbour: _triangulated_graph_.neighbours(node)) {
322 try {
323 numbered_neighbours.setPriority(neighbour, 1 + numbered_neighbours.priority(neighbour));
324 } catch (NotFound const&) {}
325 }
326 }
327 }
328
329 // here the elimination order is ok. We now need to update the
330 // _elim_cliques_
331 for (Size i = 0; i < _elim_order_.size(); ++i) {
332 NodeSet& cliques = _elim_cliques_.insert(_elim_order_[i], NodeSet()).second;
333 cliques << _elim_order_[i];
334
335 for (const auto neighbour: _triangulated_graph_.neighbours(_elim_order_[i]))
336 if (_reverse_elim_order_[neighbour] > i) cliques << neighbour;
337 }
338 }
bool _has_fill_ins_
indicates whether we actually computed fill-ins
UndiGraph _triangulated_graph_
the triangulated graph
std::vector< EdgeSet > _added_fill_ins_
a vector containing the set of fill-ins added after each node elimination (used by recursive thinning...
EdgeSet _fill_ins_
the fill-ins added during the whole triangulation process
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...

References _added_fill_ins_, _elim_cliques_, _elim_order_, _fill_ins_, _has_fill_ins_, _reverse_elim_order_, _triangulated_graph_, gum::HashTable< Key, Val >::insert(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::insert(), gum::Set< Key >::insert(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::pop(), gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::priority(), and gum::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::setPriority().

Referenced by _triangulate_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _triangulate_()

void gum::StaticTriangulation::_triangulate_ ( )
privateinherited

the function that performs the triangulation

Definition at line 551 of file staticTriangulation.cpp.

551 {
552 // if the graph is already triangulated, no need to triangulate it again
553 if (_has_triangulation_) return;
554
555 // copy the graph to be triangulated, so that we can modify it
556 UndiGraph tmp_graph = *_original_graph_;
557
558 initTriangulation_(tmp_graph);
560
561 // if we are to do recursive thinning, we will have to add fill-ins to the
562 // triangulated graph each time we eliminate a node. Hence, we shall
563 // initialize the triangulated graph by a copy of the original graph
567 }
568
569 // perform the triangulation
570 NodeId removable_node = 0;
571
572 for (unsigned int nb_elim = 0; tmp_graph.size() != 0; ++nb_elim) {
573 removable_node = elimination_sequence_strategy_->nextNodeToEliminate();
574
575 // when minimality is not required, i.e., we won't apply recursive
576 // thinning, the cliques sets can be computed
578 NodeSet& cliques = _elim_cliques_.insert(removable_node, NodeSet()).second;
579 cliques.resize(tmp_graph.neighbours(removable_node).size() / 2);
580 cliques << removable_node;
581 for (const auto clik: tmp_graph.neighbours(removable_node))
582 cliques << clik;
583 } else {
584 // here recursive thinning will be applied, hence we need store the
585 // fill-ins added by the current node removal
586 EdgeSet& current_fill = _added_fill_ins_[nb_elim];
587 NodeId node1, node2;
588
589 const NodeSet& nei = tmp_graph.neighbours(removable_node);
590
591 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
592 node1 = *iter_edges1;
593 auto iter_edges2 = iter_edges1;
594
595 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
596 node2 = *iter_edges2;
597 Edge edge(node1, node2);
598
599 if (!tmp_graph.existsEdge(edge)) {
600 current_fill.insert(edge);
601 _triangulated_graph_.addEdge(node1, node2);
602 }
603 }
604 }
605 }
606
607 // if we want fill-ins but the elimination sequence strategy does not
608 // compute them, we shall compute them here
609 if (_we_want_fill_ins_ && !elimination_sequence_strategy_->providesFillIns()) {
610 NodeId node1, node2;
611
612 // add edges between removable_node's neighbours in order to create
613 // a clique
614 const NodeSet& nei = tmp_graph.neighbours(removable_node);
615
616 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
617 node1 = *iter_edges1;
618 auto iter_edges2 = iter_edges1;
619
620 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
621 node2 = *iter_edges2;
622 Edge edge(node1, node2);
623
624 if (!tmp_graph.existsEdge(edge)) { _fill_ins_.insert(edge); }
625 }
626 }
627
628 // delete removable_node and its adjacent edges
629 tmp_graph.eraseNode(removable_node);
630 }
631
632 // inform the elimination sequence that we are actually removing
633 // removable_node (this enables, for instance, to update the weights of
634 // the nodes in the graph)
635 elimination_sequence_strategy_->eliminationUpdate(removable_node);
636
637 if (!elimination_sequence_strategy_->providesGraphUpdate()) {
638 NodeId node1, node2;
639
640 const NodeSet& nei = tmp_graph.neighbours(removable_node);
641
642 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
643 node1 = *iter_edges1;
644 auto iter_edges2 = iter_edges1;
645
646 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
647 node2 = *iter_edges2;
648 Edge edge(node1, node2);
649
650 if (!tmp_graph.existsEdge(edge)) { tmp_graph.addEdge(node1, node2); }
651 }
652 }
653
654 tmp_graph.eraseNode(removable_node);
655 }
656
657 // update the elimination order
658 _elim_order_[nb_elim] = removable_node;
659 _reverse_elim_order_.insert(removable_node, nb_elim);
660 }
661
662 // indicate whether we actually computed fill-ins
664
665 // if minimality is required, remove the redondant edges
667
668 _has_triangulation_ = true;
669 }
virtual void initTriangulation_(UndiGraph &graph)
the function called to initialize the triangulation process
bool _we_want_fill_ins_
a boolean indicating if we want fill-ins list with the standard triangulation method
EliminationSequenceStrategy * elimination_sequence_strategy_
the elimination sequence strategy used by the triangulation
void _computeRecursiveThinning_()
removes redondant fill-ins and compute proper elimination cliques and order
bool _minimality_required_
indicates whether the triangulation must be minimal
bool _has_triangulated_graph_
a boolean indicating whether we have constructed the triangulated graph

References _added_fill_ins_, _computeRecursiveThinning_(), _elim_cliques_, _elim_order_, _fill_ins_, _has_fill_ins_, _has_triangulated_graph_, _has_triangulation_, _minimality_required_, _original_graph_, _reverse_elim_order_, _triangulated_graph_, _we_want_fill_ins_, gum::UndiGraph::addEdge(), gum::Set< Key >::begin(), elimination_sequence_strategy_, gum::Set< Key >::end(), gum::UndiGraph::eraseNode(), gum::EdgeGraphPart::existsEdge(), initTriangulation_(), gum::Set< Key >::insert(), gum::EdgeGraphPart::neighbours(), gum::Set< Key >::resize(), gum::NodeGraphPart::size(), and gum::Set< Key >::size().

Referenced by _computeEliminationTree_(), fillIns(), and triangulatedGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clear()

void gum::StaticTriangulation::clear ( )
virtualinherited

reinitialize the graph to be triangulated to an empty graph

Implements gum::Triangulation.

Definition at line 173 of file staticTriangulation.cpp.

173 {
174 // clear the factories
177
178 // remove the current graphs
179 _original_graph_ = nullptr;
180 _junction_tree_ = nullptr;
181 _triangulated_graph_.clear();
182 _elim_tree_.clear();
184 _elim_cliques_.clear();
186
187 // remove all fill-ins and orderings
188 _fill_ins_.clear();
189 _added_fill_ins_.clear();
190 _elim_order_.clear();
191 _reverse_elim_order_.clear();
192
193 // indicates that the junction tree, the max prime tree, etc, are updated
194 _has_triangulation_ = true;
197 _has_junction_tree_ = true;
199 _has_fill_ins_ = true;
200 }

References _added_fill_ins_, _elim_cliques_, _elim_order_, _elim_tree_, _fill_ins_, _has_elimination_tree_, _has_fill_ins_, _has_junction_tree_, _has_max_prime_junction_tree_, _has_triangulated_graph_, _has_triangulation_, _junction_tree_, _max_prime_junction_tree_, _node_2_max_prime_clique_, _original_graph_, _reverse_elim_order_, _triangulated_graph_, elimination_sequence_strategy_, and junction_tree_strategy_.

Referenced by setGraph().

Here is the caller graph for this function:

◆ copyFactory()

virtual UnconstrainedTriangulation * gum::UnconstrainedTriangulation::copyFactory ( ) const
pure virtual

virtual copy constructor

note that we return a pointer as it enables subclasses to return pointers to their types, not Triangulation pointers. See item 25 of the more effective C++.

Implements gum::StaticTriangulation.

Implemented in gum::DefaultTriangulation.

References UnconstrainedTriangulation().

Here is the call graph for this function:

◆ createdJunctionTreeClique()

NodeId gum::StaticTriangulation::createdJunctionTreeClique ( const NodeId id)
virtualinherited

returns the Id of the clique of the junction tree created by the elimination of a given node during the triangulation process

Implements gum::Triangulation.

◆ createdJunctionTreeCliques()

const NodeProperty< NodeId > & gum::StaticTriangulation::createdJunctionTreeCliques ( )
virtualinherited

returns the Ids of the cliques of the junction tree created by the elimination of the nodes

Implements gum::Triangulation.

◆ createdMaxPrimeSubgraph()

NodeId gum::StaticTriangulation::createdMaxPrimeSubgraph ( const NodeId id)
virtualinherited

returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process

Implements gum::Triangulation.

◆ domainSizes()

const NodeProperty< Size > * gum::Triangulation::domainSizes ( ) const
inherited

returns the domain sizes of the variables of the graph to be triangulated

◆ eliminationOrder() [1/2]

◆ eliminationOrder() [2/2]

Idx gum::StaticTriangulation::eliminationOrder ( const NodeId )
virtualinherited

returns the index of a given node in the elimination order (0 = first node eliminated)

Implements gum::Triangulation.

◆ eliminationSequenceStrategy()

EliminationSequenceStrategy & gum::StaticTriangulation::eliminationSequenceStrategy ( ) const
inherited

returns the elimination sequence strategy used by the triangulation

References eliminationSequenceStrategy().

Referenced by eliminationSequenceStrategy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eliminationTree()

const CliqueGraph & gum::StaticTriangulation::eliminationTree ( )
virtualinherited

returns the elimination tree of a compatible ordering

Implements gum::Triangulation.

◆ fillIns()

const EdgeSet & gum::StaticTriangulation::fillIns ( )
virtualinherited

returns the fill-ins added by the triangulation algorithm

Implements gum::Triangulation.

Definition at line 672 of file staticTriangulation.cpp.

672 {
673 // if we did not compute the triangulation yet, do it and commpute
674 // the fill-ins at the same time
675 if (!_has_triangulation_) {
676 bool want_fill_ins = _we_want_fill_ins_;
677 _we_want_fill_ins_ = true;
679 _we_want_fill_ins_ = want_fill_ins;
680 _has_fill_ins_ = true;
681 }
682
683 // here, we already computed a triangulation and we already computed
684 // the fill-ins, so return them
685 if (_has_fill_ins_) {
686 if (elimination_sequence_strategy_->providesFillIns())
687 return elimination_sequence_strategy_->fillIns();
688 else return _fill_ins_;
689 } else {
690 // ok, here, we shall compute the fill-ins as they were not precomputed
691 if (!_original_graph_) return _fill_ins_;
692
693 // just in case, be sure that the junction tree has been constructed
695
696 for (const auto clik_id: _junction_tree_->nodes()) {
697 // for each clique, add the edges necessary to make it complete
698 const NodeSet& clique = _junction_tree_->clique(clik_id);
699 std::vector< NodeId > clique_nodes(clique.size());
700 unsigned int i = 0;
701
702 for (const auto node: clique) {
703 clique_nodes[i] = node;
704 i += 1;
705 }
706
707 for (i = 0; i < clique_nodes.size(); ++i) {
708 for (unsigned int j = i + 1; j < clique_nodes.size(); ++j) {
709 Edge edge(clique_nodes[i], clique_nodes[j]);
710
711 if (!_original_graph_->existsEdge(edge)) {
712 try {
713 _fill_ins_.insert(edge);
714 } catch (DuplicateElement const&) {}
715 }
716 }
717 }
718 }
719
720 return _fill_ins_;
721 }
722 }

References _fill_ins_, _has_fill_ins_, _has_junction_tree_, _has_triangulation_, _junction_tree_, _original_graph_, _triangulate_(), _we_want_fill_ins_, elimination_sequence_strategy_, junctionTree(), and gum::Set< Key >::size().

Here is the call graph for this function:

◆ initTriangulation_()

void gum::StaticTriangulation::initTriangulation_ ( UndiGraph & graph)
protectedvirtualinherited

the function called to initialize the triangulation process

This function is called when the triangulation process starts and is used to initialize the elimination sequence strategy. Actually, the graph that is modified by the triangulation algorithm is a copy of the original graph, and this copy needs be known by the elimination sequence strategy. initTriangulation_ is used to transmit this knowledge to the elimination sequence (through method setGraph of the elimination sequence class).

Parameters
graphthe very graph that is triangulated (this is a copy of original_graph)

Reimplemented in gum::OrderedTriangulation, and gum::PartialOrderedTriangulation.

Definition at line 725 of file staticTriangulation.cpp.

725 {
727 }
const NodeProperty< Size > * domain_sizes_
the domain sizes of the variables/nodes of the graph

References gum::Triangulation::domain_sizes_, and elimination_sequence_strategy_.

Referenced by _triangulate_(), and junctionTreeStrategy().

Here is the caller graph for this function:

◆ isMinimalityRequired()

virtual bool gum::StaticTriangulation::isMinimalityRequired ( ) const
finalvirtualinherited

indicates wether minimality is required

◆ junctionTree()

const CliqueGraph & gum::StaticTriangulation::junctionTree ( )
virtualinherited

returns a compatible junction tree

Implements gum::Triangulation.

Referenced by _computeMaxPrimeJunctionTree_(), fillIns(), and triangulatedGraph().

Here is the caller graph for this function:

◆ junctionTreeStrategy()

JunctionTreeStrategy & gum::StaticTriangulation::junctionTreeStrategy ( ) const
inherited

returns the junction tree strategy used by the triangulation

References StaticTriangulation(), initTriangulation_(), and junctionTreeStrategy().

Referenced by junctionTreeStrategy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxLog10CliqueDomainSize()

double gum::Triangulation::maxLog10CliqueDomainSize ( )
inherited

returns the max of log10DomainSize of the cliques in the junction tree.

This is usefull for instance to estimate the complexity (both in space and in time) of the inference that will use the junction tree.

This method is not 'const' since it can be called before building any junction tree and hence it needs to build it...

Definition at line 86 of file triangulation.cpp.

86 {
87 double res = 0.0;
88 double dSize;
89 const JunctionTree& jt = junctionTree(); // here, the fact that we get
90 // a junction tree ensures that domain_sizes_ is different from nullptr
91
92 for (const NodeId cl: jt) {
93 dSize = 0.0;
94
95 for (const auto node: jt.clique(cl))
96 dSize += std::log10((*domain_sizes_)[node]);
97
98 if (res < dSize) res = dSize;
99 }
100
101 return res;
102 }
virtual const CliqueGraph & junctionTree()=0
returns a compatible junction tree
CliqueGraph JunctionTree
a junction tree is a clique graph satisfying the running intersection property and such that no cliqu...

References gum::CliqueGraph::clique(), domain_sizes_, and junctionTree().

Referenced by gum::MaxInducedWidthMCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::_checkConditions_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxPrimeSubgraphTree()

const CliqueGraph & gum::StaticTriangulation::maxPrimeSubgraphTree ( )
virtualinherited

returns a junction tree of maximal prime subgraphs

Warning
Actually, the cliques of the junction tree are guarranteed to be maximal prime subgraph of the original graph that was triangulated only if the triangulation performed is minimal (in the sense that removing any edge in the triangulated graph results in a nontriangulated graph). This can be ensured by requiring minimality of the triangulation.

Implements gum::Triangulation.

◆ newFactory()

virtual UnconstrainedTriangulation * gum::UnconstrainedTriangulation::newFactory ( ) const
pure virtual

returns a fresh triangulation (over an empty graph) of the same type as the current object

note that we return a pointer as it enables subclasses to return pointers to their types, not Triangulation pointers. See item 25 of the more effective C++.

Implements gum::StaticTriangulation.

Implemented in gum::DefaultTriangulation.

References UnconstrainedTriangulation().

Here is the call graph for this function:

◆ operator=()

UnconstrainedTriangulation & gum::UnconstrainedTriangulation::operator= ( const UnconstrainedTriangulation & )
private

forbid copy operator

References UnconstrainedTriangulation().

Here is the call graph for this function:

◆ originalGraph()

const UndiGraph * gum::StaticTriangulation::originalGraph ( ) const
inherited

returns the graph to be triangulated

Warning
if we have not set yet a graph, then originalGraph () will return a nullptr.

References originalGraph().

Referenced by gum::DefaultJunctionTreeStrategy::copyFactory(), and originalGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reverseEliminationOrder()

const NodeProperty< NodeId > & gum::StaticTriangulation::reverseEliminationOrder ( )
inherited

returns a table indicating, for each node, at which step it was deleted by the triangulation process

◆ setFillIns()

void gum::StaticTriangulation::setFillIns ( bool )
inherited

sets/unsets the record of the fill-ins in the standard triangulation procedure

References setFillIns().

Referenced by setFillIns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGraph()

void gum::StaticTriangulation::setGraph ( const UndiGraph * graph,
const NodeProperty< Size > * domsizes )
virtualinherited

initialize the triangulation data structures for a new graph

Parameters
graphthe graph to be triangulated, i.e., the nodes of which will be eliminated
domsizesthe domain sizes of the nodes to be eliminated
Warning
Note that we allow domsizes to be defined over nodes/variables that do not belong to graph. These sizes will simply be ignored. However, it is compulsory that all the nodes of graph belong to dom_sizes
the graph is not copied but only referenced by the elimination sequence algorithm.

Implements gum::Triangulation.

Reimplemented in gum::OrderedTriangulation, and gum::PartialOrderedTriangulation.

Definition at line 524 of file staticTriangulation.cpp.

524 {
525 // remove the old graph
526 clear();
527
528 if (graph != nullptr) {
529 // prepare the size of the data for the new graph
530 _elim_order_.resize(graph->size());
531 _reverse_elim_order_.resize(graph->size());
532 _elim_cliques_.resize(graph->size());
533 _added_fill_ins_.resize(graph->size());
534 _node_2_max_prime_clique_.resize(graph->size());
535 }
536
537 // keep track of the variables passed in argument
538 _original_graph_ = graph;
539 domain_sizes_ = domsizes;
540
541 // indicate that no triangulation was performed for this graph
542 _has_triangulation_ = false;
545 _has_junction_tree_ = false;
547 _has_fill_ins_ = false;
548 }
void clear()
reinitialize the graph to be triangulated to an empty graph

References _added_fill_ins_, _elim_cliques_, _elim_order_, _has_elimination_tree_, _has_fill_ins_, _has_junction_tree_, _has_max_prime_junction_tree_, _has_triangulated_graph_, _has_triangulation_, _node_2_max_prime_clique_, _original_graph_, _reverse_elim_order_, clear(), gum::Triangulation::domain_sizes_, and gum::NodeGraphPart::size().

Referenced by gum::OrderedTriangulation::setGraph(), and gum::PartialOrderedTriangulation::setGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMinimalRequirement()

void gum::StaticTriangulation::setMinimalRequirement ( bool )
inherited

sets/unset the minimality requirement

◆ triangulatedGraph()

const UndiGraph & gum::StaticTriangulation::triangulatedGraph ( )
virtualinherited

returns the triangulated graph

Implements gum::Triangulation.

Definition at line 485 of file staticTriangulation.cpp.

485 {
487
488 // if we did not construct the triangulated graph during the triangulation,
489 // that is, we just constructed the junction tree, we shall construct it now
491 // just in case, be sure that the junction tree has been constructed
493
494 // copy the original graph
496
497 for (const auto clik_id: *_junction_tree_) {
498 // for each clique, add the edges necessary to make it complete
499 const NodeSet& clique = _junction_tree_->clique(clik_id);
500 std::vector< NodeId > clique_nodes(clique.size());
501 unsigned int i = 0;
502
503 for (const auto node: clique) {
504 clique_nodes[i] = node;
505 i += 1;
506 }
507
508 for (i = 0; i < clique_nodes.size(); ++i) {
509 for (unsigned int j = i + 1; j < clique_nodes.size(); ++j) {
510 try {
511 _triangulated_graph_.addEdge(clique_nodes[i], clique_nodes[j]);
512 } catch (DuplicateElement const&) {}
513 }
514 }
515 }
516
518 }
519
521 }

References _has_junction_tree_, _has_triangulated_graph_, _has_triangulation_, _junction_tree_, _original_graph_, _triangulate_(), _triangulated_graph_, junctionTree(), and gum::Set< Key >::size().

Here is the call graph for this function:

Member Data Documentation

◆ _added_fill_ins_

std::vector< EdgeSet > gum::StaticTriangulation::_added_fill_ins_
privateinherited

a vector containing the set of fill-ins added after each node elimination (used by recursive thinning)

Definition at line 312 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), _computeRecursiveThinning_(), _triangulate_(), clear(), and setGraph().

◆ _elim_cliques_

NodeProperty< NodeSet > gum::StaticTriangulation::_elim_cliques_
privateinherited

the cliques formed by the elimination of the nodes

Definition at line 270 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), _computeRecursiveThinning_(), _triangulate_(), clear(), and setGraph().

◆ _elim_order_

std::vector< NodeId > gum::StaticTriangulation::_elim_order_
privateinherited

the order in which nodes are eliminated by the algorithm

Definition at line 264 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), _computeRecursiveThinning_(), _triangulate_(), clear(), and setGraph().

◆ _elim_tree_

CliqueGraph gum::StaticTriangulation::_elim_tree_
privateinherited

the elimination tree computed by the algorithm

Definition at line 273 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), and clear().

◆ _fill_ins_

EdgeSet gum::StaticTriangulation::_fill_ins_
privateinherited

the fill-ins added during the whole triangulation process

Definition at line 261 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), _computeRecursiveThinning_(), _triangulate_(), clear(), and fillIns().

◆ _has_elimination_tree_

bool gum::StaticTriangulation::_has_elimination_tree_ {false}
privateinherited

a boolean indicating whether the elimination tree has been computed

Definition at line 295 of file staticTriangulation.h.

295{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), clear(), and setGraph().

◆ _has_fill_ins_

bool gum::StaticTriangulation::_has_fill_ins_ {false}
privateinherited

indicates whether we actually computed fill-ins

Definition at line 305 of file staticTriangulation.h.

305{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _computeRecursiveThinning_(), _triangulate_(), clear(), fillIns(), and setGraph().

◆ _has_junction_tree_

bool gum::StaticTriangulation::_has_junction_tree_ {false}
privateinherited

a boolean indicating whether the junction tree has been constructed

Definition at line 298 of file staticTriangulation.h.

298{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _computeMaxPrimeJunctionTree_(), clear(), fillIns(), setGraph(), and triangulatedGraph().

◆ _has_max_prime_junction_tree_

bool gum::StaticTriangulation::_has_max_prime_junction_tree_ {false}
privateinherited

indicates whether a maximal prime subgraph junction tree has been constructed

Definition at line 302 of file staticTriangulation.h.

302{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _computeMaxPrimeJunctionTree_(), clear(), and setGraph().

◆ _has_triangulated_graph_

bool gum::StaticTriangulation::_has_triangulated_graph_ {false}
privateinherited

a boolean indicating whether we have constructed the triangulated graph

Definition at line 292 of file staticTriangulation.h.

292{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _triangulate_(), clear(), setGraph(), and triangulatedGraph().

◆ _has_triangulation_

bool gum::StaticTriangulation::_has_triangulation_ {false}
privateinherited

a boolean indicating whether we have parformed a triangulation

Definition at line 289 of file staticTriangulation.h.

289{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), _triangulate_(), clear(), fillIns(), setGraph(), and triangulatedGraph().

◆ _junction_tree_

const CliqueGraph* gum::StaticTriangulation::_junction_tree_ {nullptr}
privateinherited

the junction tree computed by the algorithm

note that the junction tree is owned by the junctionTreeStrategy and, therefore, its deletion from memory is not handled by the static triangulation class.

Definition at line 279 of file staticTriangulation.h.

279{nullptr};

Referenced by StaticTriangulation(), _computeMaxPrimeJunctionTree_(), _computeMaxPrimeMergings_(), clear(), fillIns(), and triangulatedGraph().

◆ _max_prime_junction_tree_

CliqueGraph gum::StaticTriangulation::_max_prime_junction_tree_
privateinherited

the maximal prime subgraph junction tree computed from the junction tree

Definition at line 282 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), _computeMaxPrimeJunctionTree_(), and clear().

◆ _minimality_required_

bool gum::StaticTriangulation::_minimality_required_ {false}
privateinherited

indicates whether the triangulation must be minimal

Definition at line 308 of file staticTriangulation.h.

308{false};

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), and _triangulate_().

◆ _node_2_max_prime_clique_

NodeProperty< NodeId > gum::StaticTriangulation::_node_2_max_prime_clique_
privateinherited

indicates which clique of the max prime junction tree was created by the elmination of a given node (the key of the table)

Definition at line 286 of file staticTriangulation.h.

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), _computeMaxPrimeJunctionTree_(), clear(), and setGraph().

◆ _original_graph_

const UndiGraph* gum::StaticTriangulation::_original_graph_ {nullptr}
privateinherited

a pointer to the (external) original graph (which will be triangulated)

Definition at line 255 of file staticTriangulation.h.

255{nullptr};

Referenced by StaticTriangulation(), StaticTriangulation(), StaticTriangulation(), _computeEliminationTree_(), _computeMaxPrimeMergings_(), _triangulate_(), clear(), fillIns(), setGraph(), and triangulatedGraph().

◆ _reverse_elim_order_

NodeProperty< NodeId > gum::StaticTriangulation::_reverse_elim_order_
privateinherited

◆ _triangulated_graph_

UndiGraph gum::StaticTriangulation::_triangulated_graph_
privateinherited

◆ _we_want_fill_ins_

bool gum::StaticTriangulation::_we_want_fill_ins_ {false}
privateinherited

a boolean indicating if we want fill-ins list with the standard triangulation method

Definition at line 316 of file staticTriangulation.h.

316{false};

Referenced by StaticTriangulation(), StaticTriangulation(), _triangulate_(), and fillIns().

◆ domain_sizes_

const NodeProperty< Size >* gum::Triangulation::domain_sizes_ {nullptr}
protectedinherited

◆ elimination_sequence_strategy_

◆ junction_tree_strategy_

JunctionTreeStrategy* gum::StaticTriangulation::junction_tree_strategy_ {nullptr}
protectedinherited

The documentation for this class was generated from the following files: