Connecting edges when adding layers to a circular "tripartite" plot

Hi, I’m pretty new to igraph, but have been stuck for a while now with a layout problem. I tried to post my question on stackoverflow, but unfortunately haven’t gotten any answer.

https://stackoverflow.com/questions/64609314/igraph-creating-a-circular-layout-with-inner-and-outer-nodes-for-bipartite-netw

I have a bipartite network where 284 “species” nodes are connected to 11 “host” nodes. Around half of the species nodes are specific, i.e. they have only one edge connecting them to a host node. And around half have several edges and are thus “shared” between several host nodes. So in a way I have a tripartite network.

As I wrote in stackoverflow, I want to make a circular layout with the hosts where the specific nodes are outside the circle, and the shared inside the circles. Like this picture:

I’ve added a reproducible example in the stackoverflow question. Here I’ve tried to use layout.circle() kind of like in this example:

However, the most important thing is really just to separate the “specific” nodes to be “outside” the 11 hosts, and the shared nodes to be “inside”.

Since the question was posted I’ve tried to separate my graph into three layers and draw the plots on top of each other.

The layout is getting better, but I can’t seem to understand how to connect the edges between the different plots.

Please say if I should provide some more code (other than what’s found in the stackoverflow question). I hope that someone will be able to help me!

To produce a plot like this automatically, it would be necessary to fix the locations of the grey nodes and apply some force directed layout algorithm to the rest of the nodes. igraph does not currently support this. The DrL method may have had some support, but according to the docs, it does not work: https://igraph.org/c/doc/igraph-Layout.html#igraph_layout_drl It would indeed be nice to add support for fixing nodes to some of the other force-directed methods (the DrL one is unlikely to be modified, as upstream seems dead). Feel free to open a feature request in the C/igraph issue tracker for fixing node locations.


Maybe there is a trick to produce a similar layout with existing methods, but I cannot come up with something right now.

Thanks a lot for the reply!
After reading it, I tried a bit more, but then decided to go with a different layout completely.
I ended up with manually building the coordinate vectors based on the Sugiyama layer algorithm.