Skip to main content
. 2021 Aug 30;5(3):711–733. doi: 10.1162/netn_a_00199

Algorithm 1 .

WL-align signature

Input: graph G; node u; width k; depth
Output: signature Hu
 1: Hu ← empty list ⊳ append right
 2: Q ← empty queue ⊳ FIFO data-structure; pop left (get and remove); append right
 3: Q ← append π = (u) π is the zero-length, single-node path
 4: while Q is not empty do  
 5: π = (u, …, vh) ← pop path from Q  
 6: Hu ← append f(π)  
 7: if h < then h is the length of π
 8:  πz ← (u, …, vh, z), ∀zV ⊳ if (vh, z) ∉ E then w(vh, z) = 0 ⇒ f(πz) = 0
 9:  z1, …, zn ← nodes s.t. f(πz1) ≥ … ≥ f(πzn) ⊳ ties broken uniformly at random
 10:  Q ← append the k paths πz1,…,πzk.  
 11: end if  
 12: end while  
 13: return Hu