bipartite_layout(graph, first_nodes, horizontal=False, scale=1, center=None, aspect_ratio=1.3333333333333333)[source]#

Generate a bipartite layout of the graph

  • graph – The graph to generate the layout for. Can either be a PyGraph or PyDiGraph

  • first_nodes (set) – The set of node indices on the left (or top if horitontal is true)

  • horizontal (bool) – An optional bool specifying the orientation of the layout

  • scale (float) – An optional scaling factor to scale positions

  • center (tuple) – An optional center position. This is a 2 tuple of two float values for the center position

  • aspect_ratio (float) – An optional number for the ratio of the width to the height of the layout.


The bipartite layout of the graph.

Return type: