Skip to content

nstepdegrees

kent edited this page Nov 28, 2019 · 3 revisions

Introduction

N degree, which is the size of the set of nodes that a node can reach through n-hop in the network. When n = 1, the first degree of a node is the out degree of the node. For example: A simple network consists of 4 nodes (A, B, C, D) and 3 edges (AB, BC, CD). At this time, node A can reach B through 1-hop, that is, A's 1 degree = 1; 2-hop can reach two nodes of B / C, that is, A's 2 degree = 2; 3-hop can reach three nodes of B / C / D, that is, A’s 3 Degree = 3.

Parameters

use --help param to view detailed help information.

Input Format

Input files should be formatted as follows:

<src>,<dst>

where <src> and <dst> are integers of type uint32_t, representing the end nodes of an edge. Note that Plato treats every input graph as undirected by default. For a directed graph, please ensure both <A, B> and <B, A> appear in the input file if they exist. Edges that appear more than once will only take the latest one. The node ID needs to be a continuous value encoded from 0. If the number of nodes is N, the range of node ID is [0, N).

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

4564,823192
...
1996,973033

Output Format

Output files are formatted as follows: <node_id>,<node_nstep_degrees> <node_id> represents the node id. <node_nstep_degrees> represents the N-order degree of the node.

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

4564,12
...
1996,312

Code

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

Algorithms to open source:

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