Skip to content

node2vec randomwalk

kent edited this page Nov 28, 2019 · 2 revisions

Introduction

Node2vec is an algorithm proposed by Aditya Grover published in KDD2016, which is an algorithm framework for learning the feature representation of network nodes. The algorithm proposes a biased random walk process to obtain different neighbor nodes. By using two strategies, depth-first search (DFS) and width-first search (BFS), the random walk generates a set of neighbors of the nodes.

Parameters

use --help param to view detailed help information.

Input Format

Input files should be formatted as follows:

Each line of the input file requires the following format: <src>,<dst> or <src>,<dst>,<weight>, which represents the head and tail of an edge, <src> and <dst> is the id number of uint32_tweight of type float is the weight of the edge.

Input example (Following numbers are synthetic and are for demonstration purpose only.):

123,856
856,123

Output Format

Output files are formatted as follows:

For each node, the output is a multi-line text file, each line is a sequence of nodes separated by spaces. The format of each line: <nod1> <nod2> <nod3> <nod4> …

Output example (Following numbers are synthetic and are for demonstration purpose only.):

1 2 3 4
1 3 8 2

Code

https://github.com/Tencent/plato/blob/master/example/node2vec_randomwalk.cc

Algorithms to open source:

  • Network Embedding
    • LINE
    • Word2Vec
    • GraphVite
  • GNN
    • GCN
    • GraphSage
Clone this wiki locally