
Graph-based Clustering
163
the vertex v at the front of the queue is removed, its current degree is assigned as its
k-core label and the degrees all of the vertices in the queue that are neighbors of v are
decreased by 1, if their current degrees are higher than the degree of v. The procedure
is repeated until the queue does not have any more vertices and the k-cores consist of
vertices which have at least k labels. The pseudocode of this algorithm is shown in
Alg. 8.8.
Algorithm 8.8 k −core Alg
1: Input : G(V,E)
2: Output : k-core values of vertices
3: Q ← degree-sorted vertices of G
4: while Q 6= Ø do
5: v ← front of Q
6: core
v
←
δ
v
7: for all u ∈ N(v)