模板:

    1. Pick a starting point.
    2. while(Problem is not solved)
    3. For each path from the starting point.
    4. check if selected path is safe, if yes select it
    5. and make recursive call to rest of the problem
    6. before which undo the current move.
    7. End For
    8. If none of the move works out, return false, NO SOLUTON.