Loading ...
Sorry, an error occurred while loading the content.

Find all solutions with uninformed search all (like DFS)

Expand Messages
  • amir reza niakan
    hi, I want to find all solutions in state space for a problem with dfs algorithm I write this I think it is true but not efficient. Can anyone say something
    Message 1 of 1 , Jun 23 5:24 AM
    • 0 Attachment
      hi, I want to find all solutions in state space for a
      problem with dfs algorithm I write this I think it is
      true but not efficient. Can anyone say something about
      it or write a new algorithm!

      initial(parameter for method dfs): x = root
      initial(global variable): path.add(root);
      initial(global variable): dynamicArray solutions;

      method dfs(node x, dynamicArray path[])
      {
      path.add(x)
      foreach ( node i in successor(x) )
      {
      if( GoalTest(i)==true )
      solutions.add(path);
      else
      //we must have new copy if we pass just a reference
      //it is not work correctly!
      dfs(i,deepCopy(path))

      }
      return;
      }


      ___________________________________________________________
      Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
      your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html
    Your message has been successfully submitted and would be delivered to recipients shortly.