All Distance Sketch
0.1
All distance sketch based algorithms
|
Graph data structure Thin wrapper over SNAP graph. More...
#include <graph.h>
Public Member Functions | |
int | AddNode (int node_id) |
int | AddEdge (const int &aSrcNId, const int &aDstNId, int weight=1) |
std::pair< bool, EdgeWeight > | GetEdgeWeight (const int &aSrcNId, const int &aDstNId) |
TEdgesWeights * | GetNodeWeights (int aNode) |
T::TNodeI | BegNI () |
T::TNodeI | EndNI () |
bool | IsEdge (const int &aSrcNId, const int &aDstNId) const |
bool | IsNode (const int &node_id) const |
int | GetNumNodes () const |
int | GetNumEdges () const |
T::TNodeI | GetNI (const int &node_id) const |
int | GetMxNId () const |
void | Transpose (Graph< T > *transpose) |
Changes the direction of all edges For undirected graph this has no effect. | |
void | LoadGraphFromDir (std::string aPath, bool aTranspose=false) |
Loads the graph from files located in a dir. More... | |
Graph data structure Thin wrapper over SNAP graph.
|
inline |
Loads the graph from files located in a dir.
[in] | aPath | - path to dir. The directory should contain a file with .txt suffix that contains pairs of nodes in each line indicating an edge between the nodes, e.g. |
1 2
1 268635
The above example will create the nodes 1, 2, 268635 and edges (1, 2) and (1, 26835) If you have nodes that have no edges to other nodes then insert them manually.
[in] | aTranspose | - should load the graph with reverse edges. If set to True the above example will insert (2, 1) and (268635, 1). |