05 --- backtracking algorithm notes

Outline  

        Try to find the problem in the search process solution, when found to have been solved condition is not satisfied, on the "back" to return to try a different path.

  Backtracking is a search method selected from the preferred, optimal selection by the forward search conditions to achieve the goal. But when a step to explore, discover original choice is not superior or to meet its target, it is a step back to re-select, this dead end on the return walk technology for backtracking, and meet back at some point state conditions called "backtrack point."

        Tree in the solution space of all solutions contain the problem in accordance with the policy of depth-first search, depth exploration of the solution space tree starting from the root. While exploring to a node, the node must first determine whether the solution of the problem included, if included, set off from the node to continue to explore it, the solution if the node does not contain the problem, then layer by layer to their ancestors node back. (In fact, backtracking depth-first search algorithm is implicit graph).

  All Solutions of problems with backtracking if the time, to go back to the root, and the root of all possible sub-tree should have been searched before the end of times.

  And if using backtracking find a solution either, as long as the search for a solution to the problem will be over.

 

Problem-solving ideas

        For a given problem, identify problems of the solution space: first of all should be clearly defined solution space problem, the solution space issue should contain at least one issue of (optimal) solution;
  determine the junction point of the extended search rules;
  depth-first search solution space and pruning function in the search process to avoid using invalid search

 

Scenarios

 

Guess you like

Origin www.cnblogs.com/clarino/p/11965094.html