Questions tagged [hill-climbing]

Hill climbing is a mathematical optimization technique which belongs to the family of local search. It is an iterative algorithm that starts with an arbitrary solution to a problem, then attempts to find a better solution by incrementally changing a single element of the solution. If the change produces a better solution, an incremental change is made to the new solution, repeating until no further improvements can be found.

Hill climbing is a mathematical optimization technique which belongs to the family of local search. It is an iterative algorithm that starts with an arbitrary solution to a problem, then attempts to find a better solution by incrementally changing a single element of the solution. If the change produces a better solution, an incremental change is made to the new solution, repeating until no further improvements can be found.

For example, hill climbing can be applied to the travelling salesman problem. It is easy to find an initial solution that visits all the cities but will be very poor compared to the optimal solution. The algorithm starts with such a solution and makes small improvements to it, such as switching the order in which two cities are visited. Eventually, a much shorter route is likely to be obtained.

Hill climbing is good for finding a local optimum (a solution that cannot be improved by considering a neighbouring configuration) but it is not guaranteed to find the best possible solution (the global optimum) out of all possible solutions (the search space). The characteristic that only local optima are guaranteed can be cured by using restarts (repeated local search), or more complex schemes based on iterations, like iterated local search, on memory, like reactive search optimization and tabu search, on memory-less stochastic modifications, like simulated annealing.

The relative simplicity of the algorithm makes it a popular first choice amongst optimizing algorithms. It is used widely in artificial intelligence, for reaching a goal state from a starting node. Choice of next node and starting node can be varied to give a list of related algorithms. Although more advanced algorithms such as simulated annealing or tabu search may give better results, in some situations hill climbing works just as well. Hill climbing can often produce a better result than other algorithms when the amount of time available to perform a search is limited, such as with real-time systems. It is an anytime algorithm: it can return a valid solution even if it's interrupted at any time before it ends.

Source: Wikipedia(Hill Climbing)

70 questions
16
votes
7 answers

Hill climbing algorithm simple example

I am a little confused with Hill Climbing algorithm. I want to "run" the algorithm until i found the first solution in that tree ( "a" is initial and h and k are final states ) and it says that the numbers near the states are the heuristic values.…
Iakob Fokas
  • 193
  • 1
  • 2
  • 6
7
votes
2 answers

Behavioral difference between Gradient Desent and Hill Climbing

I'm trying to understand the difference between these two algorithms and how they differ in solving a problem. I have looked at the algorithms and the internals of them. It would be good to hear from others who already experienced with them.…
PRCube
  • 566
  • 2
  • 6
  • 19
6
votes
2 answers

Stochastic Hill Climbing

I am trying to implement Stoachastic Hill Climbing in Java. I understand that this algorthim makes a new solution which is picked randomly and then accept the solution based on how bad/good it is. For example, if its very bad then it will have a…
Mikey
  • 687
  • 4
  • 17
4
votes
4 answers

Hill climbing and single-pair shortest path algorithms

I have a bit of a strange question. Can anyone tell me where to find information about, or give me a little bit of an introduction to using shortest path algorithms that use a hill climbing approach? I understand the basics of both, but I can't put…
4
votes
3 answers

Fast algorithm for finding maximum in a bell-shaped list of values

I have a list of values that is increasing to a maximum and then decreasing again (it is an observed gaussian/bell-shaped distribution). values = [0, 4, 5, 15, 30, 20, 10, 5, 0]; But the distribution can also be shifted: values = [0, 0, 0, 1, 2, 3,…
Yeti
  • 2,647
  • 2
  • 33
  • 37
4
votes
3 answers

Stochastic hill climbing vs first-choice hill climbing algorithms

What is the difference between stochastic hill climbing and first-choice hill climbing algorithms?
4
votes
1 answer

What is the time complexity of the Hill Climbing Algorithm?

Specifically, the Steepest-Ascent Hill Climbing, Stochastic Hill Climbing and Simulated Annealing. The generalized time complexity would be fine too. Thanks.
3
votes
1 answer

Lisp - modify A* to check for best cost, receive list of goal nodes

I am trying to modify an existing Hill-climb function, which takes two node names (such as A and E), and has an optional parameter which is used recursively (a queue). I'm trying to define a function 'cheaper' that evaluates if one path is cheaper…
Sean Glover
  • 520
  • 6
  • 22
3
votes
1 answer

Lisp - Hill Climbing

Ok I have a Lisp implementation of BFS that I am trying to convert to do a hill climbing search. Here is what my BFS code looks like: ; The list of lists is the queue that we pass BFS. the first entry and ; every other entry in the queue is a…
snivek
  • 47
  • 2
  • 6
3
votes
1 answer

what is the difference between Hill climbing and A*?

In Artificial intelligence, these algprithms are very popular. I tried looking for methods to solve the 8puzzle problem and it seems like both of them have a similar approach. Can anyone explain what is the difference?
Leena
  • 703
  • 1
  • 12
  • 21
3
votes
0 answers

Error in hill.climbing : INTEGER() can only be applied to a 'integer', not a 'NULL'

I'm trying to use hill-climbing function hc() in bnlearn package . Despite that all columns of my data frame are factor and carry no NA values, I still kept getting such error message: Error in hill.climbing(x = x, start = start, whitelist =…
3
votes
0 answers

How to create a hill climbing algorithm

I have been following a book for learning python, and the book has one of the following challenge: Self Check Here’s a self check that really covers everything so far. You may have heard of the infinite monkey theorem? The theorem states that a…
rluo
  • 85
  • 1
  • 7
3
votes
0 answers

Name for hill climbing algorithm where search space is transformed

I am developing an algorithm which is based on the hill-climbing algorithm, but with a method to overcome the problem of finding local optimal solutions. Unlike something like simulated annealing, where randomness is introduced into the search…
3
votes
1 answer

Proper Heuristic Mechanism For Hill Climbing

The following problem is an exam exercise I found from an Artificial Intelligence course. "Suggest a heuristic mechanism that allows this problem to be solved, using the Hill-Climbing algorithm. (S=Start point, F=Final point/goal). No diagonal…
3
votes
1 answer

How to generate neighbors for N-Queen Hill Climbing

I'm having trouble generating neighbors for implementing hill climbing algorithms. Here's the code I'm currently working with. public ArrayList generateNeighbors(){ ArrayList neighborBoards = new ArrayList(); …
aspalding
  • 151
  • 2
  • 8
1
2 3 4 5