Given a graph , and a subset , the sub-graph induced by is defined as
where .
is called a -core if it is the maximal sub-graph wuch that every vertex in has degree at least inside this sub-graph. Given the definition of -core, the core number of a vertex is the maximum such tha t , is a -core and .
The key observation is that, given a -core , if we remove every vertex (as long as edges incident to ) such that , then remains a -core. Since
- If , then .
- Removing edges incident to will not affect edges inside . Then, the vertices' degree inside remains unchanged.
This gives an algorithm for computing the core number of each vertex.
- for :
- false
- while not true :
- Get an with smallest and false
- true
- for such that :
- Delete
We can use an array such that is a linked list and contains all vertices with degree . Therefore, line 4 can be executed in time.
Reference
[1] Batagelj, V. and Zaversnik, M., 2003. An O (m) algorithm for cores decomposition of networks. arXiv preprint cs/0310049.