generate_network#
- generate_network(domain, network_name='default_network', objects_as_nodes=None, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, network_type='Delaunay', distance_weighted=True, inverse_distance_function=None, min_edge_distance=0, max_edge_distance=inf, number_of_nearest_neighbours=10, store_network=True)#
Generate network using the domain objects. Network is stored within the domain class for future use. Nodes are indexed using Object ID.
- Parameters:
- domainobject
The domain containing the objects to be used for network generation.
- network_namestr, optional
The name of the network, by default ‘default_network’.
- objects_as_nodesarray-like, query-like, or None, optional
The objects_as_nodes to select specific objects, by default 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.
- network_typestr, optional
The type of network to generate. Options are ‘Delaunay’ (Delaunay triangulation), ‘KNN’ (K-nearest neighbour), ‘Proximity’ and ‘RNG’ (relative neighbourhood graph).
- distance_weightedbool, optional
Whether to weight edges by distance, by default True.
- inverse_distance_functioncallable, optional
Function to compute inverse distance, by default None.
- min_edge_distancefloat, optional
Minimum edge distance, by default 0.
- max_edge_distancefloat, optional
Maximum edge distance, by default np.inf.
- number_of_nearest_neighboursint, optional
Number of nearest neighbours for KNN. Only used for KNN networks, by default 10.
- store_networkbool, optional
Whether to store the network in the domain, by default True.
- Returns:
- networkx.Graph
The generated network. KNN networks will return a directed network (networkx.DiGraph).
- Raises:
- ValueError
If the network type is not implemented or if the objects_as_nodes is of incorrect type.
Notes
Delaunay networks estimates a natural geometric triangulation for pointclouds. For more information on Delaunay networks, see [Delaunay Triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation).
K-Nearest Neighbours (KNN) networks estimates the local connectivity of points in space. For more information on KNN networks, see [k-nearest neighbour Graph](https://en.wikipedia.org/wiki/Nearest_neighbor_graph).
Proximity networks define connectivity purely by distance thresholds. For more information on Proximity networks, see [Proximity Graph](https://www.sciencedirect.com/science/article/pii/S037015731000308X).
Relative Neighbourhood Graph (RNG) esimtates the natural connectivity of points in space. For more information on the RNGs, see [Relative Neighbourhood Graph](https://en.wikipedia.org/wiki/Relative_neighborhood_graph).