Rann keep node assignment - #75
Merged
Merged
Conversation
- Introduced `contract_linear_nodes` function in C for efficient contraction of intermediate nodes in undirected graphs. - Added `drop_singletons_linear` helper function in R for linear-time singleton edge peeling. - Updated `consolidate_graph_core` to utilize the new functions, improving performance and functionality. - Enhanced tests to validate the new recursive modes for singleton edge handling and ensure correct behavior in various scenarios.
- Introduced multiple test cases to validate that the C and R implementations of the consolidate_graph function produce equivalent results. - Added a helper function to standardize data frames for comparison by stripping volatile attributes and sorting rows. - Tests cover various scenarios including simple chains, full recursion chains, parallel edge bundles, and weighted chains.
- Improved the merge_linear_nodes function to handle cases where C contraction does not progress, allowing for better error handling and reporting. - Added a condition to break the loop when no further contraction is possible, improving performance and preventing infinite loops. - Updated verbose output to reflect the number of candidates processed during contraction.
- Introduced `legacy_drop_singletons_recursive` function to replicate legacy behavior for dropping singletons. - Added `expect_singleton_peel_equiv` function to compare results of the new `drop_singletons_linear` with the legacy method. - Implemented multiple test cases to validate the equivalence of singleton peeling in various graph structures, including chains and random sparse graphs. - Enhanced test coverage for both recursive and non-recursive modes of singleton edge handling.
- Expanded test cases for `drop_singletons_linear` to include both recursive and non-recursive scenarios. - Introduced tests for varied graph topologies, including star graphs and disconnected components. - Enhanced coverage for random graph structures with multiple seed values to ensure robustness of singleton peeling behavior.
- Introduced `critical_link_analysis` function to compute edge-level detour costs and vulnerability ratios for graphs. - Updated documentation to include new function and its usage. - Added tests to validate the functionality and ensure correct behavior for various graph scenarios, including directed and undirected graphs. - Updated NAMESPACE and package documentation to reflect the new addition.
- Updated the aggregation logic to properly manage cases where no nodes are kept, returning a data frame of groups instead. - Added a new test case to validate the behavior of consolidate_graph with topology-only graphs, ensuring correct output structure and values.
- Added a note in the documentation to clarify that the spatial simplification method does not preserve intra-cluster topology. - Modified the `contract_edges` function to handle cases where the graph has no rows, ensuring proper attribute management and returning an empty graph when necessary. - Adjusted the centroid calculation to maintain consistency in handling dimensions.
Add node assignment helper function for clustering - Introduced `assign_nodes_to_keep` function to streamline the process of identifying nodes close to specified 'keep' nodes within a defined radius. - Updated `cluster_nodes` function to utilize the new helper for improved clarity and efficiency in clustering logic. - Enhanced verbose output for better tracking of processing steps when handling large datasets.
… for larger datasets.
- Introduced a new parameter `nodes.algo.rann` to enable the use of the RANN package for fast 3D Cartesian nearest-neighbor preselection when assigning nodes close to preserved nodes. - Updated the `compute_degrees`, `simplify_network`, and `cluster_nodes` functions to incorporate RANN-based logic. - Enhanced documentation to reflect the new functionality and its requirements. - Added tests to ensure the correctness of RANN-based node assignment against dense assignment methods.
- Updated the coordinate transformation to use the new `lonlat_to_xyz` function for improved accuracy. - Adjusted the epsilon parameter for the dbscan algorithm to utilize the `chord_radius_km` function, enhancing clustering precision. - Ensured that the dbscan function correctly identifies clusters without unassigned noise points.
…tering - Introduced `nearest_lonlat` function to enhance nearest neighbor search using RANN or haversine distance. - Updated `cluster_nodes` and `simplify_network` functions to utilize the new nearest neighbor logic for centroid calculations. - Enhanced verbose output in `simplify_network` to indicate completion of clustering steps and number of clusters identified.
- Introduced a new attribute `keep.edges` in the `contract_edges` function to track the indices of edges retained after clustering. - Updated documentation in `simplify_network` to include details about the `keep.edges` attribute, enhancing clarity on the output structure of the simplified graph.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.