Question: Devise A Hill Climbing Search Based Approach To Solve N-City Tsps. You Must de Ne All Req..
Question: Devise A Hill Climbing Search Based Approach To Solve N-City Tsps. You Must de Ne All Req..
home / study / engineering / computer science / computer science questions and answers / devise a...
Find solutions for your homework
Devise a hill climbing search based approach to solve N-city TSPs. You must de ne all required elements to
be able to implement the hill climbing search as indicated in the pseudocode of this algorithm including
the state description (representation of the problem), the initial state, the successor function and applicable
actions, the goal test or the goal state, and the heuristic function h. Strive for an evaluation or heuristic
function de nition that facilitates optimal solutions. Describe the pseudocode for the hill climbing
algorithm adapted for the TSP. There is no need to implement the search algorithm.
2 Comments
Expert Answer
rrrRnnm
answered this
The Hill Climbing algorithm is great for nding local optima and works by changing a small part of the
current state to get a better (in this case, shorter) path.
implement the small changes to nd a better solution is up to us. Let's say we want to simply switch two
nodes and only keep the result if it's better than your current solution.
Just swapping the second town with some other town gives us the following:
# rst iteration
start: ABCDEFGA
next: ACBDEFGA, ADCBEFGA, AECDBFGA, AFCDEBGA, AGCDEFBA
# second iteration
start: ADCBEFGA
next: ACDBEFGA, ABCDEFGA, AECBDFGA, AFCBEDGA, AGCBEFDA
return 0;
}
we would want to check the tness of each of these possibilities and keep the best one. Then reiterate
until none of the next possibilities are better than your current state. We'll want to continually use the same
algorithm for each iteration.
we can switch the second city on the rst iteration, the third on the second, the fourth on the third, etc. but
make sure we loop back around and continue this style of swapping and don't stop when we reach the
end.
0 Comments
0
Up next for you in Computer Science
?nformed search method – Hill Climbing Search to solve the 8-queens problem with c++
See answer 100% (1 rating)
Show more
COMPANY
CUSTOMER SERVICE