PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] ending recursion
Date: Monday, 10 Feb 2020, 16:36:01


    > Message Posted By: Unknown
    >
    > for backtracking heuristic B: are there any suggestions on how to quit
    > recursion when we find an assignment that equals the lower bound? would
    > exit(0) work in this case? (i.e. would it take us back to the next line in
    > main from the backtracking function?)

You have to unwind the recursion by noting that the best
value returned by the recursive call is equal to the
lower bound and returning immediately.

You cannot use exit() since there may be other flags.

--Stan-
PREV INDEX NEXT