Gradient-Free-Optimizers icon indicating copy to clipboard operation
Gradient-Free-Optimizers copied to clipboard

Add space-filling curves algorithm to grid-search

Open SimonBlanke opened this issue 9 months ago • 3 comments

One drawback of the grid-search algorithm is its lack of exploration of the search-space if the number of iterations is much smaller, than the search-space. The grid-search begins in a "corner" of the search-space and continues step by step along paths, that are close to already explored paths.

One way, that might improve the exploration characteristics is to follow another path through the search-space in form of space-filling curves. This could be something like a Hilbert-curve or a Z-order curve.

I often see those space-filling curves applied to a two dimensional space. To apply those algorithms in GFO it is important, that they work in n dimensions and not just in two.

SimonBlanke avatar Mar 04 '25 09:03 SimonBlanke

Hi! @SimonBlanke I'm interested in exploring and implementing the idea of using space-filling curves like the Hilbert or Z-order curve for improving search-space exploration in GFO. I understand that most common implementations focus on 2D, but I’d like to work on generalizing this to n dimensions, which is crucial for GFO’s use case.

Could you please assign this issue to me? I'd love to contribute to this!

Thanks 🙌

aryan0931 avatar Apr 11 '25 11:04 aryan0931

Done! Have fun ;-)

Feel free to contact me if you have questions.

SimonBlanke avatar Apr 11 '25 11:04 SimonBlanke

Proposed Changes:

Enhanced GridSearch exploration using n-dimensional space-filling curves (Hilbert/Z-order) instead of linear grid traversal.

Added optional path parameter ("grid", "hilbert", "zorder") to select traversal strategy.

Precompute and scale curve points to match parameter ranges for compatibility.

Used the hilbertcurve package for Hilbert generation and custom bitwise logic for Z-order.

Key Questions:

Does this approach maintain n-dimensional locality properly for optimization tasks?

Are the curve-generation methods (especially Z-order) computationally viable for high dimensions?

aryan0931 avatar Apr 12 '25 08:04 aryan0931

Hello @aryan0931,

somehow this issue did not appear on my radar any more. Here are some hints for your questions:

The discrete Hilbert or Morton (Z-order) mapping keeps neighbouring grid points reasonably close even in many (>2) dimensions. That is basically what they are designed to do. Computing space-filling curves in general should not be computationally expensive.

SimonBlanke avatar Aug 05 '25 04:08 SimonBlanke

Thank you sir for your reply, but I will need some time to work on this issue as placements and job hiring season is going on in my college right now.

aryan0931 avatar Aug 05 '25 11:08 aryan0931