page_rank.rst 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .. Copyright (C) 2004-2008 The Trustees of Indiana University.
  2. Use, modification and distribution is subject to the Boost Software
  3. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. http://www.boost.org/LICENSE_1_0.txt)
  5. ===============
  6. |Logo| PageRank
  7. ===============
  8. ::
  9. namespace graph {
  10. template<typename Graph, typename RankMap, typename Done>
  11. inline void
  12. page_rank(const Graph& g, RankMap rank_map, Done done,
  13. typename property_traits<RankMap>::value_type damping = 0.85);
  14. template<typename Graph, typename RankMap>
  15. inline void
  16. page_rank(const Graph& g, RankMap rank_map);
  17. }
  18. The ``page_rank`` algorithm computes the ranking of vertices in a
  19. graph, based on the connectivity of a directed graph [PBMW98]_. The
  20. idea of PageRank is based on a random model of a Web surfer, who
  21. starts a random web page and then either follows a link from that web
  22. page (choosing from the links randomly) or jumps to a completely
  23. different web page (not necessarily linked from the current
  24. page). The PageRank of each page is the probability of the random web
  25. surfer visiting that page.
  26. .. contents::
  27. Where Defined
  28. ~~~~~~~~~~~~~
  29. <``boost/graph/distributed/page_rank.hpp``>
  30. also accessible from
  31. <``boost/graph/page_rank.hpp``>
  32. Parameters
  33. ~~~~~~~~~~
  34. IN: ``Graph& g``
  35. The graph type must be a model of `Distributed Vertex List Graph`_ and
  36. `Distributed Edge List Graph`_. The graph must be directed.
  37. OUT: ``RankMap rank``
  38. Stores the rank of each vertex. The type ``RankMap`` must model the
  39. `Read/Write Property Map`_ concept and must be a `distributed
  40. property map`_. Its key type must be the vertex descriptor of the
  41. graph type and its value type must be a floating-point or rational
  42. type.
  43. IN: ``Done done``
  44. A function object that determines when the PageRank algorithm
  45. should complete. It will be passed two parameters, the rank map and
  46. a reference to the graph, and should return ``true`` when the
  47. algorithm should terminate.
  48. **Default**: ``graph::n_iterations(20)``
  49. IN: ``typename property_traits<RankMap>::value_type damping``
  50. The damping factor is the probability that the Web surfer will
  51. select an outgoing link from the current page instead of jumping to
  52. a random page.
  53. **Default**: 0.85
  54. Complexity
  55. ~~~~~~~~~~
  56. Each iteration of PageRank requires *O((V + E)/p)* time on *p*
  57. processors and performs *O(V)* communication. The number of
  58. iterations is dependent on the input to the algorithm.
  59. Bibliography
  60. ------------
  61. .. [PBMW98] Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry
  62. Winograd. The PageRank Citation Ranking: Bringing Order to the
  63. Web. Technical report, Stanford Digital Library Technologies Project,
  64. November 1998.
  65. -----------------------------------------------------------------------------
  66. Copyright (C) 2005 The Trustees of Indiana University.
  67. Authors: Douglas Gregor and Andrew Lumsdaine
  68. .. |Logo| image:: pbgl-logo.png
  69. :align: middle
  70. :alt: Parallel BGL
  71. :target: http://www.osl.iu.edu/research/pbgl
  72. .. _Distributed Vertex List Graph: DistributedVertexListGraph.html
  73. .. _Distributed Edge List Graph: DistributedEdgeListGraph.html
  74. .. _Distributed property map: distributed_property_map.html
  75. .. _Readable Property Map: http://www.boost.org/libs/property_map/ReadablePropertyMap.html
  76. .. _Read/Write Property Map: http://www.boost.org/libs/property_map/ReadWritePropertyMap.html