From b32feed117889593ff7e7c1de6bc1e36e76febdc Mon Sep 17 00:00:00 2001 From: Sebastian Buchwald Date: Sun, 7 Dec 2008 17:40:52 +0000 Subject: [PATCH] Node pointers of reduced edges (incident to RI/RII reduced nodes) are outdated after brute force reduction. So an update is necessary before starting back propagating such a node. Brute force solver seems to work now. [r24377] --- heuristical.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/heuristical.c b/heuristical.c index 91b4f3080..0e74e6f35 100644 --- a/heuristical.c +++ b/heuristical.c @@ -521,6 +521,8 @@ void solve_pbqp_heuristical(pbqp *pbqp) pbqp->solution = determine_solution(pbqp->dump_file); + //printf("solution: %lld\n", pbqp->solution); + /* Solve reduced nodes. */ back_propagate(pbqp); @@ -965,6 +967,8 @@ void solve_pbqp_brute_force(pbqp *pbqp) pbqp->solution = determine_solution(pbqp->dump_file); + //printf("solution: %lld\n", pbqp->solution); + /* Solve reduced nodes. */ back_propagate(pbqp); @@ -990,10 +994,18 @@ void back_propagate_RI(pbqp *pbqp, pbqp_node *node) if (is_src) { other = edge->tgt; assert(other); + + /* Update pointer for brute force solver. */ + other = pbqp->nodes[other->index]; + vector_add_matrix_col(vec, mat, other->solution); } else { other = edge->src; assert(other); + + /* Update pointer for brute force solver. */ + other = pbqp->nodes[other->index]; + vector_add_matrix_row(vec, mat, other->solution); } @@ -1049,6 +1061,10 @@ void back_propagate_RII(pbqp *pbqp, pbqp_node *node) tgt_is_src = tgt_edge->src == node; } + /* Update pointer for brute force solver. */ + src_node = pbqp->nodes[src_node->index]; + tgt_node = pbqp->nodes[tgt_node->index]; + src_mat = src_edge->costs; tgt_mat = tgt_edge->costs; -- 2.20.1