All Distance Sketch
0.1
All distance sketch based algorithms
|
Data structure for the graph sketch. More...
#include <graph_sketch.h>
Public Member Functions | |
void | InitGraphSketch (unsigned int K, int max_node_id, const std::vector< int > *nodes_id=NULL) |
Init the class. More... | |
int | GetK () const |
void | set_should_calc_zvalues (bool should_calc) |
if true when calculating the sketch we will also calculate the insertion probabilities of each node. | |
bool | LoadGraphSketchFromGpb (const AllDistanceSketchGpb &all_distance_sketch) |
Load the graph sketch from a Gpb class. | |
void | SaveGraphSketchToGpb (AllDistanceSketchGpb *all_distance_sketch) |
Save the graph sketch to a Gpb class. | |
NodeSketch * | GetNodeSketch (const NodeIdRandomIdData &node_details) |
NodeSketch * | GetNodeSketch (NodeDistanceIdRandomIdData node_details) |
const std::vector< RandomId > * | GetNodesDistributionLean () const |
returns the random id that was given to each node | |
RandomId | GetNodeRandomId (const int &node_id) |
returns specific node random id | |
void | SetNodesDistribution (const std::vector< RandomId > *nodes_random_id) |
sets the random id for each node. The default distribution is unifrom [0,1] | |
NodesSketchItr | Begin () |
NodesSketchItr | End () |
Data structure for the graph sketch.
|
inline |
Init the class.
[in] | K | - Sets the accuracy of the estimation. If you want epsilon error you should set K= 1/epsilon^2, e..g if we want to have error up to 10% we should set K = 100. |
[in] | max_node_id | - The max node id of a node in the graph. |
[in] | nodes_id | - optional parameter used if we want to calculate the sketch only on parts of the nodes in the graph. example: if we want to calculate the sketch only on nodes 1, 10, 65 then nodes_id = {1, 10, 65} |