aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 01173e8..687bef5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -271,9 +271,6 @@ void erase_edges(map<int, node> &graph, int id_a, int id_b)
/* *it is modified to point to next element */
void erase_node(map<int, node> &graph, map<int, node>::iterator &it)
{
- if(verbose)
- cerr << "Pruning node " << it->first << endl;
-
node &n = it->second;
for(int i = 0; i < n.neighbors.size(); i++)
@@ -312,7 +309,8 @@ void prune(map<int, node> &graph, int s, int t)
/* see if there's a path from this node to S */
if(count_paths(graph, id, s, visited) == 0)
{
- cerr << "Pruning node " << id << ": no path to S without T" << endl;
+ if(verbose)
+ cerr << "Pruning node " << id << ": no path to S without T" << endl;
erase_node(graph, it);
@@ -330,7 +328,8 @@ void prune(map<int, node> &graph, int s, int t)
/* see if there's a path from this node to T */
if(count_paths(graph, id, t, visited) == 0)
{
- cerr << "Pruning node " << id << ": no path to T without S" << endl;
+ if(verbose)
+ cerr << "Pruning node " << id << ": no path to T without S" << endl;
erase_node(graph, it);
@@ -345,7 +344,8 @@ void prune(map<int, node> &graph, int s, int t)
if(neighbors == 0 || (neighbors == 1 && it->second.neighbors[0].id != s))
{
- cerr << "Pruning node " << id << ": zero or one connection" << endl;
+ if(verbose)
+ cerr << "Pruning node " << id << ": zero or one connection" << endl;
erase_node(graph, it);
if(dumponprogress)