0

I'm working with flat communities. My goal is to know the number of vertices per community. You can see on the picture below that my vertices are organized in communities and that these communities do not contain edges to each other.

example of my dataset

Therefore, I would like to index my vertices to reflect this. I thought about cluster all vertices based on any order of neighborhood independent of the edge direction. However, I don't know which algorithm would provide this. Can you point out which one would give me this outcome?

I thought about cluster_walktrap(x,steps=100)or maybe even with higher number of steps to ensure the behavior that would find all vertices in the community. I believe there is a better way to do so, but I'm stuck.

Thank you in advance for your time.

ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81
Rseq
  • 1
  • 3
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jan 21 '22 at 18:09
  • This seems like more of a stats / data science question than a programming one – camille Jan 21 '22 at 18:35
  • The partition that you call "communities" is generally called (connected) components of a graph. `components(graph, mode="weak")` They are generally found by breadth-first search. – Paul Brodersen Jan 27 '22 at 14:54

0 Answers0