I have a directed graph representing some topics organized as follows (below screenshot is a subset of the graph):
I'm looking for an algorithm to group a set of nodes (in blue in the diagram) following this logic:
- Groups as evenly sized as possible: we don't want groups with very few nodes and others with lots of nodes
- If multiple groups have the same nodes, take the most specific group ie the group that's the closer successor
Now I know multiple solutions may exist for the same problem (eg 4 groups of 2 or 2 groups of 4?) but if there are existing algorithms similar to what I'm looking for I would be greatly if you can share their names so I can start testing them and see what works best for me and tweak them if needed.
Q: Do you know algorithms designed to perform similar types of node grouping?