{"id":21186505,"url":"https://github.com/thieu1995/opfunu","last_synced_at":"2025-04-09T05:11:11.525Z","repository":{"id":37936669,"uuid":"226219815","full_name":"thieu1995/opfunu","owner":"thieu1995","description":"A collection of Benchmark functions for numerical optimization problems","archived":false,"fork":false,"pushed_at":"2024-09-03T22:01:48.000Z","size":21182,"stargazers_count":146,"open_issues_count":7,"forks_count":40,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T04:04:06.171Z","etag":null,"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"],"latest_commit_sha":null,"homepage":"https://opfunu.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thieu1995.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-06T01:21:13.000Z","updated_at":"2025-03-23T13:40:46.000Z","dependencies_parsed_at":"2024-03-22T11:31:40.456Z","dependency_job_id":"47f3d0d6-5123-4f58-80ea-b298770bf576","html_url":"https://github.com/thieu1995/opfunu","commit_stats":{"total_commits":296,"total_committers":3,"mean_commits":98.66666666666667,"dds":"0.010135135135135087","last_synced_commit":"5de9f8110a201a3dbd79fbcc65c031f56bd17f2b"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2Fopfunu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2Fopfunu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2Fopfunu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2Fopfunu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thieu1995","download_url":"https://codeload.github.com/thieu1995/opfunu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"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":["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_at":"2024-11-20T18:24:04.589Z","updated_at":"2025-04-09T05:11:11.504Z","avatar_url":"https://github.com/thieu1995.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\u003cimg src=\".github/img/logo.png\" alt=\"OPFUNU\" title=\"OPFUNU\"/\u003e\u003c/p\u003e\n\n---\n\n\n[![GitHub release](https://img.shields.io/badge/release-1.0.4-yellow.svg)](https://github.com/thieu1995/opfunu/releases)\n[![Wheel](https://img.shields.io/pypi/wheel/gensim.svg)](https://pypi.python.org/pypi/opfunu) \n[![PyPI version](https://badge.fury.io/py/opfunu.svg)](https://badge.fury.io/py/opfunu)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opfunu.svg)\n![PyPI - Status](https://img.shields.io/pypi/status/opfunu.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/opfunu.svg)\n[![Downloads](https://pepy.tech/badge/opfunu)](https://pepy.tech/project/opfunu)\n[![Tests \u0026 Publishes to PyPI](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml/badge.svg)](https://github.com/thieu1995/opfunu/actions/workflows/publish-package.yaml)\n![GitHub Release Date](https://img.shields.io/github/release-date/thieu1995/opfunu.svg)\n[![Documentation Status](https://readthedocs.org/projects/opfunu/badge/?version=latest)](https://opfunu.readthedocs.io/en/latest/?badge=latest)\n[![Chat](https://img.shields.io/badge/Chat-on%20Telegram-blue)](https://t.me/+fRVCJGuGJg1mNDg1)\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/thieu1995/opfunu.svg)](http://isitmaintained.com/project/thieu1995/opfunu \"Percentage of issues still open\")\n![GitHub contributors](https://img.shields.io/github/contributors/thieu1995/opfunu.svg)\n[![GitTutorial](https://img.shields.io/badge/PR-Welcome-%23FF8300.svg?)](https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3620960.svg)](https://doi.org/10.5281/zenodo.3620960)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\nOPFUNU (OPtimization benchmark FUnctions in NUmpy) is the largest python library for cutting-edge numerical \noptimization benchmark functions. Contains all CEC competition functions from 2005, 2008, 2010, 2013, 2014, 2015, \n2017, 2019, 2020, 2021, 2022. Besides, more than 300 traditional functions with different dimensions are implemented.\n\n* **Free software:** GNU General Public License (GPL) V3 license\n* **Total problems**: \u003e 500 problems\n* **Documentation:** https://opfunu.readthedocs.io\n* **Python versions:** \u003e= 3.7.x\n* **Dependencies:** numpy, matplotlib\n\n\n# Citation Request \n\nPlease include these citations if you plan to use this library:\n\n- LaTeX:\n\n```bibtex\n  @article{Van_Thieu_2024_Opfunu,\n      author = {Van Thieu, Nguyen},\n      title = {Opfunu: An Open-source Python Library for Optimization Benchmark Functions},\n      doi = {10.5334/jors.508},\n      journal = {Journal of Open Research Software},\n      month = {May},\n      year = {2024}\n  }\n```\n\n- APA:\n  \n  Van Thieu, N. (2024). Opfunu: An Open-source Python Library for Optimization Benchmark Functions. \u003ci\u003eJournal of Open Research Software\u003c/i\u003e, \u003ci\u003e12\u003c/i\u003e(1), 8. https://doi.org/10.5334/jors.508\n\n\n# Installation and Usage\n\n### Install with pip\n\nInstall the [current PyPI release](https://pypi.python.org/pypi/opfunu):\n```sh\n$ pip install opfunu\n```\n\nAfter installation, you can import and check version of Opfunu:\n\n```sh\n$ python\n\u003e\u003e\u003e import opfunu\n\u003e\u003e\u003e opfunu.__version__\n\n\u003e\u003e\u003e dir(opfunu)\n\u003e\u003e\u003e help(opfunu)\n\n\u003e\u003e\u003e opfunu.FUNC_DATABASE      # List all name_based functions\n\u003e\u003e\u003e opfunu.CEC_DATABASE       # List all cec_based functions\n\u003e\u003e\u003e opfunu.ALL_DATABASE       # List all functions in this library\n\n\u003e\u003e\u003e opfunu.get_functions_by_classname(\"MiShra04\")\n\u003e\u003e\u003e opfunu.get_functions_based_classname(\"2015\")\n\u003e\u003e\u003e opfunu.get_functions_by_ndim(2)\n\u003e\u003e\u003e opfunu.get_functions_based_ndim(50)\n\n\u003e\u003e\u003e opfunu.get_name_based_functions(ndim=10, continuous=True)\n\u003e\u003e\u003e opfunu.get_cec_based_functions(ndim=2)\n```\n\nLet's go through some examples.\n\n\n### Examples\n\nHow to get the function and use it\n\n#### 1st way\n\n```python\nfrom opfunu.cec_based.cec2014 import F12014\n\nfunc = F12014(ndim=30)\nfunc.evaluate(func.create_solution())\n\n## or\n\nfrom opfunu.cec_based import F102014\n\nfunc = F102014(ndim=50)\nfunc.evaluate(func.create_solution())\n```\n\n\n#### 2nd way\n\n```python\nimport opfunu\n\nfuncs = opfunu.get_functions_by_classname(\"F12014\")\nfunc = funcs[0](ndim=10)\nfunc.evaluate(func.create_solution())\n\n## or\n\nall_funcs_2014 = opfunu.get_functions_based_classname(\"2014\")\nprint(all_funcs_2014)\n```\n\n\n### How to draw 2D, 3D \n\nTwo ways if you want to draw functions that available in Opfunu.\n\n```python\nfrom opfunu.cec_based import F12010\nf0 = F12010()\n\n# Visualize opfunu function using method in object\nf0.plot_2d(selected_dims=(2, 3), n_points=300, ct_cmap=\"viridis\", ct_levels=30, ct_alpha=0.7,\n           fixed_strategy=\"mean\", fixed_values=None, title=\"Contour map of the F1 CEC 2010 function\",\n           x_label=None, y_label=None, figsize=(10, 8), filename=\"2d-f12010\", exts=(\".png\", \".pdf\"), verbose=True)\n\nf0.plot_3d(selected_dims=(1, 6), n_points=500, ct_cmap=\"viridis\", ct_levels=30, ct_alpha=0.7,\n           fixed_strategy=\"mean\", fixed_values=None, title=\"3D visualization of the F1 CEC 2010 function\",\n           x_label=None, y_label=None, figsize=(10, 8), filename=\"3d-f12010\", exts=(\".png\", \".pdf\"), verbose=True)\n\n## Visualize opfunu function using utility function\nfrom opfunu import draw_2d, draw_3d\n\ndraw_2d(f0.evaluate, f0.lb, f0.ub, selected_dims=(2, 3), n_points=300)\ndraw_3d(f0.evaluate, f0.lb, f0.ub, selected_dims=(2, 3), n_points=300)\n```\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"text-align: center;\"\u003e\n      \u003cimg src=\".github/img/2d-f12010.png\" alt=\"F1-2010 CEC 2D\" style=\"width: 100%;\"\u003e\n      \u003cp style=\"text-align: center;\"\u003eF1-2010 CEC 2D\u003c/p\u003e\n    \u003c/td\u003e\n    \u003ctd style=\"text-align: center;\"\u003e\n      \u003cimg src=\".github/img/3d-f12010.png\" alt=\"F1-2010 CEC 3D\" style=\"width: 100%;\"\u003e\n    \u003cp style=\"text-align: center;\"\u003eF1-2010 CEC 3D\u003c/p\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### How to draw Latex\n\nTwo ways if you want to draw latex equation. \n\n```python\nfrom opfunu.cec_based import F12010\nfrom opfunu.name_based import Ackley02\nfrom opfunu.utils.visualize import draw_latex\n\nf0 = F12010()\nf1 = Ackley02()\n\n## Plot using function inside the object\nf0.plot_latex(f0.latex_formula, figsize=(8, 3), dpi=500, title=\"Latex equation\", exts=(\".png\", \".pdf\"), verbose=True)\nf1.plot_latex(f1.latex_formula_global_optimum, figsize=(8, 3), dpi=500, title=\"Global optimum\", verbose=True)\n\n## Plot using module\ndraw_latex(f0.latex_formula_bounds, title=\"Boundary for Function\")\ndraw_latex(f1.latex_formula_dimension, title=None)\n```\n\n\n\nFor more usage examples please look at [examples](/examples) folder.\n\n\n\n# Contributing\n\nThere are lots of ways how you can contribute to Permetrics's development, and you are welcome to join in! For example, \nyou can report problems or make feature requests on the [issues](/issues) pages. To facilitate contributions, \nplease check for the guidelines in the [CONTRIBUTING.md](/CONTRIBUTING.md) file.\n\n\n# Official channels \n\n* [Official source code repository](https://github.com/thieu1995/opfunu)\n* [Official document](https://opfunu.readthedocs.io/)\n* [Download releases](https://pypi.org/project/opfunu/) \n* [Issue tracker](https://github.com/thieu1995/opfunu/issues) \n* [Notable changes log](/ChangeLog.md)\n* [Official discussion group](https://t.me/+fRVCJGuGJg1mNDg1)\n\n\n---\n\nDeveloped by: [Thieu](mailto:nguyenthieu2102@gmail.com?Subject=Opfunu_QUESTIONS) @ 2023\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fopfunu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthieu1995%2Fopfunu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fopfunu/lists"}