@@ -68,7 +68,7 @@ inline void prune_worst_edges(deglib::graph::MutableGraph& graph, const uint8_t
6868}
6969
7070/* *
71- * @brief Remove all edges that do not satisfy the MRNG condition.
71+ * @brief Remove all edges that do not satisfy the RNG condition.
7272 *
7373 * Iterates over all vertices and their neighbors, removing any edge that does
7474 * not satisfy the RNG condition. Each vertex is processed in parallel via
@@ -78,7 +78,7 @@ inline void prune_worst_edges(deglib::graph::MutableGraph& graph, const uint8_t
7878 * @param numThreads Number of threads to use (0 = use hardware concurrency).
7979 * @return Number of edges removed.
8080 */
81- inline uint32_t prune_non_mrng_edges (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
81+ inline uint32_t prune_non_rng_edges (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
8282 const auto vertex_count = graph.size ();
8383 const auto edge_per_vertex = graph.getEdgesPerVertex ();
8484 const auto thread_count = numThreads == 0 ? std::thread::hardware_concurrency () : numThreads;
@@ -117,7 +117,7 @@ inline uint32_t prune_non_mrng_edges(deglib::graph::MutableGraph& graph, const s
117117}
118118
119119/* *
120- * @brief Remove non-MRNG edges using a weight-sorted global strategy.
120+ * @brief Remove non-RNG edges using a weight-sorted global strategy.
121121 *
122122 * Collects all non-RNG edges across the graph, sorts them by weight (ascending),
123123 * then removes them in that order. This allows lower-weight (more important) edges
@@ -128,7 +128,7 @@ inline uint32_t prune_non_mrng_edges(deglib::graph::MutableGraph& graph, const s
128128 * @param numThreads Number of threads to use for collection (0 = use hardware concurrency).
129129 * @return Number of edges removed.
130130 */
131- inline uint32_t prune_non_mrng_edges_weight_sorted (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
131+ inline uint32_t prune_non_rng_edges_weight_sorted (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
132132 struct WeightedEdge {
133133 uint32_t from_vertex;
134134 uint32_t to_vertex;
@@ -140,7 +140,7 @@ inline uint32_t prune_non_mrng_edges_weight_sorted(deglib::graph::MutableGraph&
140140 const auto thread_count = numThreads == 0 ? std::thread::hardware_concurrency () : numThreads;
141141
142142 // Collect all non-RNG edges (multi-threaded, per-thread buffers to avoid data races)
143- std::vector<std::vector<WeightedEdge>> nonMRNG_edges_per_thread (thread_count);
143+ std::vector<std::vector<WeightedEdge>> non_rng_edges_per_thread (thread_count);
144144 deglib::concurrent::parallel_for (0 , vertex_count, thread_count, [&](size_t vertex_index, size_t thread_id) {
145145 const auto u = static_cast <uint32_t >(vertex_index);
146146 const auto neighbor_indices = graph.getNeighborIndices (u);
@@ -150,24 +150,24 @@ inline uint32_t prune_non_mrng_edges_weight_sorted(deglib::graph::MutableGraph&
150150 const auto neighbor_index = neighbor_indices[n];
151151 const auto neighbor_weight = neighbor_weights[n];
152152 if (deglib::analysis::checkRNG (graph, edge_per_vertex, u, neighbor_index, neighbor_weight) == false ) {
153- nonMRNG_edges_per_thread [thread_id].push_back ({u, neighbor_index, neighbor_weight});
153+ non_rng_edges_per_thread [thread_id].push_back ({u, neighbor_index, neighbor_weight});
154154 }
155155 }
156156 });
157157
158158 // Merge per-thread results
159- std::vector<WeightedEdge> nonMRNG_edges ;
159+ std::vector<WeightedEdge> non_rng_edges ;
160160 for (size_t i = 0 ; i < thread_count; i++) {
161- nonMRNG_edges .insert (nonMRNG_edges .end (), nonMRNG_edges_per_thread [i].begin (), nonMRNG_edges_per_thread [i].end ());
161+ non_rng_edges .insert (non_rng_edges .end (), non_rng_edges_per_thread [i].begin (), non_rng_edges_per_thread [i].end ());
162162 }
163163
164164 // Sort by weight ascending
165- std::sort (nonMRNG_edges .begin (), nonMRNG_edges .end (), [](const auto & x, const auto & y) { return x.weight < y.weight ; });
165+ std::sort (non_rng_edges .begin (), non_rng_edges .end (), [](const auto & x, const auto & y) { return x.weight < y.weight ; });
166166
167167 // Remove edges that are still non-RNG (single-threaded)
168168 size_t removed_rng_edges = 0 ;
169- for (size_t i = 0 ; i < nonMRNG_edges .size (); i++) {
170- const auto & edge = nonMRNG_edges [i];
169+ for (size_t i = 0 ; i < non_rng_edges .size (); i++) {
170+ const auto & edge = non_rng_edges [i];
171171 if (deglib::analysis::checkRNG (graph, edge_per_vertex, edge.from_vertex , edge.to_vertex , edge.weight ) == false ) {
172172 graph.changeEdge (edge.from_vertex , edge.to_vertex , edge.from_vertex , 0 );
173173 removed_rng_edges++;
@@ -178,7 +178,7 @@ inline uint32_t prune_non_mrng_edges_weight_sorted(deglib::graph::MutableGraph&
178178}
179179
180180/* *
181- * @brief Remove non-MRNG edges using an iterative per-vertex strategy.
181+ * @brief Remove non-RNG edges using an iterative per-vertex strategy.
182182 *
183183 * For each vertex, iteratively removes non-RNG edges in a do-while loop until
184184 * no more edges can be removed. This accounts for cascading effects where
@@ -189,7 +189,7 @@ inline uint32_t prune_non_mrng_edges_weight_sorted(deglib::graph::MutableGraph&
189189 * @param numThreads Number of threads to use (0 = use hardware concurrency).
190190 * @return Number of edges removed.
191191 */
192- inline uint32_t prune_non_mrng_edges_iterative (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
192+ inline uint32_t prune_non_rng_edges_iterative (deglib::graph::MutableGraph& graph, const size_t numThreads = 0 ) {
193193 const auto vertex_count = graph.size ();
194194 const auto edge_per_vertex = graph.getEdgesPerVertex ();
195195 const auto thread_count = numThreads == 0 ? std::thread::hardware_concurrency () : numThreads;
@@ -211,23 +211,23 @@ inline uint32_t prune_non_mrng_edges_iterative(deglib::graph::MutableGraph& grap
211211 }
212212
213213 // Find all non-RNG conform neighbors (indices into the sorted neighbors vector)
214- std::vector<uint32_t > nonMRNG_edges ;
214+ std::vector<uint32_t > non_rng_edges ;
215215 for (uint32_t n = 0 ; n < neighbors.size (); n++) {
216216 const auto neighbor_index = neighbors[n].first ;
217217 const auto neighbor_weight = neighbors[n].second ;
218- if (deglib::analysis::checkRNG (graph, edge_per_vertex, vertex_index_u32, neighbor_index, neighbor_weight) == false ) nonMRNG_edges .emplace_back (n);
218+ if (deglib::analysis::checkRNG (graph, edge_per_vertex, vertex_index_u32, neighbor_index, neighbor_weight) == false ) non_rng_edges .emplace_back (n);
219219 }
220220
221221 // Iteratively remove edges until stable
222222 bool removed_edge = false ;
223223 do {
224224 removed_edge = false ;
225- for (uint32_t n = 0 ; n < nonMRNG_edges .size (); n++) {
226- const auto neighbor_index = neighbors[nonMRNG_edges [n]].first ;
227- const auto neighbor_weight = neighbors[nonMRNG_edges [n]].second ;
225+ for (uint32_t n = 0 ; n < non_rng_edges .size (); n++) {
226+ const auto neighbor_index = neighbors[non_rng_edges [n]].first ;
227+ const auto neighbor_weight = neighbors[non_rng_edges [n]].second ;
228228
229229 if (deglib::analysis::checkRNG (graph, edge_per_vertex, vertex_index_u32, neighbor_index, neighbor_weight) == false ) {
230- nonMRNG_edges .erase (nonMRNG_edges .begin () + n);
230+ non_rng_edges .erase (non_rng_edges .begin () + n);
231231 graph.changeEdge (vertex_index_u32, neighbor_index, vertex_index_u32, 0 );
232232 removed_rng_edges++;
233233 removed_edge = true ;
0 commit comments