aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
staticTriangulation_inl.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2026 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41#pragma once
42
43
49
51#ifndef DOXYGEN_SHOULD_SKIP_THIS
52
53
54namespace gum {
55
56
58 INLINE
59 const std::vector< NodeId >& StaticTriangulation::eliminationOrder() {
61
62 return _elim_order_;
63 }
64
67 INLINE
70
71 return _reverse_elim_order_[id];
72 }
73
76 INLINE
79
81 }
82
84 INLINE
87
88 return _elim_tree_;
89 }
90
92 INLINE
94 // checks if junctionTree already exists
96 _junction_tree_ = &(junction_tree_strategy_->junctionTree());
98 }
99
100 return *_junction_tree_;
101 }
102
104 INLINE
107
109 }
110
113 INLINE
116
117 return _node_2_max_prime_clique_[id];
118 }
119
122 INLINE
124 return junction_tree_strategy_->createdClique(id);
125 }
126
129 INLINE
131 return junction_tree_strategy_->createdCliques();
132 }
133
135 INLINE
138 elimination_sequence_strategy_->askFillIns(b);
139 }
140
142 INLINE
144
148 }
149
153 }
154
157
158
159} /* namespace gum */
160
161
162#endif /* DOXYGEN_SHOULD_SKIP_THIS */
Basic graph of cliques.
Definition cliqueGraph.h:77
The base class for all elimination sequence algorithms used by triangulation algorithms.
Base Class for all the algorithms producing a junction given a set of cliques/subcliques resulting fr...
bool _has_junction_tree_
a boolean indicating whether the junction tree has been constructed
const CliqueGraph & maxPrimeSubgraphTree() override
returns a junction tree of maximal prime subgraphs
NodeProperty< NodeId > _reverse_elim_order_
the elimination order (access by NodeId)
void setFillIns(bool)
sets/unsets the record of the fill-ins in the standard triangulation procedure
const NodeProperty< NodeId > & reverseEliminationOrder()
returns a table indicating, for each node, at which step it was deleted by the triangulation process
JunctionTreeStrategy * junction_tree_strategy_
the junction tree strategy used by the triangulation
void _computeMaxPrimeJunctionTree_()
computes the junction tree of the maximal prime subgraphs
void _computeEliminationTree_()
returns an elimination tree from a triangulated graph
JunctionTreeStrategy & junctionTreeStrategy() const
returns the junction tree strategy used by the triangulation
const UndiGraph * originalGraph() const
returns the graph to be triangulated
bool _has_triangulation_
a boolean indicating whether we have parformed a triangulation
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
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 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
bool _minimality_required_
indicates whether the triangulation must be minimal
virtual bool isMinimalityRequired() const final
indicates wether minimality is required
EliminationSequenceStrategy & eliminationSequenceStrategy() const
returns the elimination sequence strategy used by the triangulation
const NodeProperty< NodeId > & createdJunctionTreeCliques() override
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
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 t...
const CliqueGraph & junctionTree() override
returns a compatible junction tree
void _triangulate_()
the function that performs the triangulation
const std::vector< NodeId > & eliminationOrder() override
returns an elimination ordering compatible with the triangulated graph
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
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
NodeId createdMaxPrimeSubgraph(const NodeId id) override
returns the Id of the maximal prime subgraph created by the elimination of a given node during the tr...
const CliqueGraph & eliminationTree() override
returns the elimination tree of a compatible ordering
Base class for undirected graphs.
Definition undiGraph.h:130
Size Idx
Type for indexes.
Definition types.h:79
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
base class for all non-incremental triangulations.