PageRank class.
More...
#include <PageRank.h>
|
| | PageRank (sparksee::gdb::Session &session) |
| | Builds the PageRank.
|
|
virtual | ~PageRank () |
| | Destructor.
|
| void | AddEdgeType (sparksee::gdb::type_t type, sparksee::gdb::EdgesDirection dir) throw (sparksee::gdb::Error) |
| | Allows for traversing edges of the given type.
|
| void | AddAllEdgeTypes (sparksee::gdb::EdgesDirection dir) |
| | Allows for traversing all edge types of the graph.
|
|
void | AddNodeType (sparksee::gdb::type_t type) throw (sparksee::gdb::Error) |
| | Allows for traversing nodes of the given type.
|
|
void | AddAllNodeTypes () |
| | Allows for traversing all node types of the graph.
|
| void | SetNumIterations (sparksee::gdb::int32_t numIterations) |
| | Sets the number of iterations to run the PageRank for.
|
| void | SetTolerance (sparksee::gdb::double64_t tolerance) |
| | Sets the tolerance threashold to continue computing the PageRank after each iteration.
|
| void | SetDamping (sparksee::gdb::double64_t damping) |
| | Sets the damping value for the PageRank.
|
| void | SetInitialPageRankValue (sparksee::gdb::double64_t startValue) |
| | Sets the initial PageRank value.
|
| void | SetOutputAttributeType (sparksee::gdb::attr_t attr) throw (sparksee::gdb::Error) |
| | Sets the output attribute type.
|
| void | SetEdgeWeightAttributeType (sparksee::gdb::attr_t attr) throw (sparksee::gdb::Error) |
| | Sets the attribute to use as edge weight.
|
| void | SetDefaultWeight (sparksee::gdb::double64_t weight) |
| | Sets the default weight for those cases when a given edge does not have a weight attribute set.
|
| void | SetStartingNode (sparksee::gdb::oid_t startNode) throw (sparksee::gdb::Error) |
| | Sets the starting node of the page rank to compute the Personalized PageRank variant.
|
| void | Run () throw (sparksee::gdb::Error) |
| | Runs the algorithm.
|
PageRank class.
Implements the PageRank algorithm
- Author
- Sparsity Technologies http://www.sparsity-technologies.com
◆ PageRank()
| PageRank::PageRank |
( |
sparksee::gdb::Session & | session | ) |
|
Builds the PageRank.
- Parameters
-
| session | [in] The session to use |
◆ AddAllEdgeTypes()
| void PageRank::AddAllEdgeTypes |
( |
sparksee::gdb::EdgesDirection | dir | ) |
|
Allows for traversing all edge types of the graph.
The direction is interpreted as in which direction an edge can be followed from a node to influence other nodes.
- Parameters
-
◆ AddEdgeType()
| void PageRank::AddEdgeType |
( |
sparksee::gdb::type_t | type, |
|
|
sparksee::gdb::EdgesDirection | dir ) |
| throw | ( | sparksee::gdb::Error ) | | | |
Allows for traversing edges of the given type.
If the edge type was already added, the existing direction is overwritten The direction is interpreted as in which direction an edge can be followed from a node to influence other nodes.
- Parameters
-
| type | [in] Edge type. |
| dir | [in] Edge direction. |
◆ Run()
| void PageRank::Run |
( |
| ) |
|
| throw | ( | sparksee::gdb::Error ) | | | |
Runs the algorithm.
- Exceptions
-
◆ SetDamping()
| void PageRank::SetDamping |
( |
sparksee::gdb::double64_t | damping | ) |
|
Sets the damping value for the PageRank.
- Parameters
-
| damping | [in] The damping value. Default: 0.85 |
◆ SetDefaultWeight()
| void PageRank::SetDefaultWeight |
( |
sparksee::gdb::double64_t | weight | ) |
|
Sets the default weight for those cases when a given edge does not have a weight attribute set.
Default: 0.0
- Parameters
-
| weight | [in] The default weight |
◆ SetEdgeWeightAttributeType()
| void PageRank::SetEdgeWeightAttributeType |
( |
sparksee::gdb::attr_t | attr | ) |
|
| throw | ( | sparksee::gdb::Error ) | | | |
Sets the attribute to use as edge weight.
If the multiple edge are set for traversal, this attribute must be of type GLOBAL_TYPE or EDGES_TYPE. Additionally, the attribute must be of type Double. Finally, negative weights are treated as non existing, so the default weight applies.
- Parameters
-
| attr | [in] The attribute type to use as a weight. Default: InvalidAttribute |
- Exceptions
-
◆ SetInitialPageRankValue()
| void PageRank::SetInitialPageRankValue |
( |
sparksee::gdb::double64_t | startValue | ) |
|
Sets the initial PageRank value.
If a starting node is set, this initial value is only set for the starting node and the rest of nodes are set to 0.0
- Parameters
-
| startValue | [in] The initial value to set. Default: 0.0 |
◆ SetNumIterations()
| void PageRank::SetNumIterations |
( |
sparksee::gdb::int32_t | numIterations | ) |
|
Sets the number of iterations to run the PageRank for.
- Parameters
-
| numIterations | [in] The number of interations to set. Default: 20 |
◆ SetOutputAttributeType()
| void PageRank::SetOutputAttributeType |
( |
sparksee::gdb::attr_t | attr | ) |
|
| throw | ( | sparksee::gdb::Error ) | | | |
Sets the output attribute type.
If the PageRank will run on more than one node type, then the output attribute must be of type GLOBAL_TYPE or NODES_TYPE. Otherwise, it must be a valid attribute for the used node type.
- Parameters
-
| attr | [in] The attribute to store the result. Default: InvalidAttribute |
◆ SetStartingNode()
| void PageRank::SetStartingNode |
( |
sparksee::gdb::oid_t | startNode | ) |
|
| throw | ( | sparksee::gdb::Error ) | | | |
Sets the starting node of the page rank to compute the Personalized PageRank variant.
- Exceptions
-
◆ SetTolerance()
| void PageRank::SetTolerance |
( |
sparksee::gdb::double64_t | tolerance | ) |
|
Sets the tolerance threashold to continue computing the PageRank after each iteration.
If all the changes to any PPR value after an iteration are below that tolerance threshold, the algorithm finishes.
- Parameters
-
| tolerance | [in] The tolerance to use normalized between 0 and 1. Default: 0.000001 |
The documentation for this class was generated from the following file: