0

I am currently looking for a solution to create a k-partite graph with Networkx. I have already implemented the bipartite graph and the image is attachedenter image description here

As one can see due to connection among nodes in my first set Bipartite is not a good solution. Therefore I need to create a k-partite graph. As I need to show the levels of hierarchy among the nodes, therefore, I can't use other network layouts. Any help would be much appreciated.

user3050590
  • 1,656
  • 4
  • 21
  • 40
  • So are you looking for an algorithm that will give you the minimum k such that your graph is k-partite? Or do you already know that k and you are trying to find the vertices belonging to each of the k sets? Or do you know both of these and you are just looking for a way to plot your k-partite graph with an appropriate layout? – al-dev Apr 09 '20 at 10:12
  • yes, I know both and I am looking for an option to plot k-partite graph with an appropriate layout – user3050590 Apr 09 '20 at 12:12
  • I don't think there is a graph layout function in networkx for that specific use case. Either you do your own layout function that specifies the positions of each vertex, or you might have to look into graph visualization libraries as recommended at https://networkx.github.io/documentation/stable/reference/drawing.html – al-dev Apr 09 '20 at 13:37

1 Answers1

0

I found a solution to this question from another stack overflow another post.

Basically it says to add each node-set iteratively. Here is my output k-partite graph

enter image description here

user3050590
  • 1,656
  • 4
  • 21
  • 40