Task assignment algorithm with Branch and Bound, add pruning check.