aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
edgeGrowth.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
41
48
49#ifndef GUM_EDGE_GROWTH_H
50#define GUM_EDGE_GROWTH_H
51
52#include <list>
53#include <ostream>
54#include <utility>
55#include <vector>
56
59
60namespace gum {
61 namespace prm {
62 namespace gspan {
63 template < typename GUM_SCALAR >
64 class DFSTree;
65
72 template < typename GUM_SCALAR >
107
108 template < typename GUM_SCALAR >
109 std::ostream& operator<<(std::ostream& out, const EdgeGrowth< GUM_SCALAR >& edge);
110
111
112#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
113 extern template class EdgeGrowth< double >;
114#endif
115
116
117 } /* namespace gspan */
118 } /* namespace prm */
119} /* namespace gum */
120
122
123#endif /* GUM_EDGE_GROWTH_H */
Base class for undirected graphs.
Definition undiGraph.h:128
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
Definition PRMInstance.h:79
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph.
Definition DFSTree.h:77
This class is used to define an edge growth of a pattern in this DFSTree.
Definition edgeGrowth.h:73
NodeId u
The id of the node from which we grow an edge.
Definition edgeGrowth.h:83
std::vector< NodeId > * degree_list
Vector used for computation.
Definition edgeGrowth.h:103
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > * > > matches
The mapping between the u and v for each match in the interface graph.
Definition edgeGrowth.h:95
Set< NodeId > max_indep_set
The max indep set of matches.
Definition edgeGrowth.h:105
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition edgeGrowth.h:90
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition edgeGrowth.h:101
LabelData * edge
The LabelData over the edge of this edge growth.
Definition edgeGrowth.h:85
std::string toString()
Return a string representation of this.
LabelData * l_v
The LabelData over the node of this edge growth.
Definition edgeGrowth.h:87
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
void insert(PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
Add the pair (u,v) as a match for the current growth.
Inline implementation of the DFSTree class.
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
std::ostream & operator<<(std::ostream &out, const DFSCode &code)
Print code in out.
Definition DFSCode.cpp:59
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
Headers of the Pattern class.
Inner class to handle data about labels in this interface graph.