简体   繁体   中英

Algorithm to split a graph into disconnected subgraphs of <=N nodes, challenge is to obtain the maximum number of subgraphs (networkx, python)

I am wondering if there is an algorithm to split a large graph/network into multiple disconnected networks of up to N nodes; where you'd like to achieve as many disconnected networks as possible? If not, how would you code this in python/networkx?

In other words, suppose I have a large interconnected network of 1000 nodes, I would like to delete as little nodes as possible, in order to obtain subgraphs of up to 10 nodes (as many as possible).

Some bad news: This is a generalisation of Independent Set , which is NP-hard . (The Independent Set problem is usually framed as keeping a subset of vertices, but it amounts to the same thing as your problem with n fixed at 1.) That means it's very unlikely that a polynomial-time algorithm exists that can solve this problem exactly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM