aGrUM 2.3.2
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-2025 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-2025 *
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#pragma once
41
42
48
49#ifndef DOXYGEN_SHOULD_SKIP_THIS
50
51
52namespace gum {
53
54
56 INLINE
57 const std::vector< NodeId >& StaticTriangulation::eliminationOrder() {
59
60 return _elim_order_;
61 }
62
65 INLINE
68
69 return _reverse_elim_order_[id];
70 }
71
74 INLINE
77
79 }
80
82 INLINE
85
86 return _elim_tree_;
87 }
88
90 INLINE
92 // checks if junctionTree already exists
94 _junction_tree_ = &(junction_tree_strategy_->junctionTree());
96 }
97
98 return *_junction_tree_;
99 }
100
102 INLINE
105
107 }
108
111 INLINE
114
115 return _node_2_max_prime_clique_[id];
116 }
117
120 INLINE
122 return junction_tree_strategy_->createdClique(id);
123 }
124
127 INLINE
129 return junction_tree_strategy_->createdCliques();
130 }
131
133 INLINE
136 elimination_sequence_strategy_->askFillIns(b);
137 }
138
140 INLINE
142
146 }
147
151 }
152
155
156
157} /* namespace gum */
158
159
160#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
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
NodeId createdJunctionTreeClique(const NodeId id)
returns the Id of the clique of the junction tree created by the elimination of a given node during t...
const CliqueGraph & eliminationTree()
returns the elimination tree of a compatible ordering
void _computeEliminationTree_()
returns an elimination tree from a triangulated graph
JunctionTreeStrategy & junctionTreeStrategy() const
returns the junction tree strategy used by the triangulation
const std::vector< NodeId > & eliminationOrder()
returns an elimination ordering compatible with the triangulated graph
const UndiGraph * originalGraph() const
returns the graph to be triangulated
const CliqueGraph & junctionTree()
returns a compatible junction tree
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
NodeId createdMaxPrimeSubgraph(const NodeId id)
returns the Id of the maximal prime subgraph created by the elimination of a given node during the tr...
bool _minimality_required_
indicates whether the triangulation must be minimal
const NodeProperty< NodeId > & createdJunctionTreeCliques()
returns the Ids of the cliques of the junction tree created by the elimination of the nodes
virtual bool isMinimalityRequired() const final
indicates wether minimality is required
EliminationSequenceStrategy & eliminationSequenceStrategy() const
returns the elimination sequence strategy used by the triangulation
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
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
const CliqueGraph & maxPrimeSubgraphTree()
returns a junction tree of maximal prime subgraphs
Base class for undirected graphs.
Definition undiGraph.h:128
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