[eclipse-users] Counting Backtracks

From: kot23 <kot23_at_...97...>
Date: Sun, 2 Mar 2008 17:53:36 +0200
Hello all, 

I have a question concerning the total number of backtracks during branch and bound search.

I use the search/6 predicate with the option [backtrack(B)] to count the number of backtracks, which is printed to the screen, like this (M is a matrix):

search_mods(M) :-
    term_variables(M, Vars),
    search(Vars,
            0,
            first_fail,
            indomain_max,
            dbs(4,bbs(300)),
            [backtrack(B)]),
    writeln('    ':backtracks:B).

I then use the bb_min/3 predicate to minimize the cost like this (the COST variable is already set up, elsewhere):

bb_min( search_mods(M),
            COST,
            bb_options{from:240}).

The output I have is like this:

     : backtracks : 0
Found a solution with cost 335
     : backtracks : 901
Found a solution with cost 285
     : backtracks : 904
Found a solution with cost 270
     : backtracks : 915
Found a solution with cost 255
Found no solution with cost 240.0 .. 240.0

So, my question is, what is the real number of backtracks, for finding the last solution in the case above? Is it "915" backtracks or the sum of each intermediate solution, ie: 0+901+904+914=2719 backtracks?

Thanks,
Christoforidis Nikos

-- 
kot23_at_...97...
Received on Sun Mar 02 2008 - 15:53:32 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST