home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.ai      Awaiting the gospel from Sarah Connor      1,954 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,706 of 1,954   
   Al to All   
   Solving a simple system of linear equati   
   06 Apr 08 09:38:31   
   
   From: altu59@gmail.com   
      
   Hi,   
      
   One way to solve a system of linear equations, which is an instance of   
   CSP, is to use backtracking as illustrated by Stuart Russel and Peter   
   Norvig in the book Artificial Intelligence, A Modern Approach.   
      
   However, another variation of backtracking algorithms that is based on   
   states and operators can also be used to solve this problem:   
      
   backtrackSearch(stateList)   
   {   
    state = first(stateList);   
    if state is goal, return stateList;   
    if state is deadend, return FAIL;   
    if state is a member of stateList, return FAIL;   
      
    operators = applicable operators for state;   
    loop:   
     if operators is empty, return FAIL;   
     op = first of operators;   
     operators = rest of operators;   
     newState = op(state);   
     newStateList = {newState} union stateList;   
     path = backtrackSearch(newStateList);   
     if path = FAIL then go to loop;   
     return {op, path}   
   }   
      
   Now suppose that we want to solve the following simple problem using   
   this algorithm:   
      
   x1 + 10 + x2 + x3 = 20;   
   x1 + 12 + x4 = 20;   
   x4 + x5 + 5 + x6 = 20;   
   x3 + 11 + x6 = 20;   
      
   And suppose that we are only allowed to fill in x1...x6 with 1, 2, 3,   
   4, 5, and 6.   
      
   The question now is what operators to choose for solving this problem?   
   One possible set of operators is (x1 <- 1), (x1 <- 2), ... (x1 <-   
   6), ... (x6 <- 1), ... (x6 <- 6) that in turn set x1 to 1, x1 to   
   2, ... and x6 to 1, and x6 to 6. A total of 36 operators.   
      
   I am not very much interested in this set of operators. What   
   alternative set of operators can you think of for solving this   
   problem?   
      
   Regards,   
   Al   
      
   [ comp.ai is moderated ... your article may take a while to appear. ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca