rustworkx.bipartite_layout#
- bipartite_layout(graph, first_nodes, horizontal=False, scale=1, center=None, aspect_ratio=1.3333333333333333)[source]#
Generate a bipartite layout of the graph
- Parameters:
graph – The graph to generate the layout for. Can either be a
PyGraph
orPyDiGraph
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 positionaspect_ratio (float) – An optional number for the ratio of the width to the height of the layout.
- Returns:
The bipartite layout of the graph.
- Return type: