choccy 0.0.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- choccy-0.0.9/LICENSE +127 -0
- choccy-0.0.9/PKG-INFO +452 -0
- choccy-0.0.9/README.md +414 -0
- choccy-0.0.9/choccy/__init__.py +20 -0
- choccy-0.0.9/choccy/algorithms/__init__.py +12 -0
- choccy-0.0.9/choccy/algorithms/algorithm.py +953 -0
- choccy-0.0.9/choccy/algorithms/comparator.py +389 -0
- choccy-0.0.9/choccy/algorithms/evaluator.py +636 -0
- choccy-0.0.9/choccy/algorithms/multi/CCMO/__init__.py +0 -0
- choccy-0.0.9/choccy/algorithms/multi/MOEAD/MOEAD.py +126 -0
- choccy-0.0.9/choccy/algorithms/multi/MOEAD/__init__.py +8 -0
- choccy-0.0.9/choccy/algorithms/multi/NNDREA/NNDREA.py +204 -0
- choccy-0.0.9/choccy/algorithms/multi/NNDREA/__init__.py +8 -0
- choccy-0.0.9/choccy/algorithms/multi/NSGA/NSGAII.py +52 -0
- choccy-0.0.9/choccy/algorithms/multi/NSGA/NSGAIII.py +0 -0
- choccy-0.0.9/choccy/algorithms/multi/NSGA/__init__.py +8 -0
- choccy-0.0.9/choccy/algorithms/multi/SPEA/SPEA2.py +124 -0
- choccy-0.0.9/choccy/algorithms/multi/SPEA/__init__.py +8 -0
- choccy-0.0.9/choccy/algorithms/multi/SparseEA/__init__.py +0 -0
- choccy-0.0.9/choccy/algorithms/multi/__init__.py +11 -0
- choccy-0.0.9/choccy/algorithms/single/ACO/ACO.py +165 -0
- choccy-0.0.9/choccy/algorithms/single/ACO/ACOR.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/ACO/__init__.py +17 -0
- choccy-0.0.9/choccy/algorithms/single/DE/DE.py +195 -0
- choccy-0.0.9/choccy/algorithms/single/DE/JADE.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/DE/SHADE.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/DE/__init__.py +14 -0
- choccy-0.0.9/choccy/algorithms/single/DP/DP_KP.py +75 -0
- choccy-0.0.9/choccy/algorithms/single/DP/__init__.py +13 -0
- choccy-0.0.9/choccy/algorithms/single/ES/CMAES.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/ES/__init__.py +7 -0
- choccy-0.0.9/choccy/algorithms/single/GA/GA.py +36 -0
- choccy-0.0.9/choccy/algorithms/single/GA/__init__.py +14 -0
- choccy-0.0.9/choccy/algorithms/single/GD/Adam.py +54 -0
- choccy-0.0.9/choccy/algorithms/single/GD/GD.py +32 -0
- choccy-0.0.9/choccy/algorithms/single/GD/__init__.py +15 -0
- choccy-0.0.9/choccy/algorithms/single/GH/FarthestInsertion.py +79 -0
- choccy-0.0.9/choccy/algorithms/single/GH/Greedy_KP.py +54 -0
- choccy-0.0.9/choccy/algorithms/single/GH/Greedy_TSP.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/GH/__init__.py +10 -0
- choccy-0.0.9/choccy/algorithms/single/HGA/HGA_TSP.py +73 -0
- choccy-0.0.9/choccy/algorithms/single/HGA/__init__.py +9 -0
- choccy-0.0.9/choccy/algorithms/single/LS/GFLS_TSP.py +103 -0
- choccy-0.0.9/choccy/algorithms/single/LS/LS_TSP.py +58 -0
- choccy-0.0.9/choccy/algorithms/single/LS/__init__.py +20 -0
- choccy-0.0.9/choccy/algorithms/single/NS/LNS.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/NS/__init__.py +0 -0
- choccy-0.0.9/choccy/algorithms/single/PSO/BPSO.py +126 -0
- choccy-0.0.9/choccy/algorithms/single/PSO/PSO.py +124 -0
- choccy-0.0.9/choccy/algorithms/single/PSO/__init__.py +15 -0
- choccy-0.0.9/choccy/algorithms/single/SA/SA.py +151 -0
- choccy-0.0.9/choccy/algorithms/single/SA/__init__.py +16 -0
- choccy-0.0.9/choccy/algorithms/single/__init__.py +17 -0
- choccy-0.0.9/choccy/core.py +160 -0
- choccy-0.0.9/choccy/problems/__init__.py +10 -0
- choccy-0.0.9/choccy/problems/multi/DTLZ/DTLZ1.py +43 -0
- choccy-0.0.9/choccy/problems/multi/DTLZ/DTLZ2.py +45 -0
- choccy-0.0.9/choccy/problems/multi/DTLZ/__init__.py +9 -0
- choccy-0.0.9/choccy/problems/multi/MOKP/MOKP.py +76 -0
- choccy-0.0.9/choccy/problems/multi/MOKP/__init__.py +8 -0
- choccy-0.0.9/choccy/problems/multi/MOP/MOP1.py +35 -0
- choccy-0.0.9/choccy/problems/multi/MOP/MOP2.py +25 -0
- choccy-0.0.9/choccy/problems/multi/MOP/__init__.py +9 -0
- choccy-0.0.9/choccy/problems/multi/ZDT/ZDT1.py +36 -0
- choccy-0.0.9/choccy/problems/multi/ZDT/ZDT2.py +36 -0
- choccy-0.0.9/choccy/problems/multi/ZDT/ZDT3.py +44 -0
- choccy-0.0.9/choccy/problems/multi/ZDT/__init__.py +10 -0
- choccy-0.0.9/choccy/problems/multi/__init__.py +11 -0
- choccy-0.0.9/choccy/problems/problem.py +650 -0
- choccy-0.0.9/choccy/problems/single/KP/BinaryKP.py +70 -0
- choccy-0.0.9/choccy/problems/single/KP/RepeatKP.py +0 -0
- choccy-0.0.9/choccy/problems/single/KP/__init__.py +8 -0
- choccy-0.0.9/choccy/problems/single/MIP/MIP_Ackley.py +29 -0
- choccy-0.0.9/choccy/problems/single/MIP/MIP_Rastrigin.py +28 -0
- choccy-0.0.9/choccy/problems/single/MIP/__init__.py +9 -0
- choccy-0.0.9/choccy/problems/single/ML/Classification.py +90 -0
- choccy-0.0.9/choccy/problems/single/ML/Clustering.py +115 -0
- choccy-0.0.9/choccy/problems/single/ML/FixedSizeCluster.py +59 -0
- choccy-0.0.9/choccy/problems/single/ML/Regression.py +94 -0
- choccy-0.0.9/choccy/problems/single/ML/__init__.py +11 -0
- choccy-0.0.9/choccy/problems/single/QP/ConvexQP.py +0 -0
- choccy-0.0.9/choccy/problems/single/QP/NonconvexQP.py +0 -0
- choccy-0.0.9/choccy/problems/single/QP/SphereQP.py +28 -0
- choccy-0.0.9/choccy/problems/single/QP/__init__.py +8 -0
- choccy-0.0.9/choccy/problems/single/SOP/Ackley.py +28 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP1.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP10.py +28 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP2.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP3.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP4.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP5.py +27 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP6.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP7.py +27 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP8.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/SOP9.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/Sphere.py +26 -0
- choccy-0.0.9/choccy/problems/single/SOP/__init__.py +38 -0
- choccy-0.0.9/choccy/problems/single/TSP/ATSP.py +0 -0
- choccy-0.0.9/choccy/problems/single/TSP/TSP.py +120 -0
- choccy-0.0.9/choccy/problems/single/TSP/__init__.py +8 -0
- choccy-0.0.9/choccy/problems/single/__init__.py +16 -0
- choccy-0.0.9/choccy/solutions/__init__.py +8 -0
- choccy-0.0.9/choccy/solutions/solutions.py +1188 -0
- choccy-0.0.9/choccy/types.py +204 -0
- choccy-0.0.9/choccy/utilities/__init__.py +6 -0
- choccy-0.0.9/choccy/utilities/commons/__init__.py +31 -0
- choccy-0.0.9/choccy/utilities/commons/activation.py +32 -0
- choccy-0.0.9/choccy/utilities/commons/aggregation.py +51 -0
- choccy-0.0.9/choccy/utilities/commons/constraints.py +51 -0
- choccy-0.0.9/choccy/utilities/commons/decomposition.py +25 -0
- choccy-0.0.9/choccy/utilities/commons/reference.py +6 -0
- choccy-0.0.9/choccy/utilities/commons/sampling.py +40 -0
- choccy-0.0.9/choccy/utilities/commons/sorting.py +259 -0
- choccy-0.0.9/choccy/utilities/handler/__init__.py +21 -0
- choccy-0.0.9/choccy/utilities/handler/converters.py +15 -0
- choccy-0.0.9/choccy/utilities/handler/formatter.py +139 -0
- choccy-0.0.9/choccy/utilities/handler/loaders.py +223 -0
- choccy-0.0.9/choccy/utilities/handler/savers.py +186 -0
- choccy-0.0.9/choccy/utilities/logging/__init__.py +12 -0
- choccy-0.0.9/choccy/utilities/logging/logger.py +132 -0
- choccy-0.0.9/choccy/utilities/metrics/__init__.py +17 -0
- choccy-0.0.9/choccy/utilities/metrics/convergence.py +106 -0
- choccy-0.0.9/choccy/utilities/metrics/diversity.py +6 -0
- choccy-0.0.9/choccy/utilities/metrics/hypervolume.py +449 -0
- choccy-0.0.9/choccy/utilities/strategies/__init__.py +29 -0
- choccy-0.0.9/choccy/utilities/strategies/crossovers.py +356 -0
- choccy-0.0.9/choccy/utilities/strategies/educations.py +26 -0
- choccy-0.0.9/choccy/utilities/strategies/mutations.py +158 -0
- choccy-0.0.9/choccy/utilities/strategies/operators.py +309 -0
- choccy-0.0.9/choccy/utilities/strategies/perturbers.py +169 -0
- choccy-0.0.9/choccy/utilities/strategies/searching.py +491 -0
- choccy-0.0.9/choccy/utilities/strategies/selections.py +61 -0
- choccy-0.0.9/choccy/utilities/visualization/__init__.py +26 -0
- choccy-0.0.9/choccy/utilities/visualization/animator.py +826 -0
- choccy-0.0.9/choccy/utilities/visualization/colormap.py +33 -0
- choccy-0.0.9/choccy/utilities/visualization/comparison.py +318 -0
- choccy-0.0.9/choccy/utilities/visualization/convergence.py +104 -0
- choccy-0.0.9/choccy/utilities/visualization/decisions.py +97 -0
- choccy-0.0.9/choccy/utilities/visualization/hybrids.py +265 -0
- choccy-0.0.9/choccy/utilities/visualization/objectives.py +148 -0
- choccy-0.0.9/choccy.egg-info/PKG-INFO +452 -0
- choccy-0.0.9/choccy.egg-info/SOURCES.txt +145 -0
- choccy-0.0.9/choccy.egg-info/dependency_links.txt +1 -0
- choccy-0.0.9/choccy.egg-info/requires.txt +18 -0
- choccy-0.0.9/choccy.egg-info/top_level.txt +1 -0
- choccy-0.0.9/pyproject.toml +72 -0
- choccy-0.0.9/setup.cfg +4 -0
choccy-0.0.9/LICENSE
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
木兰宽松许可证, 第2版
|
|
2
|
+
|
|
3
|
+
木兰宽松许可证, 第2版
|
|
4
|
+
2020年1月 http://license.coscl.org.cn/MulanPSL2
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束:
|
|
8
|
+
|
|
9
|
+
0. 定义
|
|
10
|
+
|
|
11
|
+
“软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
|
|
12
|
+
|
|
13
|
+
“贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
|
|
14
|
+
|
|
15
|
+
“贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
|
|
16
|
+
|
|
17
|
+
“法人实体”是指提交贡献的机构及其“关联实体”。
|
|
18
|
+
|
|
19
|
+
“关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
|
|
20
|
+
|
|
21
|
+
1. 授予版权许可
|
|
22
|
+
|
|
23
|
+
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。
|
|
24
|
+
|
|
25
|
+
2. 授予专利许可
|
|
26
|
+
|
|
27
|
+
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。
|
|
28
|
+
|
|
29
|
+
3. 无商标许可
|
|
30
|
+
|
|
31
|
+
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。
|
|
32
|
+
|
|
33
|
+
4. 分发限制
|
|
34
|
+
|
|
35
|
+
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
|
|
36
|
+
|
|
37
|
+
5. 免责声明与责任限制
|
|
38
|
+
|
|
39
|
+
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。
|
|
40
|
+
|
|
41
|
+
6. 语言
|
|
42
|
+
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。
|
|
43
|
+
|
|
44
|
+
条款结束
|
|
45
|
+
|
|
46
|
+
如何将木兰宽松许可证,第2版,应用到您的软件
|
|
47
|
+
|
|
48
|
+
如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步:
|
|
49
|
+
|
|
50
|
+
1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
|
|
51
|
+
|
|
52
|
+
2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中;
|
|
53
|
+
|
|
54
|
+
3, 请将如下声明文本放入每个源文件的头部注释中。
|
|
55
|
+
|
|
56
|
+
Copyright (c) 2024 LuChen Wang
|
|
57
|
+
CHOCCY is licensed under Mulan PSL v2.
|
|
58
|
+
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
59
|
+
You may obtain a copy of Mulan PSL v2 at:
|
|
60
|
+
http://license.coscl.org.cn/MulanPSL2
|
|
61
|
+
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
62
|
+
See the Mulan PSL v2 for more details.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
Mulan Permissive Software License,Version 2
|
|
66
|
+
|
|
67
|
+
Mulan Permissive Software License,Version 2 (Mulan PSL v2)
|
|
68
|
+
January 2020 http://license.coscl.org.cn/MulanPSL2
|
|
69
|
+
|
|
70
|
+
Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions:
|
|
71
|
+
|
|
72
|
+
0. Definition
|
|
73
|
+
|
|
74
|
+
Software means the program and related documents which are licensed under this License and comprise all Contribution(s).
|
|
75
|
+
|
|
76
|
+
Contribution means the copyrightable work licensed by a particular Contributor under this License.
|
|
77
|
+
|
|
78
|
+
Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License.
|
|
79
|
+
|
|
80
|
+
Legal Entity means the entity making a Contribution and all its Affiliates.
|
|
81
|
+
|
|
82
|
+
Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity.
|
|
83
|
+
|
|
84
|
+
1. Grant of Copyright License
|
|
85
|
+
|
|
86
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not.
|
|
87
|
+
|
|
88
|
+
2. Grant of Patent License
|
|
89
|
+
|
|
90
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken.
|
|
91
|
+
|
|
92
|
+
3. No Trademark License
|
|
93
|
+
|
|
94
|
+
No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4.
|
|
95
|
+
|
|
96
|
+
4. Distribution Restriction
|
|
97
|
+
|
|
98
|
+
You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software.
|
|
99
|
+
|
|
100
|
+
5. Disclaimer of Warranty and Limitation of Liability
|
|
101
|
+
|
|
102
|
+
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
103
|
+
|
|
104
|
+
6. Language
|
|
105
|
+
|
|
106
|
+
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL.
|
|
107
|
+
|
|
108
|
+
END OF THE TERMS AND CONDITIONS
|
|
109
|
+
|
|
110
|
+
How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software
|
|
111
|
+
|
|
112
|
+
To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps:
|
|
113
|
+
|
|
114
|
+
i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner;
|
|
115
|
+
|
|
116
|
+
ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package;
|
|
117
|
+
|
|
118
|
+
iii Attach the statement to the appropriate annotated syntax at the beginning of each source file.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
Copyright (c) 2024 LuChen Wang
|
|
122
|
+
choccy is licensed under Mulan PSL v2.
|
|
123
|
+
You can use this software according to the terms and conditions of the Mulan PSL v2.
|
|
124
|
+
You may obtain a copy of Mulan PSL v2 at:
|
|
125
|
+
http://license.coscl.org.cn/MulanPSL2
|
|
126
|
+
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
|
127
|
+
See the Mulan PSL v2 for more details.
|
choccy-0.0.9/PKG-INFO
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: choccy
|
|
3
|
+
Version: 0.0.9
|
|
4
|
+
Summary: Chen's Heuristic Optimizer Constructed with Core numpY:
|
|
5
|
+
Author-email: LuChen Wang <wangluchen567@qq.com>
|
|
6
|
+
License: MulanPSL-2.0
|
|
7
|
+
Project-URL: Homepage, https://gitee.com/wang567/CHOCCY
|
|
8
|
+
Project-URL: Issues, https://gitee.com/wang567/CHOCCY/issues
|
|
9
|
+
Project-URL: Changelog, https://gitee.com/wang567/CHOCCY/releases
|
|
10
|
+
Project-URL: Mirror (GitHub), https://github.com/wangluchen567/CHOCCY
|
|
11
|
+
Project-URL: Mirror-Issues, https://github.com/wangluchen567/CHOCCY/issues
|
|
12
|
+
Keywords: genetic-algorithm,evolutionary-algorithms,multi-objective-optimization,heuristic-algorithm,metaheuristic-algorithms
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Mulan Permissive Software License v2 (MulanPSL-2.0)
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: numpy>=1.23.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
28
|
+
Requires-Dist: scipy>=1.8.0
|
|
29
|
+
Requires-Dist: seaborn>=0.12
|
|
30
|
+
Requires-Dist: tqdm>=4.65
|
|
31
|
+
Requires-Dist: networkx>=3.0
|
|
32
|
+
Requires-Dist: numba>=0.57.0; extra != "cpu-only" and extra != "no-numba"
|
|
33
|
+
Requires-Dist: tbb>=2021.0; extra != "cpu-only" and extra != "no-tbb" and extra != "no-numba"
|
|
34
|
+
Provides-Extra: cpu-only
|
|
35
|
+
Provides-Extra: no-numba
|
|
36
|
+
Provides-Extra: no-tbb
|
|
37
|
+
Dynamic: license-file
|
|
38
|
+
|
|
39
|
+
# 🍪 CHOCCY
|
|
40
|
+
|
|
41
|
+
基于NumPy构建的启发式优化求解器<br>
|
|
42
|
+
Chen's Heuristic Optimizer Constructed with Core numpY
|
|
43
|
+
|
|
44
|
+
## 🔖 项目简介
|
|
45
|
+
|
|
46
|
+
本项目是一个完全免费且开源的启发式优化求解器,致力于打造一个简单易用、绘图功能丰富、便于算法分析且扩展性强的优化框架。
|
|
47
|
+
本项目提供了大量启发式/元启发式算法的实现细节,支持对`实数`、`整数`、`序列`、`(固定)标签`以及`混合`类型问题的优化,
|
|
48
|
+
旨在为对优化领域感兴趣的伙伴们提供易于理解的算法学习资源和有力的研究支持💪。
|
|
49
|
+
|
|
50
|
+
另外,本项目希望为学习、竞赛和科研等领域的伙伴提供高效易用的优化工具。
|
|
51
|
+
无论是初学者还是资深研究者,都能借助它快速设计和优化问题,并获得满意结果。
|
|
52
|
+
同时,不错的可视化功能可将结果转化为直观图表,方便用于论文撰写和报告制作,助力在学术与实践中取得优异成果🎉。
|
|
53
|
+
|
|
54
|
+
本项目采用 **木兰宽松许可证第2版(Mulan PSL v2)** 开源,允许学习、竞赛、科研及**商业用途**在内的各种使用场景。
|
|
55
|
+
|
|
56
|
+
> 📌 **使用说明**:使用本项目时,请保留原始版权声明,并在核心代码复用或引用时注明出处。
|
|
57
|
+
|
|
58
|
+
## 🌟 主要特性
|
|
59
|
+
|
|
60
|
+
- 🌍 支持多种`启发式`和`元启发式`优化算法,适用于广泛的问题类型求解
|
|
61
|
+
- 🚀 支持对多种问题的优化,包括但不限于`实数`、`整数`、`序列`、`(固定)标签`问题
|
|
62
|
+
- 🧩 支持对混合问题的优化,即问题的不同部分可以是不同类型的“混合”问题
|
|
63
|
+
- 🛠️ 提供了丰富的性能评估指标和优化算子及函数,可扩展性强
|
|
64
|
+
- 📉 支持对多种算法的实时优化比较,并提供丰富的可视化功能
|
|
65
|
+
- 📊 支持多种算法对多类问题的优化和求解,并对结果进行比较和可视化
|
|
66
|
+
- ⚡ 使用矩阵操作和`numba`的即时编译对核心部分进行优化,显著提高优化速度
|
|
67
|
+
|
|
68
|
+
## 🎯 实现算法
|
|
69
|
+
|
|
70
|
+
- 🧬 遗传(进化)算法
|
|
71
|
+
- 🔥 模拟退火算法
|
|
72
|
+
- 🔗 差分进化算法
|
|
73
|
+
- 🐜 蚁群优化算法
|
|
74
|
+
- 🌟 粒子群优化算法
|
|
75
|
+
- ⚖️ 多目标优化算法
|
|
76
|
+
- 📉 梯度下降优化算法
|
|
77
|
+
- 🔍 局部搜索相关算法
|
|
78
|
+
- 🚚 路由优化相关算法
|
|
79
|
+
- 📝 其他参见[实现清单](https://gitee.com/wang567/CHOCCY/blob/master/docs/IMPLES.md)
|
|
80
|
+
|
|
81
|
+
## 📚 安装教程
|
|
82
|
+
|
|
83
|
+
**详细的安装与使用教程请参见[使用指南](https://gitee.com/wang567/CHOCCY/blob/master/docs/GUIDE.md)** 🔥🔥🔥
|
|
84
|
+
|
|
85
|
+
### 1. 使用 pip 安装(推荐)
|
|
86
|
+
|
|
87
|
+
直接安装完整版本(包含 numba 加速):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install choccy
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
如果遇到 numba 相关的报错,或希望安装无 numba 加速的版本:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
pip install choccy[no-numba]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
如果 tbb 加速不适配当前系统:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
pip install choccy[no-tbb]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
> 💡 **提示**:以上三种安装方式可根据实际情况选择其一。
|
|
106
|
+
|
|
107
|
+
### 2. 从 whl 文件安装
|
|
108
|
+
|
|
109
|
+
从 [Releases 页面](https://gitee.com/wang567/CHOCCY/releases) 下载对应版本的 `.whl` 文件,切换到文件所在目录后执行(以 0.1.0 版本为例):
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install choccy-0.1.0-py3-none-any.whl
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 3. 本地源码运行(适用于开发或调试)
|
|
116
|
+
|
|
117
|
+
如果不希望安装,可以直接下载项目源码进行本地运行和测试。
|
|
118
|
+
|
|
119
|
+
#### 3.1 使用 Conda 创建虚拟环境(推荐)
|
|
120
|
+
|
|
121
|
+
建议使用 Anaconda 创建独立的 Python 环境,便于管理依赖包、避免版本冲突。
|
|
122
|
+
|
|
123
|
+
- 从 [Anaconda 官网](https://www.anaconda.com/download/success) 下载并安装
|
|
124
|
+
- 如需特定版本,可访问 [历史版本下载地址](https://repo.anaconda.com/archive/)
|
|
125
|
+
|
|
126
|
+
创建并激活环境:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
conda create --name choccy_env python=3.9
|
|
130
|
+
conda activate choccy_env
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
> 📌 **注意**:本项目支持 Python 3.7 及以上版本,推荐使用 Python 3.9 以获得最佳兼容性。
|
|
134
|
+
|
|
135
|
+
#### 3.2 安装必需依赖
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install numpy scipy matplotlib seaborn tqdm networkx
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### 3.3 安装可选加速依赖(建议)
|
|
142
|
+
|
|
143
|
+
为了获得更快的优化速度,建议安装 numba 和 tbb:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
pip install numba tbb
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
#### 3.4 使用国内镜像源加速下载(可选)
|
|
150
|
+
|
|
151
|
+
如果下载速度较慢,可尝试使用清华大学镜像源:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pip install numpy scipy matplotlib seaborn tqdm networkx numba tbb -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## 📦 项目结构
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
CHOCCY/
|
|
161
|
+
├── choccy/ # 优化求解器核心库(pip 安装内容)
|
|
162
|
+
│ ├── algorithms/ # 算法模块
|
|
163
|
+
│ │ ├── multi/ # 多目标优化算法
|
|
164
|
+
│ │ ├── single/ # 单目标优化算法
|
|
165
|
+
│ │ ├── algorithm.py # 算法基类
|
|
166
|
+
│ │ ├── comparator.py # 单问题多算法比较器
|
|
167
|
+
│ │ └── evaluator.py # 多问题多算法评估器
|
|
168
|
+
│ ├── problems/ # 问题模块
|
|
169
|
+
│ │ ├── multi/ # 多目标优化问题
|
|
170
|
+
│ │ ├── single/ # 单目标优化问题
|
|
171
|
+
│ │ └── problem.py # 问题基类
|
|
172
|
+
│ ├── solutions/ # 解集模块
|
|
173
|
+
│ │ └── solutions.py # 解集基类
|
|
174
|
+
│ ├── utilities/ # 工具模块
|
|
175
|
+
│ │ ├── commons/ # 公共组件
|
|
176
|
+
│ │ ├── handler/ # 数据处理
|
|
177
|
+
│ │ ├── logging/ # 日志处理
|
|
178
|
+
│ │ ├── metrics/ # 性能指标计算
|
|
179
|
+
│ │ ├── strategies/ # 策略函数集
|
|
180
|
+
│ │ └── visualization/ # 可视化绘图
|
|
181
|
+
│ ├── core.py # 核心接口
|
|
182
|
+
│ └── types.py # 枚举类型定义
|
|
183
|
+
│
|
|
184
|
+
├── demos/ # 演示程序(需克隆运行)
|
|
185
|
+
├── docs/ # 项目文档
|
|
186
|
+
│ └── images/ # 文档图片资源(动图/截图)
|
|
187
|
+
├── examples/ # 示例代码(需克隆运行)
|
|
188
|
+
│ ├── multi/ # 多目标优化示例
|
|
189
|
+
│ ├── single/ # 单目标优化示例
|
|
190
|
+
│ ├── start.py # 快速开始示例
|
|
191
|
+
│ └── vectorized.py # 向量化计算示例
|
|
192
|
+
├── tests/ # 单元测试与集成测试
|
|
193
|
+
│
|
|
194
|
+
├── pyproject.toml # 项目配置(构建依赖、工具配置)
|
|
195
|
+
└── README.md # 项目说明文档(用户入口)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> 📌 **目录说明**:
|
|
199
|
+
> - `choccy/`:核心库,**会随 `pip install choccy` 一同安装**
|
|
200
|
+
> - `examples/`、`demos/`、`tests/`:辅助资源,**仅存在于源码仓库中**(需 `git clone`)
|
|
201
|
+
> - `docs/images/`:文档图片资源,用于 README 中的效果展示
|
|
202
|
+
|
|
203
|
+
> 📚 **支持的算法与问题集**:完整的算法列表和测试问题清单,请参阅 [实现清单](https://gitee.com/wang567/CHOCCY/blob/master/docs/IMPLES.md)
|
|
204
|
+
|
|
205
|
+
> **✨ PS: 项目中包含本人研究工作** <br>
|
|
206
|
+
> Neural Network-Based Dimensionality Reduction for Large-Scale Binary Optimization with Millions of Variables (NNDREA), IEEE Transactions on Evolutionary Computation <br>
|
|
207
|
+
> 原文下载地址:[IEEE xplore](https://ieeexplore.ieee.org/abstract/document/10530207) / [ResearchGate](https://www.researchgate.net/publication/380393707_Neural_Network-Based_Dimensionality_Reduction_for_Large-Scale_Binary_Optimization_with_Millions_of_Variables#:~:text=In%20this%20paper,%20we%20propose%20a%20dimensionality%20reduction%20method%20to) (免费下载)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## 🚀 快速开始
|
|
211
|
+
|
|
212
|
+
### 算法求解自定义问题
|
|
213
|
+
|
|
214
|
+
#### 基础用法:单个计算
|
|
215
|
+
|
|
216
|
+
对于简单的小规模问题,可以直接定义单个计算的目标函数:
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
import numpy as np
|
|
220
|
+
from choccy.algorithms.single import DE
|
|
221
|
+
from choccy.problems import Problem, create_problem
|
|
222
|
+
|
|
223
|
+
# 定义目标函数(接收单个解,返回目标值)
|
|
224
|
+
def calc_sphere_obj(x):
|
|
225
|
+
return np.sum(x ** 2)
|
|
226
|
+
|
|
227
|
+
# 创建问题实例
|
|
228
|
+
problem = create_problem(
|
|
229
|
+
calc_obj=calc_sphere_obj, # 目标函数(单个计算)
|
|
230
|
+
var_types=Problem.REAL, # 决策变量类型:实数
|
|
231
|
+
n_vars=2, # 决策变量个数
|
|
232
|
+
n_objs=1, # 目标个数
|
|
233
|
+
l_bounds=-100, # 变量下界
|
|
234
|
+
u_bounds=100 # 变量上界
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
# 定义并初始化算法
|
|
238
|
+
algorithm = DE(n_sols=50, max_iter=100, visual_mode='log')
|
|
239
|
+
# 使用算法优化问题
|
|
240
|
+
algorithm.optimize(problem)
|
|
241
|
+
# 报告优化结果信息
|
|
242
|
+
algorithm.report_result()
|
|
243
|
+
```
|
|
244
|
+
输出结果(日志部分已省略):
|
|
245
|
+
```
|
|
246
|
+
[DE] Iter: 000/100 | Obj: 2.272870e+01 | Feas: 100.0 % | Time: 0.000 s
|
|
247
|
+
[DE] Iter: 001/100 | Obj: 2.272870e+01 | Feas: 100.0 % | Time: 0.001 s
|
|
248
|
+
...
|
|
249
|
+
[DE] Iter: 099/100 | Obj: 1.295769e-20 | Feas: 100.0 % | Time: 0.033 s
|
|
250
|
+
[DE] Iter: 100/100 | Obj: 1.295769e-20 | Feas: 100.0 % | Time: 0.033 s
|
|
251
|
+
|
|
252
|
+
==================================================================
|
|
253
|
+
OPTIMIZATION RESULT - DE
|
|
254
|
+
==================================================================
|
|
255
|
+
Iterations: 100
|
|
256
|
+
Runtime: 0.032571 s
|
|
257
|
+
Number of Bests: 1
|
|
258
|
+
Best Objectives: 1.295769e-20
|
|
259
|
+
Best Constraints: N/A
|
|
260
|
+
Best Decision Variables:
|
|
261
|
+
[1.02604155e-10 4.92958320e-11]
|
|
262
|
+
==================================================================
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### 进阶用法:向量化计算(推荐)
|
|
266
|
+
|
|
267
|
+
对于大规模或高维问题,建议使用向量化方式批量计算,能显著提升优化效率:
|
|
268
|
+
|
|
269
|
+
```python
|
|
270
|
+
import numpy as np
|
|
271
|
+
from choccy.algorithms.single import DE
|
|
272
|
+
from choccy.problems import Problem, create_problem
|
|
273
|
+
|
|
274
|
+
# 定义目标函数(接收解矩阵,批量返回目标值向量)
|
|
275
|
+
def calc_rastrigin_objs(xs):
|
|
276
|
+
# xs 形状为 (n_solutions, n_vars)
|
|
277
|
+
# 返回形状为 (n_solutions,) 或 (n_solutions, 1)
|
|
278
|
+
return np.sum(xs ** 2 - 10 * np.cos(2 * np.pi * xs) + 10, axis=1)
|
|
279
|
+
|
|
280
|
+
# 创建问题实例
|
|
281
|
+
problem = create_problem(
|
|
282
|
+
calc_objs_mat=calc_rastrigin_objs, # 向量化目标函数(批量计算)
|
|
283
|
+
var_types=Problem.REAL, # 决策变量类型:实数
|
|
284
|
+
n_vars=2, # 决策变量个数
|
|
285
|
+
n_objs=1, # 目标个数
|
|
286
|
+
l_bounds=-10, # 变量下界
|
|
287
|
+
u_bounds=10 # 变量上界
|
|
288
|
+
)
|
|
289
|
+
# 定义并初始化算法
|
|
290
|
+
algorithm = DE(n_sols=50, max_iter=100, visual_mode='log')
|
|
291
|
+
# 使用算法优化问题
|
|
292
|
+
algorithm.optimize(problem)
|
|
293
|
+
# 报告优化结果信息
|
|
294
|
+
algorithm.report_result()
|
|
295
|
+
```
|
|
296
|
+
输出结果(日志部分已省略):
|
|
297
|
+
```
|
|
298
|
+
[DE] Iter: 000/100 | Obj: 1.729376e+01 | Feas: 100.0 % | Time: 0.000 s
|
|
299
|
+
[DE] Iter: 001/100 | Obj: 1.354248e+01 | Feas: 100.0 % | Time: 0.001 s
|
|
300
|
+
...
|
|
301
|
+
[DE] Iter: 099/100 | Obj: 0.000000e+00 | Feas: 100.0 % | Time: 0.015 s
|
|
302
|
+
[DE] Iter: 100/100 | Obj: 0.000000e+00 | Feas: 100.0 % | Time: 0.015 s
|
|
303
|
+
|
|
304
|
+
==================================================================
|
|
305
|
+
OPTIMIZATION RESULT - DE
|
|
306
|
+
==================================================================
|
|
307
|
+
Iterations: 100
|
|
308
|
+
Runtime: 0.015571 s
|
|
309
|
+
Number of Bests: 1
|
|
310
|
+
Best Objectives: 0.000000e+00
|
|
311
|
+
Best Constraints: N/A
|
|
312
|
+
Best Decision Variables:
|
|
313
|
+
[-4.32080858e-10 1.10147149e-09]
|
|
314
|
+
==================================================================
|
|
315
|
+
```
|
|
316
|
+
> 💡 性能提示:对比两种方式的运行时间(0.033s vs 0.016s),向量化版本的性能优势明显。在处理大规模种群或高维问题时,推荐优先使用 calc_objs_mat 接口。
|
|
317
|
+
|
|
318
|
+
> 🎨 可视化提示:如需在优化过程中实时绘制动态图像,也推荐使用 calc_objs_mat 接口,可获得更流畅的视觉效果。
|
|
319
|
+
|
|
320
|
+
#### 可视化示例
|
|
321
|
+
|
|
322
|
+
> 💡 **提示**:如果下方的动图无法正常显示,请点击 [此处](https://gitee.com/wang567/CHOCCY) 前往 Gitee 查看完整 README(动图可正常显示)。
|
|
323
|
+
|
|
324
|
+
以下为使用向量化计算时的优化过程动图(不同参数组合):
|
|
325
|
+
|
|
326
|
+
- 左图:`n_vars=2`, `visual_mode='obj'`
|
|
327
|
+
- 右图:`n_vars=1`, `visual_mode='h2d'`
|
|
328
|
+
|
|
329
|
+
<img src="./docs/images/obj.gif" width="288" height="220"/>
|
|
330
|
+
<img src="./docs/images/h2d1.gif" width="288" height="220"/>
|
|
331
|
+
|
|
332
|
+
- 左图:`n_vars=2`, `visual_mode='h2d'`
|
|
333
|
+
- 右图:`n_vars=2`, `visual_mode='h3d'`
|
|
334
|
+
|
|
335
|
+
<img src="./docs/images/h2d.gif" width="288" height="220"/>
|
|
336
|
+
<img src="./docs/images/h3d.gif" width="288" height="220"/>
|
|
337
|
+
|
|
338
|
+
📌 **`visual_mode` 参数说明**:
|
|
339
|
+
|
|
340
|
+
| 参数 | 含义 | 备注 |
|
|
341
|
+
|---------|-------------|---------------------------------|
|
|
342
|
+
| `'obj'` | 目标空间绘制 | 单目标:收敛曲线;多目标:目标空间 |
|
|
343
|
+
| `'h2d'` | 决策+目标空间混合绘制 | `n_vars=1`:二维曲线;`n_vars=2`:等高线图 |
|
|
344
|
+
| `'h3d'` | 决策+目标空间混合绘制 | 三维曲面图,**要求 `n_vars=2`** |
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
## 🌈 效果展示
|
|
348
|
+
|
|
349
|
+
### 单目标问题优化
|
|
350
|
+
|
|
351
|
+
> 📌 **说明**:以下动图和图片展示的是项目示例的运行效果。示例代码位于 GitHub 仓库的 `examples/` 目录中,**不会随 `pip install choccy` 一同安装**。如需本地运行,请先克隆项目源码。
|
|
352
|
+
|
|
353
|
+
### 单目标问题优化
|
|
354
|
+
|
|
355
|
+
#### 特殊类型问题优化
|
|
356
|
+
|
|
357
|
+
| 问题类型 | 对应脚本 |
|
|
358
|
+
|:-----------|:--------------------------------------------------------|
|
|
359
|
+
| TSP(旅行商问题) | `examples/single/optimize/optimize_TSP.py` |
|
|
360
|
+
| 固定标签聚类问题 | `examples/single/optimize/optimize_FixedSizeCluster.py` |
|
|
361
|
+
|
|
362
|
+
<img src="./docs/images/tsp.gif" width="288" height="230"/>
|
|
363
|
+
<img src="./docs/images/cluster.gif" width="288" height="230"/>
|
|
364
|
+
|
|
365
|
+
#### 多种算法实时对比(相同问题)
|
|
366
|
+
|
|
367
|
+
| 问题类型 | 对应脚本 |
|
|
368
|
+
|:----------------|:--------------------------------------------|
|
|
369
|
+
| 实数问题(Ackley 函数) | `examples/single/compare/compare_Ackley.py` |
|
|
370
|
+
| TSP 问题 | `examples/single/compare/compare_TSP.py` |
|
|
371
|
+
|
|
372
|
+
<img src="./docs/images/compare_ackley.gif" width="288" height="230"/>
|
|
373
|
+
<img src="./docs/images/compare_tsp.gif" width="288" height="230"/>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
#### 多种算法结果对比(静态分析)
|
|
377
|
+
|
|
378
|
+
| 图表类型 | 说明 |
|
|
379
|
+
|:--------|:--------|
|
|
380
|
+
| 小提琴图 | 展示目标值分布形态 |
|
|
381
|
+
| 核密度估计图 | 展示目标值概率密度 |
|
|
382
|
+
|
|
383
|
+
**对应脚本**:`examples/single/evaluate/evaluate_Ackley.py`
|
|
384
|
+
|
|
385
|
+
<img src="./docs/images/violin.png" width="288" height="230"/>
|
|
386
|
+
<img src="./docs/images/kde.png" width="288" height="230"/>
|
|
387
|
+
|
|
388
|
+
> 📌 **注**:为了更清晰地展示对比效果,以上静态图中的迭代次数已缩减为 100 次。
|
|
389
|
+
|
|
390
|
+
### 多目标问题优化
|
|
391
|
+
|
|
392
|
+
#### 基准测试问题优化
|
|
393
|
+
|
|
394
|
+
| 测试问题 | 说明 | 对应脚本 |
|
|
395
|
+
|:------|:-------------------|:-------------------------------------------|
|
|
396
|
+
| ZDT3 | 双目标优化问题,具有不连续帕累托前沿 | `examples/multi/optimize/optimize_ZDT.py` |
|
|
397
|
+
| DTLZ2 | 多目标优化问题,具有凹球面形帕累托前沿 | `examples/multi/optimize/optimize_DTLZ.py` |
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
<img src="./docs/images/zdt3.gif" width="288" height="230"/>
|
|
401
|
+
<img src="./docs/images/dtlz2.gif" width="288" height="230"/>
|
|
402
|
+
|
|
403
|
+
#### 多种算法实时对比(多目标背包问题)
|
|
404
|
+
|
|
405
|
+
对比不同算法在 MOKP(多目标背包问题,1000 维)上的优化表现:
|
|
406
|
+
|
|
407
|
+
**对应脚本**:`examples/multi/compare/compare_MOKP.py`
|
|
408
|
+
|
|
409
|
+
<img src="./docs/images/compare_mokp.gif" width="288" height="230"/>
|
|
410
|
+
<img src="./docs/images/mokp_hv.png" width="288" height="230"/>
|
|
411
|
+
|
|
412
|
+
> 📌 **说明**:右侧图片展示的是 HV(Hypervolume,超体积)指标对比,用于衡量多目标算法的收敛性和多样性。
|
|
413
|
+
|
|
414
|
+
### 更多示例
|
|
415
|
+
|
|
416
|
+
完整的示例代码请参阅 Gitee/GitHub 仓库的 [examples/](https://gitee.com/wang567/CHOCCY/tree/master/examples) 目录。
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
## 📄 数据集优化结果展示
|
|
420
|
+
|
|
421
|
+
### TSP 数据集优化结果
|
|
422
|
+
|
|
423
|
+
考虑到部分用户会使用本项目求解旅行商问题(TSP),以下给出 TSPLIB 数据集中部分中小规模实例的优化结果。
|
|
424
|
+
|
|
425
|
+
| Instance | BKS | GA | SA | ACO | HGA-TSP | FI | LS | GFLS | Gap(%) |
|
|
426
|
+
|----------|-------|-------|-------|-------|---------|-------|-------|-------|--------|
|
|
427
|
+
| gr17 | 2085 | 2085 | 2088 | 2085 | 2085 | 2096 | 2088 | 2085 | 0.00 |
|
|
428
|
+
| gr24 | 1272 | 1272 | 1279 | 1272 | 1272 | 1361 | 1272 | 1272 | 0.00 |
|
|
429
|
+
| eil51 | 426 | 429 | 443 | 438 | 432 | 451 | 458 | 426 | 0.00 |
|
|
430
|
+
| eil76 | 538 | 594 | 583 | 565 | 562 | 607 | 600 | 538 | 0.00 |
|
|
431
|
+
| berlin52 | 7542 | 7918 | 8034 | 7547 | 7542 | 8118 | 8368 | 7542 | 0.00 |
|
|
432
|
+
| KroA100 | 21282 | 26063 | 22238 | 22455 | 21472 | 23373 | 23417 | 21282 | 0.00 |
|
|
433
|
+
| KroB100 | 22141 | 26571 | 24078 | 23377 | 22391 | 23958 | 24474 | 22157 | 0.07 |
|
|
434
|
+
| KroC100 | 20749 | 25934 | 21991 | 21597 | 22080 | 21817 | 22671 | 20749 | 0.00 |
|
|
435
|
+
|
|
436
|
+
#### 实验设置
|
|
437
|
+
|
|
438
|
+
- **种群大小**:`pop_size = 100`
|
|
439
|
+
- **迭代次数**:`max_iter = 1000`(保证算法充分收敛)
|
|
440
|
+
- **结果取值**:每次优化取多次运行中的**最小值**(由于随机初始化,结果可能略有波动)
|
|
441
|
+
|
|
442
|
+
> 📌 **补充说明**:上表中 Gap (%) 列展示的是 **GFLS 算法**与 BKS(当前已知的最优解) 的差距。从结果可以看出,GFLS 在多个实例上均能达到或接近已知最优解。
|
|
443
|
+
|
|
444
|
+
## 🤝 项目贡献
|
|
445
|
+
|
|
446
|
+
**Maintainer: Luchen Wang**<br>
|
|
447
|
+
|
|
448
|
+
## ✉️ 联系我们
|
|
449
|
+
|
|
450
|
+
**邮箱: wangluchen567@qq.com**
|
|
451
|
+
|
|
452
|
+
|