About memory search

1. The idea of ​​memory search

    The idea is to search the memory, in the search process, there will be a lot of double counting, and if we can answer some of the state's record, you can reduce the amount of duplicate search

2, the scope of the search memory

    According to the idea of memory search, which is to solve the double counting, rather than repeating generation, that is, the search must be extended in the course of the search path by fractional computing topics , namely "search for answers and path-related" topics and not be the subject can be evaluated, after a search path, step by step must be calculated, and the search process, a search result must be based on the results of the same type of problem, which is similar to the kind of dynamic programming to solve.

In other words, the expression of his problem, not simply generate a walking program, but the cost of generating a walking program, etc., that is due to the interest, go to (x, y) point you have to go after (a, b) point to go before they can get the maximum benefit, therefore, each time through the (x, y) points are to (a, b) point to go, so we can directly state (x, y) point record it, and then directly backtracking on it.

3, core memory search implementation

     a. First, the search results to a table in the record has been stored, usually with a two-dimensional array.

     b. In the beginning of each state of the search, if this position has visited, and direct calls to answer back

    c. If not, press the normal search method

4, memory search is similar to dynamic programming is different is that it is down to do "recursive dynamic programming."

Guess you like

Origin www.cnblogs.com/Accepting/p/11269572.html