Skip to main content
3 of 7
added 512 characters in body
kglr
  • 400.5k
  • 18
  • 488
  • 929

Update:

athreepartitegraph = CompleteGraph[{10, 7, 3}, 
  GraphLayout -> {"MultipartiteEmbedding",  "VertexPartition" -> {10, 7, 3}},
  ImageSize -> 400, VertexLabels -> "Name", ImagePadding -> 20];

cgp= CommunityGraphPlot[athreepartitegraph, 
       {Range[10], Range[11, 17], Range[18, 20]}, Method -> "Hierarchical"];
Row[{athreepartitegraph. cgp}] 

enter image description here


Original post:

Maybe something like:

g2 = ExampleData[{"NetworkGraph", "ZacharyKarateClub"}];
g2 = SetProperty[g2, {VertexLabels -> "Name", ImagePadding -> 20, ImageSize -> 400}];

fgp = FindGraphPartition[GraphComplement[g2], 3];
mpg = Graph[Flatten@fgp, EdgeList[g2], 
   GraphLayout -> {"MultipartiteEmbedding", "VertexPartition" -> (Length /@ fgp)},
   VertexLabels -> "Name", 
   ImagePadding -> 20, ImageSize -> 400];

Row[{g2, mpg}]

enter image description here

CommunityGraphPlot[g2, fgp, Method -> "Hierarchical"]

enter image description here

kglr
  • 400.5k
  • 18
  • 488
  • 929