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
2
votes
1 answer

Hill Climbing and Tabu Search in OptaPlanner

I'm using OptaPlanner to solve some plannig problems. I read the documentation and I'm not quite sure how does exactly Hill Climbing and Tabu Search algorithms work. What I'm unsure of is: does hill climbing pick only moves with THE BEST score that…
gadzix90
  • 744
  • 2
  • 13
  • 28
2
votes
2 answers

class instance not iterable

In my func, I have: """ Iterates 300 times as attempts, each having an inner-loop to calculate the z of a neighboring point and returns the optimal """ pointList = [] max_p = None …
matttm
  • 124
  • 1
  • 2
  • 15
2
votes
1 answer

Local optimums in Electric Fences

I'm writing a solution for the Usaco problem "Electric Fences". In the problem you have to find the optimal location for a point among a large amount of linesegments, so the sum of point-linesegment distances is smallest possible. I had an idea,…
Thomas Ahle
  • 30,774
  • 21
  • 92
  • 114
2
votes
0 answers

Hill Climbing Code - Random Mutation

This code should compare two fitnesses, use the best one to find the solution and then it uses the best one in the next iteration. However the problem I get is that it is just using the newest fitness regardless of whether it is bigger or smaller.…
JimmyK
  • 4,801
  • 8
  • 35
  • 47
2
votes
1 answer

Adding simulated annealing to a simple hill climbing

I've created a hill climbing algorithm which randomly generates a solution then copies that solution and mutates it a little to see if it ends up with a better solution. If it does it keeps the new solution and discards the old one. If I want to add…
Undefined
  • 1,899
  • 6
  • 29
  • 38
1
vote
0 answers

Permuations and Hill-Climbing method for reordering rows in R

I have the following problem: I have df which consists of one column and 60 rows as in df = rnorm(60, 0.06, 0.2) I want to reorder the 60 rows in order that cumprod(df+1)[60] - cumprod(df+1)[55] is as close to 1 as possible. Additionally I want…
Jj Blevins
  • 355
  • 1
  • 13
1
vote
0 answers

Is it feasible to have an algorithm in C++ which calls a Fortran program for the heavily computation parts?

I am developing an algorithm that has a large numerical computation part. My project supervisor recommended me to use Fortran because of this and so for the last weeks I've been work on it (so far so good). It would be a new version of an algorithm…
David Moreno
  • 141
  • 9
1
vote
1 answer

Does local maxima problem cause Simple Hill Climbing algorithm to be stuck in an infinite loop?

For example, I have the following problem: The only operators I can apply are: Place the uppermost block from the structure down Place a block that is not in the structure to the uppermost position of the structure I have a heuristic function…
Richard
  • 7,037
  • 2
  • 23
  • 76
1
vote
1 answer

Understanding Stochastic Hill Climber

I've been trying to understand the stochastic hill climber for a while, but not having any luck with it. I've looked through a book on heuristics and got a pseudo code. I don't understand what the probability function should look like. I understand…
smMavrik
  • 13
  • 4
1
vote
0 answers

Can't load package FSelector for hill.climbing.search

I want to use the hill.climbing.search on my data to detect the most significant deviation in my data. Therefore, I wanted to install the package FSelector which works, but when loading the package I receive this error message: >…
pineapple
  • 169
  • 9
1
vote
1 answer

Stochastic hill climbing vs random-restart hill climbing algorithms

What is difference between stochastic hill climbing and random-restart hill climbing?
Ola Galal
  • 162
  • 1
  • 11
1
vote
1 answer

Fast hill climbing algorithm that can stabilize when near optimal

I have a floating point number x from [1, 500] that generates a binary y of 1 at some probability p. And I'm trying to find the x that can generate the most 1 or has highest p. I'm assuming there's only one maximum. Is there a algorithm that can…
petabyte
  • 1,487
  • 4
  • 15
  • 31
1
vote
1 answer

What is the difference between Stochastic Hill Climbing and First Choice Hill Climbing?

Both these algorithms keeps generating random neighbors and picks if it encounters a neighbor with a better state than current. So where lies the difference? It is mentioned everywhere, First Choice Hill Climbing is suitable for cases with many…
Ritu Raj
  • 543
  • 2
  • 6
  • 23
1
vote
1 answer

How does the Hill Climbing algorithm work?

I'm learning Artificial Intelligence from a book, the book vaguely explains the code I'm about to post here, I assume because the author assumes everyone has experienced hill climbing algorithm before. The concept is rather straightforward, but I…
WaveOnyx
  • 61
  • 2
  • 8
1
vote
3 answers

Hill climbing in an n-dimensional space: finding the neighbor

In hill climbing for 1 dimension, I try two neighbors - a small delta to the left and one to the right of my current point, and then keep the one that gives a higher value of the objective function. How do I extend it to an n-dimensional space? How…
max_max_mir
  • 1,494
  • 3
  • 20
  • 36