Skip to content

adhishagc/Ackley-Function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ackley Function: Multimodal Optimization Benchmark Visualizer

A comprehensive Python implementation and visualization tool for the Ackley Function, a widely used non-convex test problem for evaluating mathematical optimization algorithms.

Ackley Function Topology

Technical Overview

The Ackley Function is a benchmark problem characterized by a nearly flat outer region and a deep, steep-walled central peak. In computer science and computational mathematics, it is used to test the performance of global search heuristics (like Genetic Algorithms, Particle Swarm Optimization, or Simulated Annealing) because its many local minima make it easy for algorithms to get trapped.

Mathematical Definition

For a 2-dimensional space, the function is defined as:

$$ f(x, y) = -20 \exp \left( -0.2 \sqrt{0.5(x^2 + y^2)} \right) - \exp \left( 0.5(\cos(2\pi x) + \cos(2\pi y)) \right) + e + 20 $$

The global minimum is located at the origin: $$f(0, 0) = 0$$

Computational Properties

  • Non-convexity: The function has numerous local minima surrounding the global optimum.
  • Modality: It is highly multimodal, requiring high-precision global search capabilities.
  • Symmetry: The function is symmetric about the origin.

Performance Visualization

The included Jupyter Notebook provides 3D scatter plots and surface visualizations of the function across custom coordinate ranges.

Ackley 3D Plot

The optimization process effectively traverses the "potholes" (local minima) to converge at the central global minimum.

Installation and Usage

Prerequisites

Ensure you have Python installed along with the following data science libraries:

pip install numpy matplotlib

Library Installation

You can install this implementation as a local package:

pip install .

Getting Started

import ackley as ak

# Calculate value at a specific point
val = ak.ackley_function(0, 0)
print(f"Value at global minimum: {val}")

# Generate a general plot
ak.plot_ackley_general()

Project Structure

  • ackley.py: Core implementation of the Ackley function and plotting utilities.
  • Jupyter Notebook/: Interactive demonstration and results analysis.
  • setup.py: Configuration for package installation.
  • README.md: Technical documentation and benchmark overview.

About the Subject Matter

Proposed by David Ackley in 1987, this function remains a gold standard in optimization research. It serves as a critical test for an algorithm's ability to escape local optima and successfully navigate toward a global solution in high-dimensional search spaces.


Optimized for Advanced Research and Optimization Benchmarking.

About

Ackley Function value Generation for Optimization Problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors