In the previous section, we saw that cliques often form the cores of networks and communities, but that they are computationally difficult to find. In larger networks, k-cores can be a practical alternative for finding dense regions. A k-core is created by removing all nodes of degree less than k from a network. The number k can be anything you choose. The larger k is, the more nodes will be stripped away.
The nodes that remain in a k-core are highly connected to their neighbors. However, different parts of the network might become disconnected from each other after low-degree nodes are removed. The result is that a k-core consists of islands of highly connected nodes. These islands form the core of the network (hence the name k-core). Any remaining connections can be interpreted as highly-connected backbones that join different parts of the network.
NetworkX provides...