aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
gum::DefaultTriangulation Class Reference

The default triangulation algorithm used by aGrUM. More...

#include <defaultTriangulation.h>

Inheritance diagram for gum::DefaultTriangulation:
Collaboration diagram for gum::DefaultTriangulation:

Public Member Functions

Constructors / Destructors
 DefaultTriangulation (const UndiGraph *graph, const NodeProperty< Size > *dom_sizes, bool minimality=false, double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
 basic constructor. initialize the triangulation
 DefaultTriangulation (bool minimality=false, double theRatio=GUM_QUASI_RATIO, double theThreshold=GUM_WEIGHT_THRESHOLD)
 default constructor: initialize the triangulation for an empty graph
 DefaultTriangulation (const DefaultTriangulation &from)
 copy constructor
 DefaultTriangulation (DefaultTriangulation &&from)
 move constructor
 ~DefaultTriangulation () override
 destructor
DefaultTriangulationnewFactory () const override
 virtual clone constructor
DefaultTriangulationcopyFactory () const override
 virtual copy constructor
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 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

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 redundant 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
Operators
DefaultTriangulationoperator= (const DefaultTriangulation &)
 forbid copy operator

Private Attributes

double _quasi_ratio_
 the ratio above which we consider nodes to be quasi simplicial
double _threshold_
 threshold under which almost and quasi simplicial nodes can be chosen to be eliminated
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

void setGraph (const UndiGraph *graph, const NodeProperty< Size > *domsizes) override
 initialize the triangulation data structures for a new graph
const EdgeSetfillIns () override
 returns the fill-ins added by the triangulation algorithm
const std::vector< NodeId > & eliminationOrder () override
 returns an elimination ordering compatible with the triangulated graph
Idx eliminationOrder (const NodeId) override
 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 () override
 returns the triangulated graph
const CliqueGrapheliminationTree () override
 returns the elimination tree of a compatible ordering
const CliqueGraphjunctionTree () override
 returns a compatible junction tree
NodeId createdJunctionTreeClique (const NodeId id) override
 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 () override
 returns the Ids of the cliques of the junction tree created by the elimination of the nodes
const CliqueGraphmaxPrimeSubgraphTree () override
 returns a junction tree of maximal prime subgraphs
NodeId createdMaxPrimeSubgraph (const NodeId id) override
 returns the Id of the maximal prime subgraph created by the elimination of a given node during the triangulation process
void clear () override
 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

The default triangulation algorithm used by aGrUM.

By default, this is the very class used by aGrUM for performing triangulations. The algorithm used is the following:

the graph passed in argument is completed by fill-ins until it becomes

triangulated

then an elimination tree is computed from this triangulated graph

finally, a junction tree is derived from the elimination tree

The triangulation step first tries to remove simplicial nodes, that is, nodes that belong to only one clique. Then almost simplicial nodes of low width are removed (almost simplicial nodes are nodes such that all but one of their neighbors form a clique). Then quasi simplicial nodes are removed, that is, nodes such that the ratio of the number of fill-ins to add to form a clique by the number of edges in a clique is small. Then nodes that create cliques of small weight are removed.

The transformation from the elimination tree to the join tree is performed bottom-up. Each time a node of the elimination tree is identified to be a sub-clique, it is removed and all of its parents but one are linked to the latter. The identification of sub-cliques is very fast (comparison of 2 ints).

Definition at line 81 of file defaultTriangulation.h.

Constructor & Destructor Documentation

◆ DefaultTriangulation() [1/4]

gum::DefaultTriangulation::DefaultTriangulation ( const UndiGraph * graph,
const NodeProperty< Size > * dom_sizes,
bool minimality = false,
double theRatio = GUM_QUASI_RATIO,
double theThreshold = GUM_WEIGHT_THRESHOLD )
explicit

basic constructor. initialize the triangulation

References GUM_QUASI_RATIO, and GUM_WEIGHT_THRESHOLD.

Referenced by DefaultTriangulation(), DefaultTriangulation(), copyFactory(), newFactory(), and operator=().

Here is the caller graph for this function:

◆ DefaultTriangulation() [2/4]

gum::DefaultTriangulation::DefaultTriangulation ( bool minimality = false,
double theRatio = GUM_QUASI_RATIO,
double theThreshold = GUM_WEIGHT_THRESHOLD )
explicit

default constructor: initialize the triangulation for an empty graph

References GUM_QUASI_RATIO, and GUM_WEIGHT_THRESHOLD.

◆ DefaultTriangulation() [3/4]

gum::DefaultTriangulation::DefaultTriangulation ( const DefaultTriangulation & from)

copy constructor

References DefaultTriangulation().

Here is the call graph for this function:

◆ DefaultTriangulation() [4/4]

gum::DefaultTriangulation::DefaultTriangulation ( DefaultTriangulation && from)

move constructor

References DefaultTriangulation().

Here is the call graph for this function:

◆ ~DefaultTriangulation()

gum::DefaultTriangulation::~DefaultTriangulation ( )
override

destructor

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
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
const CliqueGraph & junctionTree() override
returns a compatible 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 redundant 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 if (numbered_neighbours.contains(neighbour)) {
323 numbered_neighbours.setPriority(neighbour, 1 + numbered_neighbours.priority(neighbour));
324 }
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::PriorityQueueImplementation< Val, Priority, Cmp, Gen >::contains(), 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 if (!_original_graph_)
556 GUM_ERROR(GraphError, "StaticTriangulation: no graph set (call setGraph first)")
557
558 // copy the graph to be triangulated, so that we can modify it
559 UndiGraph tmp_graph = *_original_graph_;
560
561 initTriangulation_(tmp_graph);
563
564 // if we are to do recursive thinning, we will have to add fill-ins to the
565 // triangulated graph each time we eliminate a node. Hence, we shall
566 // initialize the triangulated graph by a copy of the original graph
570 }
571
572 // perform the triangulation
573 NodeId removable_node = 0;
574
575 for (unsigned int nb_elim = 0; tmp_graph.size() != 0; ++nb_elim) {
576 removable_node = elimination_sequence_strategy_->nextNodeToEliminate();
577
578 // when minimality is not required, i.e., we won't apply recursive
579 // thinning, the cliques sets can be computed
581 NodeSet& cliques = _elim_cliques_.insert(removable_node, NodeSet()).second;
582 cliques.resize(tmp_graph.neighbours(removable_node).size() / 2);
583 cliques << removable_node;
584 for (const auto clik: tmp_graph.neighbours(removable_node))
585 cliques << clik;
586 } else {
587 // here recursive thinning will be applied, hence we need store the
588 // fill-ins added by the current node removal
589 EdgeSet& current_fill = _added_fill_ins_[nb_elim];
590 NodeId node1, node2;
591
592 const NodeSet& nei = tmp_graph.neighbours(removable_node);
593
594 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
595 node1 = *iter_edges1;
596 auto iter_edges2 = iter_edges1;
597
598 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
599 node2 = *iter_edges2;
600 Edge edge(node1, node2);
601
602 if (!tmp_graph.existsEdge(edge)) {
603 current_fill.insert(edge);
604 _triangulated_graph_.addEdge(node1, node2);
605 }
606 }
607 }
608 }
609
610 // if we want fill-ins but the elimination sequence strategy does not
611 // compute them, we shall compute them here
612 if (_we_want_fill_ins_ && !elimination_sequence_strategy_->providesFillIns()) {
613 NodeId node1, node2;
614
615 // add edges between removable_node's neighbours in order to create
616 // a clique
617 const NodeSet& nei = tmp_graph.neighbours(removable_node);
618
619 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
620 node1 = *iter_edges1;
621 auto iter_edges2 = iter_edges1;
622
623 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
624 node2 = *iter_edges2;
625 Edge edge(node1, node2);
626
627 if (!tmp_graph.existsEdge(edge)) { _fill_ins_.insert(edge); }
628 }
629 }
630
631 // delete removable_node and its adjacent edges
632 tmp_graph.eraseNode(removable_node);
633 }
634
635 // inform the elimination sequence that we are actually removing
636 // removable_node (this enables, for instance, to update the weights of
637 // the nodes in the graph)
638 elimination_sequence_strategy_->eliminationUpdate(removable_node);
639
640 if (!elimination_sequence_strategy_->providesGraphUpdate()) {
641 NodeId node1, node2;
642
643 const NodeSet& nei = tmp_graph.neighbours(removable_node);
644
645 for (auto iter_edges1 = nei.begin(); iter_edges1 != nei.end(); ++iter_edges1) {
646 node1 = *iter_edges1;
647 auto iter_edges2 = iter_edges1;
648
649 for (++iter_edges2; iter_edges2 != nei.end(); ++iter_edges2) {
650 node2 = *iter_edges2;
651 Edge edge(node1, node2);
652
653 if (!tmp_graph.existsEdge(edge)) { tmp_graph.addEdge(node1, node2); }
654 }
655 }
656
657 tmp_graph.eraseNode(removable_node);
658 }
659
660 // update the elimination order
661 _elim_order_[nb_elim] = removable_node;
662 _reverse_elim_order_.insert(removable_node, nb_elim);
663 }
664
665 // indicate whether we actually computed fill-ins
667
668 // if minimality is required, remove the redondant edges
670
671 _has_triangulation_ = true;
672 }
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 redundant 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
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

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(), GUM_ERROR, 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 ( )
overridevirtualinherited

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()

