or fewer neighbors that come later in the ordering; a degeneracy ordering may be found in linear time by repeatedly selecting the vertex of minimum degree among the remaining vertices. If the order of the vertices that the Bron–Kerbosch algorithm loops through is a degeneracy ordering, then the set of candidate vertices in each call (the neighbors of that are later in the ordering) will be guaranteed to have size at most . The set of excluded vertices will consist of all earlier neighbors of , and may be much larger than . In recursive calls to the algorithm below the topmost level of the recursion, the pivoting version can still be used. In pseudocode, the algorithm performs the following steps: algorithm BronKerbosch3(G) is P = V(G) R = X = empty for each vertex v in a degeneracy ordering of G do BronKerbosch2({v}, P ⋂ N(v), X ⋂ N(v)) P := P \ {v} X := X ⋃ {v} This variant of the algorithm can be proven to be efficient for graphs of small degeneracy, and experiments show that it also works well in practice for large sparse social networks and other real-world graphs. Example In the example graph shown, the algorithm is initially called with R = Ø, P = {1,2,3,4,5,6}, and X = Ø. The pivot u should be chosen as one of the degree-three vertices, to minimize the number of recursive calls; for instance, suppose that u is chosen to be vertex 2. Then there are three remaining vertices in P \ N(u): vertices 2, 4, and 6. The iteration of the inner loop of the algorithm for v = 2 makes a recursive call to the algorithm with R = {2}, P = {1,3,5}, and X = Ø. Within this recursive call, one of 1 or 5 will be chosen as a pivot, and there will be two second-level recursive calls, one for vertex 3 and the other for whichever vertex was not chosen as pivot. These two calls will eventually report the two cliques {1,2,5} and {2,3}. After returning from these recursive calls, vertex 2 is added to X and removed from P. The iteration of the inner loop of the algorithm for v = 4 makes a recursive call to the algorithm with R = {4}, P = {3,5,6}, and X = Ø (although vertex 2 belongs to the set X in the