1 / 5

Appendix C

Appendix C. 1. Min-Conflict Hill Climbing 2. Min-Conflict Random Walk. Min-conflict Hill Climbing. procedure GenerateLocalMoves(s, TotalMoves) begin M’  , BestCost  f(s) choose randomly a variable v in conflict

vida
Download Presentation

Appendix C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Appendix C 1. Min-Conflict Hill Climbing 2. Min-Conflict Random Walk

  2. Min-conflict Hill Climbing procedure GenerateLocalMoves(s, TotalMoves) begin M’ , BestCost  f(s) choose randomly a variable v in conflict choose a value d for v (d  dcurr) that minimizes the number of conflicts for v. m  {v, d} if f(sm)  BestCost then // accepts improving moves and sideways moves begin if f(sm) < BestCost then begin BestCost  f(sm); M’  end M’  M’  m end if M’ = then TotalMoves  MaxMoves return M’ end

  3. Notes • How to create initial solution in MCHC • First, randomly assign a domain value to the first variable, then assign each of subsequent variable a domain value that causes the least number of conflicts with previously assigned variables. (greedy preprocessing phase) • However, MCHC does not have the mechanism to escape local minima.

  4. Min-Conflict Random Walk begin generate randomly an initial solution s n_iter := 0; n_moves := 0 while f(x) > max_cost and n_moves < max_moves do if p > random number between 0 and 1 then choose randomly a variable V in conflict choose randomly a value v’ for V else choose randomly a variable V in conflict choose a value v’ for V that minimizes the number of conflicts for v. (the current value is chosen only if all the other values increase the number of violated constraints.) if v’ is different from the current value of V then assign v’ to V n_moves := n_moves + 1 n_iter := n_iter + 1 endwhile output(s) end

  5. Notes • The algorithm MCRW is controlled by the random probability p. • An iteration leading a new solution different from the current one is called a move. • MCRW may have many iterations that do not lead to a move. An improvement can be as follows: • If an iteration fails to lead to a move for a conflicting variable V, V will not be considered for the next iterations until a move is effectively carried out.

More Related