iwfm.diagnostics.build_tied_groups

iwfm.diagnostics.build_tied_groups(node_coords, representative_ids)[source]

Assign each non-representative node to its nearest representative.

Parameters:
  • node_coords (dict) – {node_id: (x, y)} for all nodes in the group.

  • representative_ids (list of int) – Node IDs selected as representatives (1-based).

Returns:

  • dict – {tied_node_id: representative_node_id} for all non-representative nodes.

  • dict – {representative_node_id: [list of tied node IDs]} — the groups.