UltipaDocs
Try Playground
  • Introduction
    • Show Algorithms
    • Install and Uninstall
    • Run Algorithms
    • Algorithm Results and Statistics
    • Degree Centrality
    • Closeness Centrality
    • Harmonic Centrality
    • Graph Centrality
    • Betweenness Centrality
    • Eigenvector Centrality
    • CELF
    • PageRank
    • ArticleRank
    • HITS
    • SybilRank
    • Jaccard Similarity
    • Overlap Similarity
    • Cosine Similarity
    • Pearson Correlation Coefficient
    • Euclidean Distance
    • K-Hop All
    • Bipartite Graph
    • HyperANF
    • Connected Component
    • Triangle Counting
    • Induced Subgraph
    • k-Core
    • k-Truss
    • p-Cohesion
    • k-Edge Connected Components
    • Local Clustering Coefficient
    • Topological Sort
    • Schema Overview
    • Dijkstra's Single-Source Shortest Path
    • Delta-Stepping Single-Source Shortest Path
    • Shortest Path Faster Algorithm (SPFA)
    • Minimum Spanning Tree
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Adamic-Adar Index
    • Common Neighbors
    • Preferential Attachment
    • Resource Allocation
    • Total Neighbors
    • Louvain
    • Leiden
    • Label Propagation
    • HANP
    • k-Means
    • kNN (k-Nearest Neighbors)
    • K-1 Coloring
    • Conductance
      • Random Walk
      • Node2Vec Walk
      • Node2Vec
      • Struc2Vec Walk
      • Struc2Vec
      • GraphSAGE
      • GraphSAGE Train
      • LINE
      • Fast Random Projection
      • Summary of Graph Embedding
      • Gradient Descent
      • Backpropagation
      • Skip-gram
      • Skip-gram Optimization
  1. Docs
  2. /
  3. Graph Analytics & Algorithms
  4. /
  5. Algorithms

Struc2Vec Walk

✓ File Writeback ✕ Property Writeback ✓ Direct Return ✓ Stream Return ✕ Stats

Overview

The Struc2Vec Walk is a biased random walk. This is one of the crucial componments of the Struc2Vec framework, where the walk is performed in a constructed multilayer weighted graph rather than the original graph. Please refer to the Struc2Vec algorithm for the details.

Syntax

  • Command:algo(random_walk_struc2vec)
  • Parameters:
Name

Type
Spec
Default
Optional
Description
ids / uuids[]_id / []_uuid//YesID/UUID of nodes to start random walks; start from all nodes if not set
walk_lengthint≧11YesDepth of each walk, i.e., the number of nodes to visit
walk_numint≧11YesNumber of walks to perform for each specified node
kint[1, 10]/NoNumber of layers of the constructed multilayer weighted graph, which should not exceed the diameter of the original graph
stay_probabilityfloat(0,1]/NoThe probability of walking in the current level
limitint≧-1-1YesNumber of results to return, -1 to return all results

Example

The example graph is as follows:

File Writeback

Spec
Content
Description
filename_id,_id,...IDs of visited nodes
UQL
algo(random_walk_struc2vec).params({
  walk_length: 5,
  walk_num: 1,
  k: 4,
  stay_probability: 0.8
}).write({
  file:{
    filename: 'walks'
}})

Results: File walks

File
J,G,I,G,
I,H,I,H,G,
H,G,H,I,H,
G,H,I,G,
F,G,H,I,H,
E,C,B,C,
D,C,E,F,G,
C,E,C,A,C,
B,A,D,E,
A,B,A,D,

Direct Return

Alias OrdinalType
Description
Columns
0[]perWalkArray of UUIDs of visited nodes[_uuid, _uuid, ...]
UQL
algo(random_walk_struc2vec).params({
  ids: ['J'],
  walk_length: 6,
  walk_num: 3,
  k: 4,
  stay_probability: 0.8
}) as walks
return walks

Results: walks

[10, 6, 3, 6]
[10, 7, 6, 5, 6, 5]
[10, 7, 10, 7, 6, 7]

Stream Return

Alias OrdinalType
Description
Columns
0[]perWalkArray of UUIDs of visited nodes[_uuid, _uuid, ...]
UQL
algo(random_walk_struc2vec).params({
  ids: ['J'],
  walk_length: 6,
  walk_num: 30,
  k: 5,
  stay_probability: 0.7
}).stream() as walks
where size(walks) == 6
return walks

Results: walks

[10, 7, 6, 5, 3, 4]
[10, 7, 8, 7, 6, 5]
[10, 7, 6, 4, 6, 7]