Skip to content

hal.placing.util

find_closest_free_position_with_distance

find_closest_free_position_with_distance(
    target_pos, occupied_positions
)

Find closest free position and return both position and distance

get_systematic_unique_layout

get_systematic_unique_layout(
    graph, grid_size=None, verbose=True
)

Complete workflow with systematic conflict resolution

rasterise

rasterise(positions, step=1, margin=0)

Compress the drawing onto the smallest rectangular grid.

Parameters:

  • positions (dict node -> (x, y) (output of `solve`)) –
  • step (int, default: 1 ) –
        final picture (default = 1)
    
  • margin (int, default: 0 ) –

Returns:

  • new_positions ( dict node -> (x', y') ) –

robust_unique_grid_positions

robust_unique_grid_positions(pos)

Two-phase approach: place non-conflicting nodes first, then systematically place remaining nodes at closest available positions