[gecode-users] nested cost functions
Mikael Zayenz Lagerkvist
zayenz at gmail.com
Wed Sep 14 13:21:36 CEST 2011
On 09/14/2011 12:20 PM, revo revo wrote:
> One additional question - for some reason when I use DFS, I am able to
> return all solutions, but when I use BAB, I seem to only get one
> solution, using the exact same Script class (with no other differences
> to how it's called). Any reason for this?
The following is assuming that you let the program explore all of the
search space in both runs. If you are using the script command line
driver, that means supplying "-solutions 0".
That said, BAB is made for finding one instance of the optimal solution.
Each new solution returned will be better than the last one returned.
Given that you let a program run long enough, the last solution is an
optimal solution to your problem. If you are lucky, or if you branching
heuristic is very good, you might find the best solution directly, in
which case only one solution is returned.
If you want all the best solutions, what one should do is first find one
optimal solution (using BAB as described above). Then one should to a
DFS search with the problem modified to only accept solutions equivalent
to the previously found optimal solution.
Cheers,
Mikael
--
Mikael Zayenz Lagerkvist, http://www.it.kth.se/~zayenz
More information about the users
mailing list