Skip to main content
# Table 9 The GraRep overall algorithm

GraRep Algorithm
| |

Input
| |

Adjacency matrix S on graph | |

Maximum transition step K | |

Log shifted factor β | |

Dimension of representation vector d | |

1. Get k-step transition probability matrix A^{k}
| |

Compute A = D^{−1}S
| |

Calculate A^{−1}, A^{−2}, A^{−3}, …, A^{k}, respectively
| |

2. Get each k-step representations
| |

For k = 1 to K | |

2.1 Get positive log probability matrix | |

calculate \( {\Gamma}_1^k,{\Gamma}_2^k,{\Gamma}_3^k,\dots, {\Gamma}_N^k \) (\( {\Gamma}_i^k={\sum}_p{A}_{p,j}^k \)) respectively | |

calculate \( \left\{{X}_{i,j}^k\right\} \) | |

\( {X}_{i,j}^k \) = log (\( \frac{A_{i,j}^k}{\Gamma_j^k} \)) – log(β) | |

assign negative entries of X^{k} to 0
| |

2.2 Construct the representation vector W^{k}
| |

SVD(X^{k}) = [U^{k}, ∑^{k}, (V^{k})^{T}]
| |

\( {W}^k={U}_d^k\ {\left({\sum}_d^k\right)}^{\frac{1}{2}} \) | |

End for | |

3. Concatenate all the k-step representations
| |

W = [W^{1}, W^{2}, W^{3}, …W^{k}]
| |

Output
| |

Matrix of the graph representation W |