Updated on 2022-02-22 GMT+08:00

Node2vec

Overview

By invoking the Word2vec algorithm, the Node2vec algorithm maps nodes in the network to the Euclidean space, and uses vectors to represent the node characteristics.

The Node2vec algorithm generates random steps from each node using the rollback parameter P and forward parameter Q. It combines BFS and DFS. The rollback probability is proportional to 1/P, and the forward probability is proportional to 1/Q. Multiple random steps are generated to reflect the network structures.

Application Scenarios

This algorithm applies to scenarios such as node function similarity comparison, structural similarity comparison, and community clustering.

Parameter Description

Table 1 Node2vec algorithm parameters

Parameter

Mandatory

Description

Type

Value Range

Default Value

P

No

Rollback parameter

Double

-

1

Q

No

Forward parameter

Double

-

1

dim

No

Mapping dimension

Int

1 to 200, including 1 and 200

50

walkLength

No

Random walk length

Int

1 to 100, including 1 and 100

40

walkNumber

No

Number of random walk steps of each node.

Int

1 to 100, including 1 and 100

10

iterations

No

Number of iterations

Int

1 to 100, including 1 and 100

10

Precautions

None

Example

Set parameters P to 1, Q to 0.3, dim to 3, walkLength to 20, walkNumber to 10, and iterations to 40 to obtain the three-dimensional vector display of each node.