Now both "brute force search" and "branch-and-bound" method are applied