cluster-analysisnetworkxgraph-theorynetworkit

Generate clusters from a graph based on edges within cluster


Let's say we have an undirected and unweighted network graph.

What is the best algorithm to use to generate "clusters" that have the following properties:

Is there an algorithm that can be used to determine this?


Solution

  • LOOP N over nodes 
       IF N has less than X edges 
           Remove N and all its edges from graph
    REPEAT until no more nodes can be removed.
    

    You now have one or more clusters that meet the requirement. Use a component finder algorithm ( https://en.wikipedia.org/wiki/Component_(graph_theory)#Algorithms ) to identify the clusters.

    Here is a typical result of running the algorithm on a graph with two clusters that meet your requirement.

    Original graph. The algorithm removes the red nodes and edges

    enter image description here

    Result - it is a graph with two components

    enter image description here