udm.utils#

Functions#

unit_disk_graph(→ networkx.Graph)

Create a unit disk graph given a list of 2D coordinates and a distance threshold.

Module Contents#

unit_disk_graph(locs: List[Tuple[float, float]], unit: float) networkx.Graph#

Create a unit disk graph given a list of 2D coordinates and a distance threshold.

Nodes are indexed 0..len(locs)-1. An undirected edge is added between nodes i and j if the Euclidean distance between locs[i] and locs[j] is strictly less than unit.