SparkseePython3 6.1.0
sparksee.PageRank Class Reference

PageRank class. More...

Public Member Functions

 set_damping (self, damping)
 Sets the damping value for the PageRank.
 set_default_weight (self, weight)
 Sets the default weight for those cases when a given edge does not have a weight attribute set.
 run (self)
 Runs the algorithm.
 add_all_edge_types (self, dir)
 Allows for traversing all edge types of the graph.
 set_output_attribute_type (self, attr)
 Sets the output attribute type.
 set_starting_node (self, start_node)
 Sets the starting node of the page rank to compute the Personalized PageRank variant.
 set_initial_page_rank_value (self, start_value)
 Sets the initial PageRank value.
 set_edge_weight_attribute_type (self, attr)
 Sets the attribute to use as edge weight.
 add_edge_type (self, type, dir)
 Allows for traversing edges of the given type.
 set_num_iterations (self, num_iterations)
 Sets the number of iterations to run the PageRank for.
 set_tolerance (self, tolerance)
 Sets the tolerance threashold to continue computing the PageRank after each iteration.
 add_node_type (self, type)
 Allows for traversing nodes of the given type.
 __init__ (self, session)
 Builds the PageRank.
 add_all_node_types (self)
 Allows for traversing all node types of the graph.

Detailed Description

PageRank class.

Implements the PageRank algorithm

Author
Sparsity Technologies http://www.sparsity-technologies.com

Constructor & Destructor Documentation

◆ __init__()

sparksee.PageRank.__init__ ( self,
session )

Builds the PageRank.

Parameters
session[in] The session to use

Member Function Documentation

◆ add_all_edge_types()

sparksee.PageRank.add_all_edge_types ( self,
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
dir[in] Edge direction.

◆ add_edge_type()

sparksee.PageRank.add_edge_type ( self,
type,
dir )

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.
Exceptions
RuntimeErrornull

◆ add_node_type()

sparksee.PageRank.add_node_type ( self,
type )

Allows for traversing nodes of the given type.

Parameters
typenull
Exceptions
RuntimeErrornull

◆ run()

sparksee.PageRank.run ( self)

Runs the algorithm.

sparksee::gdb::Error

Exceptions
RuntimeErrornull

◆ set_damping()

sparksee.PageRank.set_damping ( self,
damping )

Sets the damping value for the PageRank.

Parameters
damping[in] The damping value. Default: 0.85

◆ set_default_weight()

sparksee.PageRank.set_default_weight ( self,
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

◆ set_edge_weight_attribute_type()

sparksee.PageRank.set_edge_weight_attribute_type ( self,
attr )

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.

sparksee::gdb::Error

Parameters
attr[in] The attribute type to use as a weight. Default: InvalidAttribute
Exceptions
RuntimeErrornull

◆ set_initial_page_rank_value()

sparksee.PageRank.set_initial_page_rank_value ( self,
start_value )

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
start_value[in] The initial value to set. Default: 0.0

◆ set_num_iterations()

sparksee.PageRank.set_num_iterations ( self,
num_iterations )

Sets the number of iterations to run the PageRank for.

Parameters
num_iterations[in] The number of interations to set. Default: 20

◆ set_output_attribute_type()

sparksee.PageRank.set_output_attribute_type ( self,
attr )

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
Exceptions
RuntimeErrornull

◆ set_starting_node()

sparksee.PageRank.set_starting_node ( self,
start_node )

Sets the starting node of the page rank to compute the Personalized PageRank variant.

sparksee::gdb::Error

Parameters
start_nodenull
Exceptions
RuntimeErrornull

◆ set_tolerance()

sparksee.PageRank.set_tolerance ( self,
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