opfunu

A collection of Benchmark functions for numerical optimization problems

https://github.com/thieu1995/opfunu

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary

Keywords

benchmark-functions cec-2005 cec-2008 cec-2010 cec-2013 cec-2014 cec-2015 cec-2017 cec-2019 cec-2020 cec-2021 cec-2022 convex-optimization global-optimization multimodal-functions non-convex-optimization soft-computing unconstrained-optimization unimodal-functions

Keywords from Contributors

mesh sequences genetic-algorithm interactive hacking network-simulation
Last synced: 6 months ago · JSON representation

Repository

A collection of Benchmark functions for numerical optimization problems

Basic Info
Statistics
  • Stars: 154
  • Watchers: 4
  • Forks: 40
  • Open Issues: 7
  • Releases: 24
Topics
benchmark-functions cec-2005 cec-2008 cec-2010 cec-2013 cec-2014 cec-2015 cec-2017 cec-2019 cec-2020 cec-2021 cec-2022 convex-optimization global-optimization multimodal-functions non-convex-optimization soft-computing unconstrained-optimization unimodal-functions
Created about 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

OPFUNU


GitHub release Wheel PyPI version PyPI - Python Version PyPI - Status PyPI - Downloads Downloads Tests & Publishes to PyPI GitHub Release Date Documentation Status Chat Average time to resolve an issue Percentage of issues still open GitHub contributors GitTutorial DOI License: GPL v3

OPFUNU (OPtimization benchmark FUnctions in NUmpy) is the largest python library for cutting-edge numerical optimization benchmark functions. Contains all CEC competition functions from 2005, 2008, 2010, 2013, 2014, 2015, 2017, 2019, 2020, 2021, 2022. Besides, more than 300 traditional functions with different dimensions are implemented.

  • Free software: GNU General Public License (GPL) V3 license
  • Total problems: > 500 problems
  • Documentation: https://opfunu.readthedocs.io
  • Python versions: >= 3.7.x
  • Dependencies: numpy, matplotlib

Citation Request

Please include these citations if you plan to use this library:

  • LaTeX:

bibtex @article{Van_Thieu_2024_Opfunu, author = {Van Thieu, Nguyen}, title = {Opfunu: An Open-source Python Library for Optimization Benchmark Functions}, doi = {10.5334/jors.508}, journal = {Journal of Open Research Software}, month = {May}, year = {2024} }

  • APA:

Van Thieu, N. (2024). Opfunu: An Open-source Python Library for Optimization Benchmark Functions. Journal of Open Research Software, 12(1), 8. https://doi.org/10.5334/jors.508

Installation and Usage

Install with pip

Install the current PyPI release: sh $ pip install opfunu

After installation, you can import and check version of Opfunu:

```sh $ python

import opfunu opfunu.version

dir(opfunu) help(opfunu)

opfunu.FUNCDATABASE # List all namebased functions opfunu.CECDATABASE # List all cecbased functions opfunu.ALL_DATABASE # List all functions in this library

opfunu.getfunctionsbyclassname("MiShra04") opfunu.getfunctionsbasedclassname("2015") opfunu.getfunctionsbyndim(2) opfunu.getfunctionsbasedndim(50)

opfunu.getnamebasedfunctions(ndim=10, continuous=True) opfunu.getcecbasedfunctions(ndim=2) ```

Let's go through some examples.

Examples

How to get the function and use it

1st way

```python from opfunu.cec_based.cec2014 import F12014

func = F12014(ndim=30) func.evaluate(func.create_solution())

or

from opfunu.cec_based import F102014

func = F102014(ndim=50) func.evaluate(func.create_solution()) ```

2nd way

```python import opfunu

funcs = opfunu.getfunctionsbyclassname("F12014") func = funcs0 func.evaluate(func.createsolution())

or

allfuncs2014 = opfunu.getfunctionsbasedclassname("2014") print(allfuncs_2014) ```

How to draw 2D, 3D

Two ways if you want to draw functions that available in Opfunu.

```python from opfunu.cec_based import F12010 f0 = F12010()

Visualize opfunu function using method in object

f0.plot2d(selecteddims=(2, 3), npoints=300, ctcmap="viridis", ctlevels=30, ctalpha=0.7, fixedstrategy="mean", fixedvalues=None, title="Contour map of the F1 CEC 2010 function", xlabel=None, ylabel=None, figsize=(10, 8), filename="2d-f12010", exts=(".png", ".pdf"), verbose=True)

f0.plot3d(selecteddims=(1, 6), npoints=500, ctcmap="viridis", ctlevels=30, ctalpha=0.7, fixedstrategy="mean", fixedvalues=None, title="3D visualization of the F1 CEC 2010 function", xlabel=None, ylabel=None, figsize=(10, 8), filename="3d-f12010", exts=(".png", ".pdf"), verbose=True)

Visualize opfunu function using utility function

from opfunu import draw2d, draw3d

draw2d(f0.evaluate, f0.lb, f0.ub, selecteddims=(2, 3), npoints=300) draw3d(f0.evaluate, f0.lb, f0.ub, selecteddims=(2, 3), npoints=300) ```

F1-2010 CEC 2D

F1-2010 CEC 2D

F1-2010 CEC 3D

F1-2010 CEC 3D

How to draw Latex

Two ways if you want to draw latex equation.

