aGrUM
3.3.2
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
reachability.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
56
#ifndef GUM_GRAPH_REACHABILITY_H
57
#define GUM_GRAPH_REACHABILITY_H
58
59
#include <
agrum/agrum.h
>
60
61
#include <
agrum/base/graphs/graphConcepts.h
>
62
63
namespace
gum::graph
{
64
65
// =========================================================================
66
// Directed graphs (GUM_DiGraphable)
67
// =========================================================================
68
73
template
< GUM_DiGraphable G >
74
NodeSet
ancestors
(
const
G& g,
NodeId
id
);
75
80
template
< GUM_DiGraphable G >
81
NodeSet
descendants
(
const
G& g,
NodeId
id
);
82
84
template
< GUM_DiGraphable G >
85
NodeSet
family
(
const
G& g,
NodeId
id
);
86
88
template
< GUM_DiGraphable G >
89
NodeSet
family
(
const
G& g,
const
NodeSet
& ids);
90
91
// =========================================================================
92
// Undirected graphs (GUM_UndiGraphable)
93
// =========================================================================
94
102
template
< GUM_UndiGraphable G >
103
NodeProperty< NodeId >
chainComponents
(
const
G& g);
104
115
template
< GUM_NodeGraphable G >
116
NodeProperty< NodeId >
connectedComponents
(
const
G& g);
117
132
template
< GUM_UndiGraphable G >
133
bool
areConnected
(
const
G& g,
const
NodeSet
& A,
const
NodeSet
& B);
134
135
// =========================================================================
136
// Mixed graphs (GUM_MixedGraphable)
137
// =========================================================================
138
145
template
< GUM_MixedGraphable G >
146
NodeSet
chainComponent
(
const
G& g,
NodeId
node);
147
149
template
< GUM_MixedGraphable G >
150
NodeSet
boundary
(
const
G& g,
NodeId
node);
151
152
}
// namespace gum::graph
153
154
#include <
agrum/base/graphs/algorithms/generic/reachability_tpl.h
>
155
156
#endif
// GUM_GRAPH_REACHABILITY_H
agrum.h
graphConcepts.h
C++20 concepts for aGrUM graph interfaces.
gum::NodeId
Size NodeId
Type for node ids.
Definition
graphElements.h:117
gum::NodeProperty
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Definition
graphElements.h:407
gum::NodeSet
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
Definition
graphElements.h:392
gum::graph
Definition
bayesBall.h:79
gum::graph::descendants
NodeSet descendants(const G &g, NodeId id)
Returns the set of all descendants of id (nodes reachable from id following arc direction).
Definition
reachability_tpl.h:73
gum::graph::ancestors
NodeSet ancestors(const G &g, NodeId id)
Returns the set of all ancestors of id (nodes from which id is reachable following arc direction).
Definition
reachability_tpl.h:57
gum::graph::areConnected
bool areConnected(const G &g, const NodeSet &A, const NodeSet &B)
Returns true iff some node in A can reach some node in B via undirected edges.
Definition
reachability_tpl.h:156
gum::graph::boundary
NodeSet boundary(const G &g, NodeId node)
Returns the boundary of node: neighbours ∪ parents ∪ children.
Definition
reachability_tpl.h:195
gum::graph::chainComponents
NodeProperty< NodeId > chainComponents(const G &g)
Returns a node-to-component-id mapping for the chain components of g (connected components of the edg...
Definition
reachability_tpl.h:103
gum::graph::chainComponent
NodeSet chainComponent(const G &g, NodeId node)
Returns the chain component of node in g.
Definition
reachability_tpl.h:179
gum::graph::family
NodeSet family(const G &g, NodeId id)
Returns the family of id : { id } ∪ parents(id).
Definition
reachability_tpl.h:89
gum::graph::connectedComponents
NodeProperty< NodeId > connectedComponents(const G &g)
Returns a node-to-component-id mapping for the (weakly) connected components of g.
Definition
reachability_tpl.h:125
reachability_tpl.h
Template implementations for reachability.h.
aGrUM
3.3.2
© PHW&CG&others - 2022
DoXyGeN 1.18.0