6 * $Date: 2012-07-15 19:26:11 +0200 (So, 15. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of basic page rank.
12 * \author Martin Gronemann
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 ***************************************************************/
43 #ifndef OGDF_PAGE_RANK_H_
44 #define OGDF_PAGE_RANK_H_
46 #include <ogdf/basic/NodeArray.h>
47 #include <ogdf/basic/EdgeArray.h>
51 //! Basic page rank calculation
60 //! main algorithm call
63 const EdgeArray
<double>& edgeWeight
,
64 NodeArray
<double>& pageRankResult
);
66 //! sets the default options.
67 void initDefaultOptions()
69 m_dampingFactor
= 0.85;
70 m_maxNumIterations
= 1000;
74 //! returns the damping factor for each iteration (default is 0.85)
75 double dampingFactor() const
77 return m_dampingFactor
;
80 //! sets the damping factor for each iteration (default is 0.85)
81 void setDampingFactor(double dampingFactor
)
83 m_dampingFactor
= dampingFactor
;
86 //! the maximum number of iterations (default is 1000)
87 int maxNumIterations() const
89 return m_maxNumIterations
;
92 //! sets the maximum number of iterations (default is 1000)
93 void setMaxNumIterations(int maxNumIterations
)
95 m_maxNumIterations
= maxNumIterations
;
98 /*! returns the threshold/epsilon. After each iteration the result is compared to
99 * to the old one and in case all changes are smaller than threshold the algorithm
100 * stops. Note that the default value is 0.0 resulting in maxNumIterations usually.
102 double threshold() const
108 //! sets the threshold to t. See threshold for more information
109 void setThreshold(double t
)
115 //! the damping factor
116 double m_dampingFactor
;
118 //! maximum number of iterations
119 int m_maxNumIterations
;
125 } // end of namespace ogdf
127 #endif // OGDF_PAGE_RANK_H_