The Yifan Hu layout algorithm belongs to the category of force-directed algorithms, which includes the Force Atlas and Fruchterman Reingold algorithms. This algorithm is faster than the Force Atlas algorithm because of the way it optimizes the overall internode repulsions in the network. The details of this algorithm will be discussed in the How it works… section of this recipe.
We will begin with the Les Misérables network and explain how to use the Yifan Hu layout algorithm to obtain a restructured network. So, let's get started: