Closed rdnfn closed 3 years ago
@herbiebradley: do you know if NetworkX already has some component functionality built-in?
This should be fairly easy to do using https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.components.connected_components.html
That will return a list of node indices which make up the components, then dataframes have plenty of ways of selecting only a limited number of rows, so it should be easy to just slice the main graph dataframe and return only the relevant rows.
Brilliant, that looks very promising!
Closed by #31
Description: for the UI it would be great to have the following method/function, either as part of
GeoGraph
or as a standalone function:Using the returned GeoDataFrame, the UI can then color code the components and output their number as a metric.