```python from opfunu.cecbased import F12010 from opfunu.namebased import Ackley02 from opfunu.utils.visualize import draw_latex

f0 = F12010() f1 = Ackley02()

Plot using function inside the object

f0.plotlatex(f0.latexformula, figsize=(8, 3), dpi=500, title="Latex equation", exts=(".png", ".pdf"), verbose=True) f1.plotlatex(f1.latexformulaglobaloptimum, figsize=(8, 3), dpi=500, title="Global optimum", verbose=True)

Plot using module

drawlatex(f0.latexformulabounds, title="Boundary for Function") drawlatex(f1.latexformuladimension, title=None) ```

For more usage examples please look at examples folder.

Contributing

There are lots of ways how you can contribute to Permetrics's development, and you are welcome to join in! For example, you can report problems or make feature requests on the issues pages. To facilitate contributions, please check for the guidelines in the CONTRIBUTING.md file.

Official channels


Developed by: Thieu @ 2023

Owner

  • Name: Nguyen Van Thieu
  • Login: thieu1995
  • Kind: user
  • Location: Earth
  • Company: AIIR Group

Knowledge is power, sharing it is the premise of progress in life. It seems like a burden to someone, but it is the only way to achieve immortality.

GitHub Events

Total
  • Issues event: 2
  • Watch event: 32
  • Fork event: 2
Last Year
  • Issues event: 2
  • Watch event: 32
  • Fork event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 484
  • Total Committers: 6
  • Avg Commits per committer: 80.667
  • Development Distribution Score (DDS): 0.033
Past Year
  • Commits: 20
  • Committers: 1
  • Avg Commits per committer: 20.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Thieu Nguyen n****2@g****m 468
Travis Silvers f****d@g****m 9
SkyLull j****2@g****m 3
Thieu Nguyen 1****1 2
mcrimi m****i@g****m 1
dependabot[bot] 4****] 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 22
  • Total pull requests: 16
  • Average time to close issues: 4 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 17
  • Total pull request authors: 8
  • Average comments per issue: 3.36
  • Average comments per pull request: 0.75
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 3
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 0.33
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mpvanderschelling (4)
  • Gang1024 (2)
  • najmehn00 (1)
  • SkyLull (1)
  • JixiangChen-Jimmy (1)
  • plantom007 (1)
  • pooriama (1)
  • Bardbo (1)
  • mlojek (1)
  • guoyuejiang (1)
  • CircuitCM (1)
  • borisalmonacid (1)
  • mrsonandrade (1)
  • cheng12456 (1)
  • RuiZhong961230 (1)
Pull Request Authors
  • firestrand (8)
  • dependabot[bot] (4)
  • SkyLull (3)
  • musicinmybrain (2)
  • mcrimi (1)
  • ElliottP-13 (1)
  • firefly-cpp (1)
  • HaaLeo (1)
Top Labels
Issue Labels
bug (16) enhancement (1)
Pull Request Labels
dependencies (4) github_actions (1)

Packages

  • Total packages: 14
  • Total downloads:
    • pypi 10,168 last-month
  • Total dependent packages: 6
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 52
  • Total maintainers: 2
pypi.org: opfunu

Opfunu: An Open-source Python Library for Optimization Benchmark Functions

  • Versions: 26
  • Dependent Packages: 4
  • Dependent Repositories: 3
  • Downloads: 10,168 Last month
Rankings
Dependent packages count: 2.4%
Downloads: 4.5%
Average: 6.2%
Forks count: 6.8%
Stargazers count: 8.3%
Dependent repos count: 9.0%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.18: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 10.4%
Forks count: 19.6%
Stargazers count: 22.0%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.18: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 10.4%
Forks count: 19.6%
Stargazers count: 22.0%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.17: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 12.7%
Average: 12.8%
Forks count: 17.9%
Stargazers count: 20.4%
Maintainers (1)
Last synced: 6 months ago
alpine-edge: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 14.6%
Average: 14.8%
Forks count: 20.5%
Stargazers count: 24.0%
Maintainers (1)
Last synced: 7 months ago
alpine-edge: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 14.1%
Average: 15.1%
Forks count: 21.5%
Stargazers count: 24.8%
Maintainers (1)
Last synced: 7 months ago
alpine-v3.20: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.21: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.19: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Last synced: 6 months ago
alpine-v3.21: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.20: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 6 months ago
alpine-v3.19: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 6 months ago
alpine-v3.22: py3-opfunu

A collection of Benchmark functions for numerical optimization problems

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 7 months ago
alpine-v3.22: py3-opfunu-pyc

Precompiled Python bytecode for py3-opfunu

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/publish-package.yaml actions
  • actions/cache v1 composite
  • actions/checkout v1 composite
  • actions/download-artifact v2 composite
  • actions/setup-python v1 composite
  • actions/upload-artifact master composite
  • pypa/gh-action-pypi-publish master composite
docs/requirements.txt pypi
  • Pillow >=9.1.0
  • matplotlib >=3.3.0
  • numpy >=1.16.5
  • readthedocs-sphinx-search ==0.3.2
  • requests >=2.27.0
  • sphinx ==4.4.0
  • sphinx_rtd_theme ==1.0.0
requirements.txt pypi
  • Pillow >=9.1.0
  • flake8 >=4.0.1
  • matplotlib >=3.3.0
  • numpy >=1.16.5
  • pytest ==7.1.2
  • pytest-cov ==4.0.0
  • requests >=2.27.0
setup.py pypi
  • numpy >=1.16.5