@@ -83,6 +83,7 @@ class CCSketchAlg {
8383 // for accessing if the DSU is valid from threads that do not perform updates
8484 std::atomic<bool > shared_dsu_valid;
8585
86+ // Most recent spanning forest computed by algorithm and associated locks
8687 std::unordered_set<node_id_t > *spanning_forest;
8788 std::mutex *spanning_forest_mtx;
8889
@@ -104,8 +105,8 @@ class CCSketchAlg {
104105 /* *
105106 * Sample a single supernode represented by a single sketch containing one or more vertices.
106107 * Updates the dsu and spanning forest with query results if edge contains new connectivity info.
107- * @ param skt sketch to sample
108- * @ return [bool] true if the query result indicates we should run an additional round.
108+ * param: skt sketch to sample
109+ * return: [bool] true if the query result indicates we should run an additional round.
109110 */
110111 bool sample_supernode (Sketch &skt);
111112
@@ -115,8 +116,8 @@ class CCSketchAlg {
115116 void create_merge_instructions (std::vector<MergeInstr> &merge_instr);
116117
117118 /* *
118- * @ param reps set containing the roots of each supernode
119- * @ param merge_instr a list of lists of supernodes to be merged
119+ * param: reps set containing the roots of each supernode
120+ * param: merge_instr a list of lists of supernodes to be merged
120121 */
121122 bool perform_boruvka_round (const size_t cur_round, const std::vector<MergeInstr> &merge_instr,
122123 std::vector<GlobalMergeData> &global_merges);
@@ -127,6 +128,8 @@ class CCSketchAlg {
127128 */
128129 void boruvka_emulation ();
129130
131+ void filter_sf_edges (SpanningForest &sf);
132+
130133 // constructor for use when reading from a serialized file
131134 CCSketchAlg (node_id_t num_vertices, size_t seed, std::ifstream &binary_stream,
132135 CCAlgConfiguration config);
@@ -169,9 +172,9 @@ class CCSketchAlg {
169172
170173 /* *
171174 * Update all the sketches for a node, given a batch of updates.
172- * @ param thr_id The id of the thread performing the update [0, num_threads)
173- * @ param src_vertex The vertex where the edges originate.
174- * @ param dst_vertices A vector of destinations.
175+ * param: thr_id The id of the thread performing the update [0, num_threads)
176+ * param: src_vertex The vertex where the edges originate.
177+ * param: dst_vertices A vector of destinations.
175178 */
176179 void apply_update_batch (int thr_id, node_id_t src_vertex,
177180 const std::vector<node_id_t > &dst_vertices);
@@ -198,8 +201,8 @@ class CCSketchAlg {
198201 /* *
199202 * Apply a batch of updates that have already been processed into a sketch delta.
200203 * Specifically, the delta is in the form of a pointer to raw bucket data.
201- * @ param src_vertex The vertex where the all edges originate.
202- * @ param raw_buckets Pointer to the array of buckets from the delta sketch
204+ * param: src_vertex The vertex where the all edges originate.
205+ * param: raw_buckets Pointer to the array of buckets from the delta sketch
203206 */
204207 void apply_raw_buckets_update (node_id_t src_vertex, Bucket *raw_buckets);
205208
@@ -213,26 +216,34 @@ class CCSketchAlg {
213216
214217 /* *
215218 * Main parallel query algorithm utilizing Boruvka and L_0 sampling.
216- * @ return the connected components in the graph.
219+ * return: the connected components in the graph.
217220 */
218221 ConnectedComponents connected_components ();
219222
220223 /* *
221224 * Point query algorithm utilizing Boruvka and L_0 sampling.
222225 * Allows for additional updates when done.
223- * @ param a, b
224- * @ return true if a and b are in the same connected component, false otherwise.
226+ * param: a, b vertices of the graph. Check if these are connected.
227+ * return: true if a and b are in the same connected component, false otherwise.
225228 */
226229 bool point_query (node_id_t a, node_id_t b);
227230
228231 /* *
229232 * Return a spanning forest of the graph utilizing Boruvka and L_0 sampling
230233 * IMPORTANT: The updates to this algorithm MUST NOT be a function of the output of this query
231234 * that is, unless you really know what you're doing.
232- * @ return the spanning forest of the graph
235+ * return: the spanning forest of the graph
233236 */
234237 SpanningForest calc_spanning_forest ();
235238
239+ /* *
240+ * Return k edge-disjoint spanning forests of the graph.
241+ * IMPORTANT: The updates to this algorithm MUST NOT be a function of the output of this query
242+ * that is, unless you really know what you're doing.
243+ * return: k edge-disjoint spanning forests of the graph.
244+ */
245+ std::vector<SpanningForest> calc_disjoint_spanning_forests (size_t k);
246+
236247#ifdef VERIFY_SAMPLES_F
237248 void set_verifier (std::unique_ptr<GraphVerifier> verifier) {
238249 this ->verifier = std::move (verifier);
@@ -241,7 +252,7 @@ class CCSketchAlg {
241252
242253 /* *
243254 * Serialize the graph data to a binary file.
244- * @ param filename the name of the file to (over)write data to.
255+ * param: filename the name of the file to (over)write data to.
245256 */
246257 void write_binary (const std::string &filename);
247258
0 commit comments