compactness#
- compactness(domain, network_name, edge_weight_name=None, population=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0)#
Provides an index [0,1] of how compact the network is in terms of its area and length of edges.
- Parameters:
- domainobject
The domain containing the network and objects.
- network_namestr
The name of the network to evaluate.
- edge_weight_namestr, optional
The name of the edge weight to use, by default None.
- populationarray-like or query, optional
A query or array of object indices to filter the labels. Default is None.
- include_boundariesarray-like, query-like, or None, optional
Boundaries to include in the analysis. Defaults to None.
- exclude_boundariesarray-like, query-like, or None, optional
Boundaries to exclude from the analysis. Defaults to None.
- boundary_exclude_distancefloat, optional
Buffer to exclude objects located within boundary_exclude_distance from the boundaries. Defaults to 0.
- Returns:
- float
An index [0,1] indicating the compactness of the network.
- Raises:
- RuntimeError
If the network name is not in the list of generated networks or if there is no edge weight named edge_weight_name within the network.
Notes
See reference: Barthelemy, Marc. Spatial Networks: A Complete Introduction: From Graph Theory and Statistical Physics to Real-World Applications. Springer Nature, 2022.