DefaultTriangulation * gum::DefaultTriangulation::copyFactory ( ) const
nodiscardoverridevirtual

virtual copy constructor

Implements gum::UnconstrainedTriangulation.

References DefaultTriangulation().

Here is the call graph for this function:

◆ createdJunctionTreeClique()

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

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 ( )
overridevirtualinherited

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)
overridevirtualinherited

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 )
overridevirtualinherited

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 ( )
overridevirtualinherited

returns the elimination tree of a compatible ordering

Implements gum::Triangulation.

◆ fillIns()

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

returns the fill-ins added by the triangulation algorithm

Implements gum::Triangulation.

Definition at line 675 of file staticTriangulation.cpp.

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

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 728 of file staticTriangulation.cpp.

728 {
730 }
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 ( )
overridevirtualinherited

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 useful 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 ( )
overridevirtualinherited

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()

DefaultTriangulation * gum::DefaultTriangulation::newFactory ( ) const
nodiscardoverridevirtual

virtual clone constructor

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::UnconstrainedTriangulation.

References DefaultTriangulation().

Here is the call graph for this function:

◆ operator=()

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

forbid copy operator

References DefaultTriangulation().

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 )
overridevirtualinherited

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.

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() override
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(), and gum::Triangulation::domain_sizes_.

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 ( )
overridevirtualinherited

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().

◆ _quasi_ratio_

double gum::DefaultTriangulation::_quasi_ratio_
private

the ratio above which we consider nodes to be quasi simplicial

Definition at line 126 of file defaultTriangulation.h.

◆ _reverse_elim_order_

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

◆ _threshold_

double gum::DefaultTriangulation::_threshold_
private

threshold under which almost and quasi simplicial nodes can be chosen to be eliminated

Definition at line 130 of file defaultTriangulation.h.

◆ _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 file: