6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of interface for graph augmentation algorithms
12 * \author Carsten Gutwenger
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
47 #ifndef OGDF_AUGMENTATION_MODULE_H
48 #define OGDF_AUGMENTATION_MODULE_H
52 #include <ogdf/basic/Graph.h>
57 * \brief The base class for graph augmentation algorithms.
59 * The class \a AugmentationModule is the base class for augmentation modules.
60 * An augmentation module transforms an input graph \a G into an output
61 * graph \a G' by adding edges, such that \a G' has a certain
62 * property, e.g., biconnected.
64 * <H3>Implementation of Augmentation Algorithms</H3>
65 * An implementation of an augmentation module must override
66 * the protected method doCall(G,L), which gets as
67 * input a graph reference \a G. It then adds the augmented edges
68 * to \a G and returns the list of added edges in \a L.
71 class OGDF_EXPORT AugmentationModule
{
73 //! Initializes an augmentation module.
74 AugmentationModule() { }
76 virtual ~AugmentationModule() { }
78 //! Calls the augmentation module for graph \a G.
84 //! Calls the augmentation module for graph \a G.
85 void operator()(Graph
& G
) { call(G
); }
88 * \brief Calls the augmentation module for graph \a G.
90 * Returns the list of added edges in \a L.
92 void call(Graph
& G
, List
<edge
> &L
) {
94 m_nAddedEdges
= L
.size();
98 * \brief Calls the augmentation module for graph \a G.
100 * Returns the list of added edges in \a L.
102 void operator()(Graph
& G
, List
<edge
> &L
) { call(G
,L
); }
104 //! Returns the number of added edges.
105 int numberOfAddedEdges() const {
106 return m_nAddedEdges
;
111 * \brief Implements the augmentation algorithm for graph \a G.
113 * Returns the list of added edges in \a L.
115 virtual void doCall(Graph
& G
, List
<edge
> &L
) = 0;
120 OGDF_MALLOC_NEW_DELETE
123 } // end namespace ogdf