Skip to content
Snippets Groups Projects
Commit 643784f5 authored by p-hamann's avatar p-hamann
Browse files

Add edge indexing to IBFS constructor

parent 0b33dbf2
Branches
1 merge request!7Incremental bfs
......@@ -3,7 +3,7 @@
#include <gp-bnb/incremental_bfs.hpp>
incremental_bfs::incremental_bfs(const graph& g, std::vector<node_id> sources, std::vector<node_id> sinks)
incremental_bfs::incremental_bfs(graph& g, std::vector<node_id> sources, std::vector<node_id> sinks)
: g_(g), sources_(sources), sinks_(sinks), s_(ibfs_subtree(sources, subtree::s, g)), t_(ibfs_subtree(sinks, subtree::t, g)) {
assert(!sources.empty());
assert(!sinks.empty());
......@@ -17,6 +17,8 @@ incremental_bfs::incremental_bfs(const graph& g, std::vector<node_id> sources, s
for (node_id node : sinks) {
node_assignments_[node-1] = t_root;
}
g.index_edges();
}
void incremental_bfs::run() {
......
......@@ -13,7 +13,7 @@ public:
* @param List of sources for S-T-cut
* @param List of sinks for S-T-cut
*/
incremental_bfs(const graph& g, std::vector<node_id> sources, std::vector<node_id> sinks);
incremental_bfs(graph& g, std::vector<node_id> sources, std::vector<node_id> sinks);
/** @brief Executes the IBFS algorithm
*/
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment