fastga_he.gui.layout_generation module

class fastga_he.gui.layout_generation.HierarchicalLayout(graph, orientation='TB', node_layer_dict={}, sorting=True)[source]

Bases: object

Implements the hierarchical graph layout algorithm.

The algorithm has three main phases: 1. Layer assignment (places nodes into layers using flow_hierarchy) 2. Crossing minimization (reduces edge crossings between layers using Tutte’s algorithm) 3. Coordinate assignment (positions nodes within layers)

Initialize the hierarchical layout.

Parameters:
  • graph – NetworkX DiGraph

  • orientation – ‘TB’ (top-bottom), ‘BT’ (bottom-top), ‘LR’ (left-right),

‘RL’ (right-left) :param sorting: True to enable tutte’s drawing algorithm for sorting :param node_layer_dict: Dictionary mapping nodes to their layer assignment (required)

generate_networkx_layout()[source]

Compute the layout by running all phases of the algorithm.