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:
Load the Les Misérables graph in Gephi.
In the Layout panel, click on the drop-down menu that says ---Choose a layout.
From the drop-down menu, select Yifan Hu.
Hit Run. The restructured graph will appear in the Graph panel.
The following screenshot shows the Les Misérables graph after it has been restructured by using the Yifan Hu layout algorithm: