Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is golden section search better than binary search?

Recently I've heard an opinion that binary search may be improved by taking by splitting the range by phi (golden ration) instead of by 2. This was a big surprise to me, because I've never heard about such optimization. Is this true? Would this have been true if division by 2 and by phi was equally performant?

If not, are there any general conditions under which golden section search would perform faster than binary search?

UPD: Edited to remove link to a non-relevant Wikipedia article. Sorry for misleading.

like image 403
Fixpoint Avatar asked Nov 22 '10 15:11

Fixpoint


People also ask

Which is better Fibonacci or binary search?

when the elements being searched have non-uniform access memory storage (i.e., the time needed to access a storage location varies depending on the location previously accessed), the Fibonacci search has an advantage over binary search in slightly reducing the average time needed to access a storage location."

Why is there a golden section search?

The golden-section search is an efficient way to progressively reduce the interval locating the minimum. The key is to observe that regardless of how many points have been evaluated, the minimum lies within the interval defined by the two points adjacent to the point with the least value so far evaluated.

What is golden ratio in optimization?

He introduced a series of numbers for which the ratio between the two consecutive numbers is the same (equal to approximately 1.618) and known as the golden ratio.


2 Answers

There are two algorithms called "Fibonacci search".

The article you linked is about a numerical algorithm for finding the maximum or minimum of certain functions. It is the optimal algorithm for this problem. This problem is just different enough from the binary search problem that it should be obvious for any given case which is appropriate.

The other kind of Fibonacci search does attack the same problem as binary search. Binary search is essentially always better. Knuth writes that Fibonacci search "is preferable on some computers, because it involves only addition and subtraction, not division by 2." But almost all computers use binary arithmetic, in which division by 2 is simpler than addition and subtraction.

(The Wikipedia article currently claims that Fibonacci search could have better locality of reference, a claim Knuth does not make. It could, perhaps, but this is misleading. The tests done by a Fibonacci search are closer together precisely to the extent that they are less helpful in narrowing down the range; on average this would result in more reads from more parts of the table, not fewer. If the records are actually stored on tape, so that seek times dominate, then Fibonacci search might beat binary search—but in that case both algorithms are far from optimal.)

like image 85
Jason Orendorff Avatar answered Nov 16 '22 04:11

Jason Orendorff


I may be missing something here, but after looking at the Wikipedia entry on the golden section search it seems like it doesn't solve the same problem as a binary search at all. Whereas a binary search is useful for finding a value in a sorted list, a golden section search is used to find a minimum or maximum value of a function over a range of values.

like image 21
Ferruccio Avatar answered Nov 16 '22 02:11

Ferruccio