Show / Hide Table of Contents

Class PageRankAlgorithm<TVertex, TEdge>

Algorithm that computes the page rank of a graph.

Inheritance
System.Object
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>
PageRankAlgorithm<TVertex, TEdge>
Implements
IAlgorithm<IBidirectionalGraph<TVertex, TEdge>>
IComputation
IAlgorithmComponent
Inherited Members
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.State
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Started
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Services
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>.Clean()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Algorithms.Ranking
Assembly: QuikGraph.dll
Syntax
public sealed class PageRankAlgorithm<TVertex, TEdge> : AlgorithmBase<IBidirectionalGraph<TVertex, TEdge>>, IAlgorithm<IBidirectionalGraph<TVertex, TEdge>>, IComputation, IAlgorithmComponent where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Constructors

| Improve this Doc View Source

PageRankAlgorithm(IBidirectionalGraph<TVertex, TEdge>)

Initializes a new instance of the PageRankAlgorithm<TVertex, TEdge> class.

Declaration
public PageRankAlgorithm(IBidirectionalGraph<TVertex, TEdge> visitedGraph)
Parameters
Type Name Description
IBidirectionalGraph<TVertex, TEdge> visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

Properties

| Improve this Doc View Source

Damping

Gets or sets the damping rate [0-1].

Declaration
public double Damping { get; set; }
Property Value
Type Description
System.Double
Remarks

By default it uses 0.85 which is the value generally used.

Exceptions
Type Condition
System.ArgumentOutOfRangeException

Value is negative or higher than 1.

| Improve this Doc View Source

MaxIterations

Gets or sets the maximum number of iterations.

Declaration
public int MaxIterations { get; set; }
Property Value
Type Description
System.Int32
Exceptions
Type Condition
System.ArgumentOutOfRangeException

Value is negative or equal 0.

| Improve this Doc View Source

Ranks

Ranks per vertices.

Declaration
public IDictionary<TVertex, double> Ranks { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<TVertex, System.Double>
| Improve this Doc View Source

Tolerance

Gets or sets the error tolerance (used to stop the algorithm).

Declaration
public double Tolerance { get; set; }
Property Value
Type Description
System.Double
Exceptions
Type Condition
System.ArgumentOutOfRangeException

Value is negative.

Methods

| Improve this Doc View Source

GetRanksMean()

Gets the rank average.

Declaration
public double GetRanksMean()
Returns
Type Description
System.Double

Rank average.

| Improve this Doc View Source

GetRanksSum()

Gets the sum of all ranks.

Declaration
public double GetRanksSum()
Returns
Type Description
System.Double

Ranks sum.

| Improve this Doc View Source

Initialize()

Called on algorithm initialization step.

Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IBidirectionalGraph<TVertex, TEdge>>.Initialize()
| Improve this Doc View Source

InternalCompute()

Algorithm compute step.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IBidirectionalGraph<TVertex, TEdge>>.InternalCompute()

Implements

IAlgorithm<TGraph>
IComputation
IAlgorithmComponent

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph