lead/README.md

85 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# LEAD (LLM-Evolved Algorithm Development)
LLM驱动的算法进化开发框架支持单目标和多目标优化问题的算法自动进化。
## 单目标算法进化
### 1. 配置要求
在问题目录下的`problem_config.json`中配置:
```json
{
"multi_objective": false,
"description": "问题描述",
"function_name": "函数名",
"input_format": "输入格式",
"output_format": "输出格式",
"evolution_params": {
"algorithm": "TU", # "DE"
"population_size": 8,
"generations": 10
}
}
```
### 2. 运行流程
1. 初始化种群LLM根据问题描述生成初始算法代码
2. 评估:计算每个个体的适应度(单目标值)
3. 进化循环:
- 选择:锦标赛选择或差分进化选择
- 交叉:代码片段重组
- 变异LLM引导的代码变异
4. 输出:最优算法代码和适应度曲线
### 3. 运行命令
```bash
lead-run --problem [问题名] [--generations 代数] [--population 种群大小]
```
可选参数:
- `--generations`: 覆盖默认进化代数
- `--population`: 覆盖默认种群大小
## 多目标算法进化
### 1. 配置要求
```json
{
"multi_objective": true,
"objective_names": ["目标1", "目标2"],
"description": "问题描述",
"evolution_params": {
"algorithm": "MO",
"population_size": 10,
"generations": 20
}
}
```
### 2. 运行流程
1. 初始化种群LLM生成初始多目标算法
2. 评估:计算每个个体的多目标适应度向量
3. 进化循环:
- 非支配排序
- 拥挤度计算
- 精英保留
4. 输出Pareto前沿算法集合
### 3. 运行命令
```bash
lead-run --problem [问题名] [--generations 代数] [--population 种群大小]
```
可选参数同上
## 配置说明
- `problem_config.json`必须包含:
- 问题描述
- 输入输出格式
- 进化参数
- 可选配置:
- LLM参数
- 评估超时时间
## 结果输出
- 单目标:`evolution_history/[时间戳]/`目录保存各代最优解
- 多目标:`multi_objective_history/[时间戳]/`保存Pareto前沿