open-AIMS / ADRIA.jl

ADRIA: Adaptive Dynamic Reef Intervention Algorithms. A multi-criteria decision support platform for informing reef restoration and adaptation interventions.
MIT License
14 stars 5 forks source link

Clean up connectivity and centrality methods #737

Closed ConnectedSystems closed 5 months ago

ConnectedSystems commented 5 months ago

This PR:

Previous implementation of the strongest source location violated the Single Responsibility Principle, as it was lumped in with all other connectivity-related calculations. In addition, it was unused but was being recalculated every decision point. As it was naively iterating through all nodes in the graph (rather than just target nodes of interest), it would take upwards of 10 seconds per decision point.

In the worst case for a large network (such as one representing the entire GBR), this would explode run times from ~2 hours to ~12 hours for a small set of 768 scenarios.

This set of changes makes connectivity_strength() essentially a wrapper around two lines of code. Really, it could be removed, but I am leaving it as is for now.

As an aside, I am unsure of the area-weighted implementation of connectivity is worthwhile given MCDA considers available space as a separate criteria already, but again, leaving it as is for now.