Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas.hammerl committed Feb 13, 2009
1 parent 70a4e2f commit c2880a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
16 changes: 2 additions & 14 deletions acotreewidth/trunk/include/acotreewidth/decomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ template <class T> class DecompProblem : public OptimizationProblem, public Eval
}

double eval_solution(const std::vector<unsigned int> &solution) {
return 1.0 / elim_graph_->eval_ordering(solution);
return 1.0 / this->eval_tour(solution);
}

std::vector<unsigned int> perturbate(const std::vector<unsigned int> &solution) {
Expand Down Expand Up @@ -233,20 +233,8 @@ template <class T> class TreeDecompProblem : public DecompProblem<T> {
}

unsigned int compute_width(const std::vector<unsigned int> &tour) {
unsigned int width = 0;
DecompProblem<T>::elim_graph_->rollback();
for(unsigned int i=0;i<tour.size();i++) {
unsigned int w = DecompProblem<T>::elim_graph_->get_degree(tour[i]);
DecompProblem<T>::elim_graph_->eliminate(tour[i]);
if(w > width) {
width = w;
}

if(tour.size()-i <= width) {
break;
}
}
return width;
return DecompProblem<T>::elim_graph_->eval_ordering(tour);
}
};

Expand Down
Binary file modified acotreewidth/trunk/lib/libaco.a
Binary file not shown.
5 changes: 4 additions & 1 deletion acotreewidth/trunk/src/decomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ unsigned int EliminationGraph::eval_ordering(const std::vector<unsigned int> &or
nr_eliminations__++;
eliminated__[vertex] = true;
vertex_neighbours_length = 0;

if(width > this->number_of_vertices()) {
break;
}
}
this->rollback();
delete[] vertex_neighbours;
delete[] elim_positions;
return width;
Expand Down

0 comments on commit c2880a0

Please sign in to comment.