# NodeVector: A Novel Network Node Vectorization with Graph Analysis and Deep Learning
## 3 Materials and Methods
### Node Similarities
```
1:functionGet_Edges(\(G\), Levels, Max_Level, cec\({}_{adjsim}\))
2: /*Step I: adjacent similarity*/
3:for\(k=1\) to max_Leveldo
4: /*similarities of levels*/
5:\(GEdgeSimsL_{k}\gets RS_{k}(Levels[k])\)
6:\(GEdgeSimsL_{k}\gets sort(GEdgeSimsL_{k})\)
7:\(GCADEdges.append((GEdgeSimsL_{k}[0:cec_{adjsim}]))\)
8: /*add topk interactions as candidate*/
9:endfor
10: /*Step II: centrality similarity*/
11:for node \(n\) in \(G\)do
12:\(cv[n,:]\leftarrow\) all centralities of \(n\)
13:endfor
14:for\(idx=1\) to \(NumberofCentrality\)do\(cv[:,idx]\gets Normalize(cv[:,idx])\)
15: /*normalize by each centrality*/
16:endfor
17: /*pairwise vector distance*/
18:for\(i=1\) to len(\(G\))do
19:for\(j=1\) to len(\(G\))do
20:\(L1D_{i,j}\leftarrow||cv_{i}[i,:]-cv_{j}[j,:]||_{1}\)
21:if\(L1D_{i,j}>95\)then
22:\(GFeatureSims.append([i,j,L1D_{i,j}])\)
23: /*use only \(>95\) similar*/
24:endif
25:endfor
26:endfor
27:\(GFeatureSims\gets sort(GFeatureSims)\) by \(L1D\)
28: /*get sorted similarities*/
29:\(GCADFEdges\leftarrow(GFeatureSims[0:ccc_{adjsim}])\)
30: /*add topk interactions as candidate*/
31:\(CandidateEdges.append(GCandEdges)\)
32:\(CandidateEdges.append(GCandFEdges)\)
33:return\(CandidateEdges\)
34:endfunction
```  
**Algorithm 1** Candidate Edge Calculation. As another approach, for network enrichment, network node centrality analysis can be used. Nodes in the network can be evaluated as important or unimportant for the network according to different centrality measures. Likewise, some nodes can be identified as similar or not similar according to different centrality measures. Although it is known that network centrality measurements are useful in solving various problems, there is no standard because the problem to which each measurement can be applied differs. When different centrality measures are calculated for each node in the network, a unique pattern is formed for each node. We develop our second network enrichment algorithm to be used in our vectorization method by measuring the similarity of the patterns formed for each node. As a first step in identifying candidate interactions, we calculate node centrality measures for all nodes in a given network, \(G\). We then normalize each measurement to 0-1. For centrality measurements, we use degree centrality, closeness centrality, information centrality, current flow closeness centrality, betweenness centrality, load centrality, harmonic centrality, current flow betweenness centrality, second-order centrality, and PageRank centrality. The computational complexity of all network centrality metrics is \(<=\)\(O(n^{2})\) (\(n\) is node size). For each node, we combine the calculated measurements into a vector to form the centrality vector of the corresponding node. To identify a pair of nodes with maximally similar patterns, first, we calculate the \(L1\) norm distance (\(L1D\)) between all paired nodes. For given nodes \(n_{x}\) and \(n_{y}\), let us denote the centrality measure vectors with \(cv_{x}\) and \(cv_{y}\)respectively. We calculate the \(L1\) norm distance for nodes \(n_{x}\) and \(n_{y}\) with the following Equation (3):  
\[L1D_{(x,y)}=||cv_{x}-cv_{y}||_{1}. \tag{3}\]  
We then apply a 0-1 normalization to the vector containing the distance for each node with the other nodes, and we delete the nodes below the 95% distance for filtering. Then, we sort the calculated \(L1\) norm distances, with the most similar pair of nodes leading. Finally, we select the first \(ccc_{adjsim}\) pairs of nodes ordered by the \(L1\) norm distance and add them as edges to the target network, \(G\). Algorithm 1 presents the pseudocode of our network enrichment method by our node centrality similarity. Negative sampling is an important technique for using unsupervised machine learning techniques on graph-modeled problems.