Similarity-based methods
In this subsection, we show several simple algorithms to solve the link prediction problem. The main shared idea behind all these algorithms is to estimate a similarity function between each couple of nodes in a graph. If, according to the function, the nodes look similar, they will have a higher probability of being connected by an edge. We will divide these algorithms into two sub-families: index-based and community-based methods. The former contains all the methods through a simple calculation of an index based on the neighbors of a given couple of nodes. The latter contains more sophisticated algorithms, whereby the index is computed using information about the community to which a given pair of nodes belong. In order to give a practical example of these algorithms, we will use the standard implementation available in the networkx
library in the networkx.algorithms.link_prediction
package.
Index-based methods
In this section, we will show some...