{"id":22916570,"url":"https://github.com/gamatos/basinhopping.jl","last_synced_at":"2025-04-01T12:44:02.579Z","repository":{"id":64604956,"uuid":"576869821","full_name":"gamatos/Basinhopping.jl","owner":"gamatos","description":"The basinhopping global optimization algorithm written in the Julia programming language","archived":false,"fork":false,"pushed_at":"2024-03-22T13:46:04.000Z","size":207,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T20:47:26.109Z","etag":null,"topics":["global-optimization","optimization","optimization-algorithms"],"latest_commit_sha":null,"homepage":"https://matos.dev/Basinhopping.jl/","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gamatos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-11T08:53:19.000Z","updated_at":"2024-10-24T05:08:01.000Z","dependencies_parsed_at":"2025-02-07T07:38:23.581Z","dependency_job_id":null,"html_url":"https://github.com/gamatos/Basinhopping.jl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamatos%2FBasinhopping.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamatos%2FBasinhopping.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamatos%2FBasinhopping.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gamatos%2FBasinhopping.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gamatos","download_url":"https://codeload.github.com/gamatos/Basinhopping.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246642136,"owners_count":20810548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["global-optimization","optimization","optimization-algorithms"],"created_at":"2024-12-14T06:13:43.089Z","updated_at":"2025-04-01T12:44:02.563Z","avatar_url":"https://github.com/gamatos.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basinhopping.jl\n\n![GitHub Logo](docs/src/assets/logo.svg)\n\n[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://matos.dev/Basinhopping.jl/stable)\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://matos.dev/Basinhopping.jl/dev)\n\n## Description\n\nJulia implementation of the basinhopping global optimization algorithm. This algorithm attempts to find the global minimum of a given function by successively performing a local optimization followed by a perturbation of the optimal parameters. This allows the algorithm to \"jump\" between local minima until the global one is found. An acceptance test determines whether a \"jump\" is performed or not.\n\n## Tutorial\n\n### Basic usage\n\n```julia\nusing Optim\nusing Basinhopping\nusing LinearAlgebra\n\nf(x) = norm(x)\n\n# Define local optimiser to use\nopt = (initial_guess)-\u003eoptimize(f, initial_guess, LBFGS())\n\n# Optimise\nret = basinhopping(opt, [1.0, 1.0], BasinhoppingParams(niter=200))\n```\n\nOptional arguments are passed using the `BasinhoppingParams` constructor. The keyword arguments are\n- `niter`: Integer specifying how many local optimisations should be performed.\n- `step_taker`: How to perturb local minimum parameters to find initial condition for next local optimization (see [Perturbation of optimal parameters](#perturbation-of-optimal-parameters)).\n- `test`: Determines how to decide whether to accept a local minimum or to discard it (see [Acceptance criteria](#acceptance-criteria)).\n- `callback`: Function that gets called after each local optimization. Has signature `(x, min, new_x, new_min, test_result) -\u003e bool`. Returning `true` stops the algorithm.\n- `niter_success`: If more than this number of tests are rejected, return current minimum as the global minimum. Defaults to going through all iterations regardless of number of rejections.\n\nThe optimizer supplied must return a structure which has the following functions defined: `minimizer`, `minimum`, `f_calls`, `g_calls`, `h_calls`. This follows the interface of interface `Optim.jl`, which is supported as a provider of local optimizers.\n\n### Acceptance criteria\n\nAfter a local minimum is found, it is compared to the previously found minimum using an acceptance test. The test is specified by passing an instance of a subtype of `AcceptanceTest` to the `test` keyword argument of `BasinhoppingParams`. \n\nThe default acceptance test is a Metropolis test, and is specified by the `MetropolisTest` structure. The test is accepted if the new minimum has a lower value than the previous one; otherwise it is accepted with probability\n\n```julia\nexp(-(new_minimum - old_minimum) / T)\n```\nwhere `T` (the temperature) is passed as a parameter to the structure.\n\nTo implement a custom acceptance criterion, create a subtype of `AcceptanceTest` and implement the `take_step!(d::StepTaker, x)` function for that type, where `x` are the coordinates of the current minimum.\n\n\n### Perturbation of optimal parameters\n\nAfter a local minimum is found, the coordinates of that minimum are perturbed and a new local optimization is performed. The method by which that perturbation is made is defined by passing an instance of a subtype of `StepTaker` to the `step_taker` keyword argument of `BasinhoppingParams`. The default perturbation is a uniform random perturbation in every direction in the coordinates, and is specified by the `RandomDisplacement` structure.\n\nTo implement a custom perturbation, create a subtype of `StepTaker` and implement\n* A `take_step!(d::StepTaker, x)` function for that type, where `x` are the coordinates of the current minimum.\n* An `update!(d::StepTaker, nstep::Int, naccept::Int)` function, where `nstep` is the number of local optimisations performed so far and `naccept` is the number of those which were accepted by the acceptance test. This function gets called between iterations and allows one to update the parameters of the step taker dynamically.\n\n## Installation\n\nThe package can be installed with Pkg.add\n```julia\njulia\u003e using Pkg; Pkg.add(\"Basinhopping\")\n```\n\nor through the pkg REPL mode by typing\n```\n] add Basinhopping\n```\n## References\n\n1. Wales, David J. 2003, Energy Landscapes, Cambridge University Press, Cambridge, UK.\n2. Wales, D J, and Doye J P K, Global Optimization by Basin-Hopping and the Lowest Energy Structures of Lennard-Jones Clusters Containing up to 110 Atoms. Journal of Physical Chemistry A, 1997, 101, 5111.\n3. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.basinhopping.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamatos%2Fbasinhopping.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgamatos%2Fbasinhopping.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgamatos%2Fbasinhopping.jl/lists"}