Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / energybased / multilevelmixer / LocalBiconnectedMerger.h
blobcd588459e7870fe292b04b3437b056a6d78f7189
1 /*
2 * $Revision: 2523 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-02 20:59:27 +0200 (Mon, 02 Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Merges nodes with neighbour to get a Multilevel Graph
12 * \author Gereon Bartel
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
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
26 * for details.
28 * \par
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.
34 * \par
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 ***************************************************************/
43 #include <ogdf/energybased/multilevelmixer/MultilevelBuilder.h>
44 #include <ogdf/basic/HashArray.h>
46 #ifdef _MSC_VER
47 #pragma once
48 #endif
50 #ifndef OGDF_LOCAL_BICONNECTED_MERGER_H
51 #define OGDF_LOCAL_BICONNECTED_MERGER_H
53 namespace ogdf {
55 class OGDF_EXPORT LocalBiconnectedMerger : public MultilevelBuilder
57 private:
58 double m_levelSizeFactor;
59 NodeArray<node> m_substituteNodes;
60 NodeArray<bool> m_isCut;
61 HashArray<int, int> m_realNodeMarks;
63 void initCuts(Graph &G);
64 int realNodeMark(int index);
66 //! Creates the next level in the hierarchy by merging
67 //! vertices based on matching, edge cover, and local biconnectivity check.
68 bool buildOneLevel(MultilevelGraph &MLG);
69 bool doMerge(MultilevelGraph &MLG, node parent, node mergePartner, int level);
70 bool doMergeIfPossible(Graph &G, MultilevelGraph &MLG, node parent, node mergePartner, int level);
71 bool canMerge(Graph &G, node parent, node mergePartner);
72 bool canMerge(Graph &G, node parent, node mergePartner, int testStrength);
74 public:
75 //! Constructs a LocalBiconnectedMerger multilevel builder.
76 LocalBiconnectedMerger();
77 //! Specifies the ratio between two consecutive level sizes up to which
78 //! merging is done.
79 void setFactor(double factor);
82 } // namespace ogdf
84 #endif