2025-03-17 16:40:01 +08:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 1,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
2025-05-13 15:46:02 +08:00
|
|
|
"['GR96.tsp', 'XIT1083.tsp', 'RBU737.tsp', 'ulysses16.tsp', 'PBK411.tsp', 'PR76.tsp', 'CHN144.tsp', 'eil76.tsp', 'eil101.tsp', 'ulysses8.tsp']\n"
|
2025-03-17 16:40:01 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"import os\n",
|
|
|
|
"import numpy as np\n",
|
|
|
|
"import time\n",
|
|
|
|
"import matplotlib.pyplot as plt\n",
|
|
|
|
"import pandas as pd\n",
|
|
|
|
"from tsp_algo import *\n",
|
|
|
|
"\n",
|
|
|
|
"# 获取tsp_data目录下所有tsp文件\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"data_dir = \"../\"\n",
|
|
|
|
"data_dir2 = \"../tsp_data/data/\"\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"test_files = [f for f in os.listdir(data_dir2) if f.endswith('tsp')]\n",
|
|
|
|
"print(test_files)\n",
|
|
|
|
"\n",
|
|
|
|
"# 定义评估函数\n",
|
|
|
|
"def evaluate_tsp(tsp_func, distances):\n",
|
|
|
|
" \"\"\"评估TSP算法的性能\"\"\"\n",
|
|
|
|
" try:\n",
|
|
|
|
" # 计时并执行TSP\n",
|
|
|
|
" start_time = time.time()\n",
|
|
|
|
" path = tsp_func(distances)\n",
|
|
|
|
" end_time = time.time()\n",
|
|
|
|
" execution_time = end_time - start_time\n",
|
|
|
|
" \n",
|
|
|
|
" # 计算路径长度\n",
|
|
|
|
" total_distance = 0\n",
|
|
|
|
" n = len(distances)\n",
|
|
|
|
" for i in range(n):\n",
|
|
|
|
" total_distance += distances[path[i]][path[(i+1)%n]]\n",
|
|
|
|
" \n",
|
|
|
|
" print(f\"执行时间:{execution_time:.4f}秒, 路径长度:{total_distance:.2f}\")\n",
|
|
|
|
" return total_distance, execution_time\n",
|
|
|
|
" \n",
|
|
|
|
" except Exception as e:\n",
|
|
|
|
" print(f\"评估过程出错: {str(e)}\")\n",
|
|
|
|
" return float('inf'), float('inf')\n",
|
|
|
|
"\n",
|
|
|
|
"# 定义数据加载函数 \n",
|
|
|
|
"def load_tsp_data(filename):\n",
|
|
|
|
" \"\"\"读取TSP问题数据\"\"\"\n",
|
|
|
|
" try:\n",
|
|
|
|
" cities = []\n",
|
|
|
|
" filepath = os.path.join(data_dir2, filename)\n",
|
|
|
|
" with open(filepath, 'r') as f:\n",
|
|
|
|
" reading_coords = False\n",
|
|
|
|
" for line in f:\n",
|
|
|
|
" if line.strip() == \"NODE_COORD_SECTION\":\n",
|
|
|
|
" reading_coords = True\n",
|
|
|
|
" continue\n",
|
|
|
|
" if line.strip() == \"EOF\":\n",
|
|
|
|
" break\n",
|
|
|
|
" if reading_coords:\n",
|
|
|
|
" parts = line.strip().split()\n",
|
|
|
|
" if len(parts) == 3:\n",
|
|
|
|
" x, y = float(parts[1]), float(parts[2])\n",
|
|
|
|
" cities.append((x, y))\n",
|
|
|
|
" \n",
|
|
|
|
" # 计算距离矩阵\n",
|
|
|
|
" n = len(cities)\n",
|
|
|
|
" distances = np.zeros((n, n))\n",
|
|
|
|
" for i in range(n):\n",
|
|
|
|
" for j in range(n):\n",
|
|
|
|
" if i != j:\n",
|
|
|
|
" distances[i,j] = np.sqrt((cities[i][0] - cities[j][0])**2 + \n",
|
|
|
|
" (cities[i][1] - cities[j][1])**2)\n",
|
|
|
|
" \n",
|
|
|
|
" return distances\n",
|
|
|
|
" \n",
|
|
|
|
" except Exception as e:\n",
|
|
|
|
" print(f\"读取数据出错: {str(e)}\")\n",
|
|
|
|
" return None"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2025-05-13 15:46:02 +08:00
|
|
|
"execution_count": 2,
|
2025-03-17 16:40:01 +08:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: GR96.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0013秒, 路径长度:707.09\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0095秒, 路径长度:707.09\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0993秒, 路径长度:651.44\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0772秒, 路径长度:641.82\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.2481秒, 路径长度:571.02\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0061秒, 路径长度:573.48\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: XIT1083.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0971秒, 路径长度:4584.27\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1277秒, 路径长度:4584.27\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:121.7319秒, 路径长度:4328.99\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:4.1403秒, 路径长度:4673.87\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:80.2114秒, 路径长度:4051.52\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.1036秒, 路径长度:4397.83\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: RBU737.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0504秒, 路径长度:4416.15\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0444秒, 路径长度:4416.15\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:40.5620秒, 路径长度:4097.20\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:1.9295秒, 路径长度:4436.28\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:26.4296秒, 路径长度:3870.50\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0562秒, 路径长度:4101.04\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: ulysses16.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0001秒, 路径长度:104.73\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0001秒, 路径长度:104.73\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0005秒, 路径长度:79.39\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0114秒, 路径长度:88.25\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0243秒, 路径长度:74.14\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0011秒, 路径长度:104.65\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"测试实例: PBK411.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0146秒, 路径长度:1838.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0171秒, 路径长度:1838.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:6.5032秒, 路径长度:1602.35\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.7277秒, 路径长度:1835.85\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:4.4427秒, 路径长度:1554.96\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0255秒, 路径长度:1776.60\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"测试实例: PR76.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0007秒, 路径长度:153461.92\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0007秒, 路径长度:153461.92\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0446秒, 路径长度:125936.21\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0522秒, 路径长度:153461.92\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1132秒, 路径长度:112991.57\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0038秒, 路径长度:123787.14\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: CHN144.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0019秒, 路径长度:35884.30\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0024秒, 路径长度:35884.30\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.2761秒, 路径长度:35048.39\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1257秒, 路径长度:35884.30\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.2748秒, 路径长度:32744.18\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0072秒, 路径长度:35658.61\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: eil76.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0008秒, 路径长度:711.99\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0005秒, 路径长度:711.99\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0396秒, 路径长度:612.39\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0517秒, 路径长度:669.24\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1012秒, 路径长度:622.71\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0043秒, 路径长度:577.27\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: eil101.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0006秒, 路径长度:825.24\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0007秒, 路径长度:825.24\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0900秒, 路径长度:702.96\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0815秒, 路径长度:847.59\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1857秒, 路径长度:702.70\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0053秒, 路径长度:720.41\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: ulysses8.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 贪心算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0000秒, 路径长度:38.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 最近邻算法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0000秒, 路径长度:38.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: 插入法\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0001秒, 路径长度:37.83\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: EoH-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0065秒, 路径长度:38.11\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: AAD-TSP\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0169秒, 路径长度:37.83\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: MEoH-TSP\n",
|
|
|
|
"执行时间:0.0003秒, 路径长度:38.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"所有算法在各个实例上的表现:\n",
|
|
|
|
"\n",
|
|
|
|
"贪心算法:\n",
|
|
|
|
" GR96.tsp: 路径长度 = 707.09\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" XIT1083.tsp: 路径长度 = 4584.27\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" RBU737.tsp: 路径长度 = 4416.15\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 104.73\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" PBK411.tsp: 路径长度 = 1838.48\n",
|
|
|
|
" PR76.tsp: 路径长度 = 153461.92\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 35884.30\n",
|
|
|
|
" eil76.tsp: 路径长度 = 711.99\n",
|
|
|
|
" eil101.tsp: 路径长度 = 825.24\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 路径长度 = 38.48\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 执行时间 = 0.0013秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 0.0971秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 0.0504秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0001秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 0.0146秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.0007秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.0019秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.0008秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.0006秒\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 执行时间 = 0.0000秒\n",
|
|
|
|
"\n",
|
|
|
|
"最近邻算法:\n",
|
|
|
|
" GR96.tsp: 路径长度 = 707.09\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" XIT1083.tsp: 路径长度 = 4584.27\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" RBU737.tsp: 路径长度 = 4416.15\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 104.73\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" PBK411.tsp: 路径长度 = 1838.48\n",
|
|
|
|
" PR76.tsp: 路径长度 = 153461.92\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 35884.30\n",
|
|
|
|
" eil76.tsp: 路径长度 = 711.99\n",
|
|
|
|
" eil101.tsp: 路径长度 = 825.24\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 路径长度 = 38.48\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 执行时间 = 0.0095秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 0.1277秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 0.0444秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0001秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 0.0171秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.0007秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.0024秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.0005秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.0007秒\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 执行时间 = 0.0000秒\n",
|
|
|
|
"\n",
|
|
|
|
"插入法:\n",
|
|
|
|
" GR96.tsp: 路径长度 = 651.44\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" XIT1083.tsp: 路径长度 = 4328.99\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" RBU737.tsp: 路径长度 = 4097.20\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 79.39\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" PBK411.tsp: 路径长度 = 1602.35\n",
|
|
|
|
" PR76.tsp: 路径长度 = 125936.21\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 35048.39\n",
|
|
|
|
" eil76.tsp: 路径长度 = 612.39\n",
|
|
|
|
" eil101.tsp: 路径长度 = 702.96\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 路径长度 = 37.83\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 执行时间 = 0.0993秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 121.7319秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 40.5620秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0005秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 6.5032秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.0446秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.2761秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.0396秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.0900秒\n",
|
|
|
|
" ulysses8.tsp: 执行时间 = 0.0001秒\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"EoH-TSP:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 路径长度 = 641.82\n",
|
|
|
|
" XIT1083.tsp: 路径长度 = 4673.87\n",
|
|
|
|
" RBU737.tsp: 路径长度 = 4436.28\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 88.25\n",
|
|
|
|
" PBK411.tsp: 路径长度 = 1835.85\n",
|
|
|
|
" PR76.tsp: 路径长度 = 153461.92\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" CHN144.tsp: 路径长度 = 35884.30\n",
|
|
|
|
" eil76.tsp: 路径长度 = 669.24\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" eil101.tsp: 路径长度 = 847.59\n",
|
|
|
|
" ulysses8.tsp: 路径长度 = 38.11\n",
|
|
|
|
" GR96.tsp: 执行时间 = 0.0772秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 4.1403秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 1.9295秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0114秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 0.7277秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.0522秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.1257秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.0517秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.0815秒\n",
|
|
|
|
" ulysses8.tsp: 执行时间 = 0.0065秒\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"AAD-TSP:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 路径长度 = 571.02\n",
|
|
|
|
" XIT1083.tsp: 路径长度 = 4051.52\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" RBU737.tsp: 路径长度 = 3870.50\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" ulysses16.tsp: 路径长度 = 74.14\n",
|
|
|
|
" PBK411.tsp: 路径长度 = 1554.96\n",
|
|
|
|
" PR76.tsp: 路径长度 = 112991.57\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 32744.18\n",
|
|
|
|
" eil76.tsp: 路径长度 = 622.71\n",
|
|
|
|
" eil101.tsp: 路径长度 = 702.70\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" ulysses8.tsp: 路径长度 = 37.83\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" GR96.tsp: 执行时间 = 0.2481秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 80.2114秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 26.4296秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0243秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 4.4427秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.1132秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.2748秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.1012秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.1857秒\n",
|
|
|
|
" ulysses8.tsp: 执行时间 = 0.0169秒\n",
|
|
|
|
"\n",
|
|
|
|
"MEoH-TSP:\n",
|
|
|
|
" GR96.tsp: 路径长度 = 573.48\n",
|
|
|
|
" XIT1083.tsp: 路径长度 = 4397.83\n",
|
|
|
|
" RBU737.tsp: 路径长度 = 4101.04\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 104.65\n",
|
|
|
|
" PBK411.tsp: 路径长度 = 1776.60\n",
|
|
|
|
" PR76.tsp: 路径长度 = 123787.14\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 35658.61\n",
|
|
|
|
" eil76.tsp: 路径长度 = 577.27\n",
|
|
|
|
" eil101.tsp: 路径长度 = 720.41\n",
|
|
|
|
" ulysses8.tsp: 路径长度 = 38.48\n",
|
|
|
|
" GR96.tsp: 执行时间 = 0.0061秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 0.1036秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 0.0562秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0011秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 0.0255秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.0038秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.0072秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.0043秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.0053秒\n",
|
|
|
|
" ulysses8.tsp: 执行时间 = 0.0003秒\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"各算法在不同实例上的路径长度:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" 贪心算法 最近邻算法 插入法 EoH-TSP AAD-TSP MEoH-TSP\n",
|
|
|
|
"GR96 707.09 707.09 651.44 641.82 571.02 573.48\n",
|
|
|
|
"XIT1083 4584.27 4584.27 4328.99 4673.87 4051.52 4397.83\n",
|
|
|
|
"RBU737 4416.15 4416.15 4097.20 4436.28 3870.50 4101.04\n",
|
|
|
|
"ulysses16 104.73 104.73 79.39 88.25 74.14 104.65\n",
|
|
|
|
"PBK411 1838.48 1838.48 1602.35 1835.85 1554.96 1776.60\n",
|
|
|
|
"PR76 153461.92 153461.92 125936.21 153461.92 112991.57 123787.14\n",
|
|
|
|
"CHN144 35884.30 35884.30 35048.39 35884.30 32744.18 35658.61\n",
|
|
|
|
"eil76 711.99 711.99 612.39 669.24 622.71 577.27\n",
|
|
|
|
"eil101 825.24 825.24 702.96 847.59 702.70 720.41\n",
|
|
|
|
"ulysses8 38.48 38.48 37.83 38.11 37.83 38.48\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"各算法在不同实例上的运行时长:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" 贪心算法 最近邻算法 插入法 EoH-TSP AAD-TSP MEoH-TSP\n",
|
|
|
|
"GR96 0.0013 0.0095 0.0993 0.0772 0.2481 0.0061\n",
|
|
|
|
"XIT1083 0.0971 0.1277 121.7319 4.1403 80.2114 0.1036\n",
|
|
|
|
"RBU737 0.0504 0.0444 40.5620 1.9295 26.4296 0.0562\n",
|
|
|
|
"ulysses16 0.0001 0.0001 0.0005 0.0114 0.0243 0.0011\n",
|
|
|
|
"PBK411 0.0146 0.0171 6.5032 0.7277 4.4427 0.0255\n",
|
|
|
|
"PR76 0.0007 0.0007 0.0446 0.0522 0.1132 0.0038\n",
|
|
|
|
"CHN144 0.0019 0.0024 0.2761 0.1257 0.2748 0.0072\n",
|
|
|
|
"eil76 0.0008 0.0005 0.0396 0.0517 0.1012 0.0043\n",
|
|
|
|
"eil101 0.0006 0.0007 0.0900 0.0815 0.1857 0.0053\n",
|
|
|
|
"ulysses8 0.0000 0.0000 0.0001 0.0065 0.0169 0.0003\n"
|
2025-03-17 16:40:01 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"\n",
|
|
|
|
"# 用于存储每个算法在每个实例上的结果 \n",
|
|
|
|
"results = {}\n",
|
|
|
|
"results_time = {}\n",
|
|
|
|
"\n",
|
|
|
|
"# 遍历每个测试实例\n",
|
|
|
|
"for test_file in test_files:\n",
|
|
|
|
" print(f\"\\n测试实例: {test_file}\")\n",
|
|
|
|
" \n",
|
|
|
|
" # 加载数据\n",
|
|
|
|
" distances = load_tsp_data(test_file)\n",
|
|
|
|
" if distances is None:\n",
|
|
|
|
" continue\n",
|
|
|
|
" \n",
|
|
|
|
" # 这里可以添加多个待评估的TSP算法\n",
|
|
|
|
" algorithms = {\n",
|
|
|
|
" \"贪心算法\": greedy_tsp,\n",
|
|
|
|
" \"最近邻算法\": nearest_neighbor_tsp,\n",
|
|
|
|
" \"插入法\": insertion_tsp,\n",
|
|
|
|
" # \"tsp_01\": tsp_01,\n",
|
|
|
|
" \"EoH-TSP\": tsp_02,\n",
|
|
|
|
" \"AAD-TSP\": tsp_04,\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" \"MEoH-TSP\": tsp_06,\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
" }\n",
|
|
|
|
" \n",
|
|
|
|
" # 评估每个算法\n",
|
|
|
|
" for alg_name, alg_func in algorithms.items():\n",
|
|
|
|
" print(f\"\\n使用算法: {alg_name}\")\n",
|
|
|
|
" score, etime = evaluate_tsp(alg_func, distances)\n",
|
|
|
|
" \n",
|
|
|
|
" if alg_name not in results:\n",
|
|
|
|
" results[alg_name] = {}\n",
|
|
|
|
" if alg_name not in results_time:\n",
|
|
|
|
" results_time[alg_name] = {}\n",
|
|
|
|
" results[alg_name][test_file] = score\n",
|
|
|
|
" results_time[alg_name][test_file] = etime\n",
|
|
|
|
"\n",
|
|
|
|
"# 打印总结果\n",
|
|
|
|
"print(\"\\n所有算法在各个实例上的表现:\")\n",
|
|
|
|
"for alg_name, scores in results.items():\n",
|
|
|
|
" print(f\"\\n{alg_name}:\")\n",
|
|
|
|
" for test_file, score in scores.items():\n",
|
|
|
|
" print(f\" {test_file}: 路径长度 = {score:.2f}\")\n",
|
|
|
|
" for test_file, etime in results_time[alg_name].items():\n",
|
|
|
|
" print(f\" {test_file}: 执行时间 = {etime:.4f}秒\")\n",
|
|
|
|
"\n",
|
|
|
|
"# 将结果整理成表格\n",
|
|
|
|
"data = {}\n",
|
|
|
|
"for test_file in test_files:\n",
|
|
|
|
" instance_name = test_file.replace('.tsp', '')\n",
|
|
|
|
" data[instance_name] = {}\n",
|
|
|
|
" for alg_name in results:\n",
|
|
|
|
" if test_file in results[alg_name]:\n",
|
|
|
|
" data[instance_name][alg_name] = results[alg_name][test_file]\n",
|
|
|
|
"\n",
|
|
|
|
"# 将运行时间整理成表格\n",
|
|
|
|
"data_time = {}\n",
|
|
|
|
"for test_file in test_files:\n",
|
|
|
|
" instance_name = test_file.replace('.tsp', '')\n",
|
|
|
|
" data_time[instance_name] = {}\n",
|
|
|
|
" for alg_name in results_time:\n",
|
|
|
|
" if test_file in results_time[alg_name]:\n",
|
|
|
|
" data_time[instance_name][alg_name] = results_time[alg_name][test_file]\n",
|
|
|
|
"\n",
|
|
|
|
"import random\n",
|
|
|
|
"\n",
|
|
|
|
"# 转换为DataFrame\n",
|
|
|
|
"df_results = pd.DataFrame(data).T\n",
|
|
|
|
"df_time = pd.DataFrame(data_time).T\n",
|
|
|
|
"\n",
|
|
|
|
"# 打印结果表格\n",
|
|
|
|
"print(\"\\n各算法在不同实例上的路径长度:\")\n",
|
|
|
|
"print(df_results.round(2)) # 路径长度保留2位小数\n",
|
|
|
|
"# 统计每个算法的运行时长\n",
|
|
|
|
"print(\"\\n各算法在不同实例上的运行时长:\")\n",
|
|
|
|
"print(df_time.round(4)) # 运行时间保留4位小数\n"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2025-05-13 15:46:02 +08:00
|
|
|
"execution_count": 3,
|
2025-03-17 16:40:01 +08:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n",
|
|
|
|
"各算法在不同实例上的路径长度:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" 贪心算法 最近邻算法 插入法 EoH-TSP AAD-TSP MEoH-TSP\n",
|
|
|
|
"ulysses8 38.48 38.48 37.83 38.11 37.83 38.48\n",
|
|
|
|
"ulysses16 104.73 104.73 79.39 88.25 74.14 104.65\n",
|
|
|
|
"PR76 153461.92 153461.92 125936.21 153461.92 112991.57 123787.14\n",
|
|
|
|
"eil76 711.99 711.99 612.39 669.24 622.71 577.27\n",
|
|
|
|
"GR96 707.09 707.09 651.44 641.82 571.02 573.48\n",
|
|
|
|
"eil101 825.24 825.24 702.96 847.59 702.70 720.41\n",
|
|
|
|
"CHN144 35884.30 35884.30 35048.39 35884.30 32744.18 35658.61\n",
|
|
|
|
"PBK411 1838.48 1838.48 1602.35 1835.85 1554.96 1776.60\n",
|
|
|
|
"RBU737 4416.15 4416.15 4097.20 4436.28 3870.50 4101.04\n",
|
|
|
|
"XIT1083 4584.27 4584.27 4328.99 4673.87 4051.52 4397.83\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"各算法在不同实例上的运行时长:\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
" 贪心算法 最近邻算法 插入法 EoH-TSP AAD-TSP MEoH-TSP\n",
|
|
|
|
"ulysses8 0.0000 0.0000 0.0001 0.0065 0.0169 0.0003\n",
|
|
|
|
"ulysses16 0.0001 0.0001 0.0005 0.0114 0.0243 0.0011\n",
|
|
|
|
"PR76 0.0007 0.0007 0.0446 0.0522 0.1132 0.0038\n",
|
|
|
|
"eil76 0.0008 0.0005 0.0396 0.0517 0.1012 0.0043\n",
|
|
|
|
"GR96 0.0013 0.0095 0.0993 0.0772 0.2481 0.0061\n",
|
|
|
|
"eil101 0.0006 0.0007 0.0900 0.0815 0.1857 0.0053\n",
|
|
|
|
"CHN144 0.0019 0.0024 0.2761 0.1257 0.2748 0.0072\n",
|
|
|
|
"PBK411 0.0146 0.0171 6.5032 0.7277 4.4427 0.0255\n",
|
|
|
|
"RBU737 0.0504 0.0444 40.5620 1.9295 26.4296 0.0562\n",
|
|
|
|
"XIT1083 0.0971 0.1277 121.7319 4.1403 80.2114 0.1036\n"
|
2025-03-17 16:40:01 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# 创建排序用的临时索引\n",
|
|
|
|
"temp_results_idx = pd.Index([int(''.join(filter(str.isdigit, idx))) for idx in df_results.index])\n",
|
|
|
|
"temp_time_idx = pd.Index([int(''.join(filter(str.isdigit, idx))) for idx in df_time.index])\n",
|
|
|
|
"\n",
|
|
|
|
"# 按数字排序但保留原始名称\n",
|
|
|
|
"df_results = df_results.iloc[temp_results_idx.argsort()]\n",
|
|
|
|
"df_time = df_time.iloc[temp_time_idx.argsort()]\n",
|
|
|
|
"\n",
|
|
|
|
"# 打印结果表格\n",
|
|
|
|
"print(\"\\n各算法在不同实例上的路径长度:\")\n",
|
|
|
|
"print(df_results.round(2)) # 路径长度保留2位小数\n",
|
|
|
|
"# 统计每个算法的运行时长 \n",
|
|
|
|
"print(\"\\n各算法在不同实例上的运行时长:\")\n",
|
|
|
|
"print(df_time.round(4)) # 运行时间保留4位小数"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 4,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
2025-05-13 15:46:02 +08:00
|
|
|
{
|
|
|
|
"name": "stderr",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n",
|
|
|
|
"findfont: Generic family 'sans-serif' not found because none of the following families were found: SimHei\n"
|
|
|
|
]
|
|
|
|
},
|
2025-03-17 16:40:01 +08:00
|
|
|
{
|
|
|
|
"data": {
|
2025-05-13 15:46:02 +08:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAABJQAAANnCAYAAABnCwJ8AAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAA/7pJREFUeJzs/XucllW9P/6/BhgGEBlURBRRRMxTHtI8BOUxMbUk8rC18gS2NWt3+G7BbbmVNqYG2tbyo6WpZWGmpaJl5iE1AUUUJdFQkGMC4oGDBAw43L8/+M29HZlBLhjOz+fjcT+aua611vW+uL17cL9Ya10VpVKpFAAAAABYRc3WdwEAAAAAbFwESgAAAAAUIlACAAAAoBCBEgAAAACFCJQAAAAAKESgBAAAAEAhAiUAAAAACmmxvgtYE8uWLcuMGTOy5ZZbpqKiYn2XAwAAALDRKpVKee+997LDDjukWbOVz0HaqAOlGTNmpEuXLuu7DAAAAIBNxvTp07PjjjuutM1GHShtueWWSZbfaLt27dZzNQAAAAAbr/nz56dLly7lvGVlNupAqW6ZW7t27QRKAAAAAE1gVbYVsik3AAAAAIUIlAAAAAAoRKAEAAAAQCECJQAAAAAKESgBAAAAUIhACQAAAIBCBEoAAAAAFCJQAgAAAKAQgRIAAAAAhQiUAAAAACikxfouYENQKpWydOnSLFu2bH2XAhu1Zs2apUWLFmnWTFYNAACwKdusA6Xa2tq8/fbbee+997J06dL1XQ5sEpo1a5Y2bdqkXbt2qa6uXt/lAAAAG5jZs2dn8ODB+fOf/5zJkydn2bJl6dy5c44++ugMGDAg3bt3b7Df008/nauuuiojR47MggULsssuu+T0009P//7906pVq0I1vPbaa/nDH/6Qxx9/PH//+9/zzjvvZMstt8x+++2XM888M2eddVaD/1C+aNGiPPTQQ3n22Wfz7LPP5rnnnsv8+fOz6667ZuLEiav157GxqiiVSqX1XcTqmj9/fqqrqzNv3ry0a9euUN/a2tpMnz49NTU1qa6uTtu2bdO8efNUVFSspWph01YqlbJs2bIsXrw4CxYsyMKFC7PVVltlu+2287kCAACSJK+++moOO+ywzJ49O5WVlenWrVsqKyszceLELF68OG3atMmDDz6Yww8/vF6/oUOH5qyzzkptbW06d+6cjh07Zty4cVm6dGkOOuigPPHEE2nTps0q1VBbW5sWLf5vfs2OO+6YTp06Zdq0aZk9e3aSpFevXhk2bNgKQdWLL76YT3ziEyuMuakESkVyls12htLbb7+dmpqa7LTTTmnduvX6Lgc2GVtssUW22WabzJkzJ7NmzUrLli2z9dZbr++yAACADcA3vvGNzJ49Oz179sydd96ZHXfcMUnyzjvvpG/fvrn//vtzzjnn5PXXXy//w/SUKVPSr1+/1NbWZvDgwbnwwgtTUVGRqVOn5thjj83o0aMzYMCAXH/99atUQ6lUSvv27fPNb34z55xzTrp161Y+d9ddd+Xss8/Oww8/nEsuuSRXX311vb6VlZU59NBDc9BBB+Xggw/O0qVL07dv3yb609m4bJYzlEqlUl5//fW0bds2nTp1WosVwubtn//8Z5YsWZJddtnFLCUAANjMLVy4MFtuuWWWLVuWv//979lnn33qnZ8zZ0622WablEqlvPLKK9lzzz2TLA+hbrjhhvTq1St/+ctf6vUZOXJkevbsmcrKykyfPj3bbbfdR9ZRKpUyd+7cbLXVVg2e/9GPfpT/+q//ylZbbZW33357pXvEPvHEEznyyCM3yxlKm+XOuUuXLs3SpUvTtm3b9V0KbNKqq6tTU1OT999/f32XAgAArGdLliwpPwzrg7OC6my11Vbl1Q113yFKpVLuvffeJEm/fv1W6NOjR4/sscceWbp0aYYNG7ZKdVRUVDQaJiXLl7slywOut956a5XG3BxtloFS3X/AzZs3X8+VwKatbl1ybW3teq4EAABY39q3b58uXbokWT6z6MNeffXVvPPOO2nfvn122223JMm0adMyc+bMJEnPnj0bHLfu+KhRo5qkzsWLF5d/tkVO4zbLQKmOJTiwdvmMAQAAH3T55ZcnSfr27Zs//OEPeeeddzJv3rz85S9/yRe/+MVUVFRk8ODB5c2wJ0yYkCSpqqrKDjvs0OCYdbOd6tquqbvuuitJ8vGPf7zwA8A2J5vtptwAAADAunXmmWembdu2GTRoUE4++eR65/bdd988+OCD+dznPlc+NmfOnCTLZzc19g/WdcvX6tquiXHjxuWGG25IkgwYMGCNx9uUbdYzlAAAAIB1p1QqZdKkSXnnnXfSvHnzdO/ePXvttVdatmyZcePG5aabbsq7775bbl+3/Kxly5aNjllVVZUkWbRo0RrVNnfu3Jx00klZsmRJjj/++JxxxhlrNN6mTqAEAAAArBPnn39++vfvny5dumTixImZMGFCXn755UyfPj3HH3987r333hx55JHlfVjrlr4tWbKk0TFramqSrNl+RzU1NfniF7+Y1157LXvvvXd+85vfrPZYmwuBEgAAALDWjR07NjfffHMqKytz5513pmvXruVzHTt2zNChQ9OhQ4f8/e9/L+9jVLecbe7cuSmVSg2OW7fUbWVPbluZ999/P//2b/+WJ598Ml27ds3DDz+82mNtTgRKAAAAwFo3YsSIlEqlfOxjHys/7e2D2rVrl4MPPjhJ8txzzyVJ+WlvNTU1mTFjRoPjTpo0qV7bIkqlUs4555wMGzYs22+/fR599NFGN/+mPoESAAAAsNa99957H9mmbhZS3d5JO+20Uzp16pRkeSDVkLrjhxxySOGavvnNb+Y3v/lNttlmmzzyyCPZddddC4+xuRIosV4MHz48FRUV5dff/va31R7r8ssvL4+z5ZZbZuHChavUb+DAgfVqqHtVVVWlY8eO2W233XL88cfn0ksvXaP6GrtOkdfZZ5+9wrgvvPBCvvnNb2b//fdP+/bt07Jly2y33XbZZ599csIJJ+Sqq67K008/naVLl67Qd8qUKY1eq6qqKttvv32OOeaY/O///m/mzZu32vcOAABQp24G0WuvvZbp06evcH7+/PkZPXp0kuRjH/tYkqSioiJ9+vRJktxyyy0r9Bk5cmTGjx+fysrKnHjiiYXq+f73v58bbrghW265ZR566KHsvffehfpv7lqs7wI2Bl3/60/ru4S1aspVJ6zza95+++0r/H7YYYet1li//vWvyz8vWLAg99xzT7761a+udm1LlizJW2+9lbfeeisTJ07Mn//85wwaNCh77rlnfvCDH+SUU05Z7bGbQm1tbb797W/nhhtuWGEN8ezZszN79uyMGzcuDz74YJLkxhtvzPnnn7/K4y9ZsiSzZs3KrFmz8uijj+bqq6/O73//+3zqU59q0vsAAAA2L7169UqHDh3y9ttv57TTTsvQoUPL+yjNnj07/fr1y9tvv51WrVrl5JNPLvfr379/brnlljz88MMZMmRILrzwwlRUVGTq1Knp27dvkuTcc88tz2Sq8/vf/z4XXnhhdtxxxwwfPrzeuR//+Me54oor0rp16/zxj3/MJz/5ybV785ug1Q6UZs+encGDB+fPf/5zJk+enGXLlqVz5845+uijM2DAgHTv3r3Bfk8//XSuuuqqjBw5MgsWLMguu+yS008/Pf379y/v3s6mraamJnfffXeSpG3btlmwYEHuvvvu/PSnPy28K/8zzzyT1157rd5Yt99+e+FA6dZbb81BBx2UZPkUy3nz5uWtt97K6NGj88c//jEvvfRS/vGPf+TUU09N3759c/PNN6dZs1Wb4HfBBRfU+z/DDxo9enT5/wC//vWv54ILLmiw3Qc3hPvWt76VG264IUmy/fbb57zzzkuPHj2y7bbbZtGiRZkyZUqefvrpDBs2LNOmTfvI+nr37p3LL7+8/PvixYszfvz4/L//9//yzDPPZMaMGTnhhBPy8ssvZ/vtt1+lewYAAPiwtm3b5vbbb8+XvvSljBw5Mt27d0+3bt1SWVmZiRMnZsmSJWnRokV+9rOfpXPnzuV+u+yyS26++eacc84
|
2025-03-17 16:40:01 +08:00
|
|
|
"text/plain": [
|
|
|
|
"<Figure size 1200x900 with 1 Axes>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# 提取EoH-TSP和AAD-TSP的运行时间数据\n",
|
|
|
|
"selected_algos = ['EoH-TSP', 'AAD-TSP']\n",
|
|
|
|
"df_selected = df_time[selected_algos]\n",
|
|
|
|
"\n",
|
|
|
|
"# 设置matplotlib支持中文显示\n",
|
|
|
|
"plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签\n",
|
|
|
|
"plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号\n",
|
|
|
|
"plt.rcParams['font.size'] = 16 # 设置更大的字号\n",
|
|
|
|
"\n",
|
|
|
|
"# 创建柱状图\n",
|
|
|
|
"plt.figure(figsize=(12, 9))\n",
|
|
|
|
"bar_width = 0.5\n",
|
|
|
|
"x = np.arange(len(df_selected.index))\n",
|
|
|
|
"\n",
|
|
|
|
"# 绘制柱状图\n",
|
|
|
|
"bars1 = plt.bar(x - bar_width/2, df_selected['EoH-TSP'], bar_width, label='AAD-TSP')\n",
|
|
|
|
"bars2 = plt.bar(x + bar_width/2, df_selected['AAD-TSP'], bar_width, label='EoH-TSP')\n",
|
|
|
|
"\n",
|
|
|
|
"# 在柱形上添加数值标注\n",
|
|
|
|
"for bars in [bars1, bars2]:\n",
|
|
|
|
" for bar in bars:\n",
|
|
|
|
" height = bar.get_height()\n",
|
|
|
|
" plt.text(bar.get_x() + bar.get_width()/2., height,\n",
|
|
|
|
" f'{height:.2f}',\n",
|
|
|
|
" ha='center', va='bottom',fontsize=16)\n",
|
|
|
|
"\n",
|
|
|
|
"# 设置图表属性\n",
|
|
|
|
"# plt.xlabel('测试实例')\n",
|
|
|
|
"# plt.title('在不同实例上的运行时间')\n",
|
|
|
|
"plt.xticks(x, df_selected.index, rotation=45,fontsize=20)\n",
|
|
|
|
"plt.legend(fontsize=20)\n",
|
|
|
|
"\n",
|
|
|
|
"# 调整布局避免标签被截断\n",
|
|
|
|
"plt.tight_layout()\n",
|
|
|
|
"plt.savefig('tsp_time.png',dpi=300)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2025-05-13 15:46:02 +08:00
|
|
|
"execution_count": 5,
|
2025-03-17 16:40:01 +08:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"name": "stdout",
|
|
|
|
"output_type": "stream",
|
|
|
|
"text": [
|
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: GR96.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.2226秒, 路径长度:629.57\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: XIT1083.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:169.8405秒, 路径长度:4018.53\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: RBU737.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:60.1185秒, 路径长度:3735.38\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: ulysses16.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.0236秒, 路径长度:74.00\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"测试实例: PBK411.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:8.7138秒, 路径长度:1544.15\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
|
|
|
"测试实例: PR76.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"执行时间:0.1272秒, 路径长度:120233.54\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"测试实例: CHN144.tsp\n",
|
2025-03-17 16:40:01 +08:00
|
|
|
"\n",
|
2025-05-13 15:46:02 +08:00
|
|
|
"使用算法: test\n",
|
|
|
|
"执行时间:0.4914秒, 路径长度:33138.13\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: eil76.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
|
|
|
"执行时间:0.1449秒, 路径长度:588.83\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: eil101.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
|
|
|
"执行时间:0.2218秒, 路径长度:693.38\n",
|
|
|
|
"\n",
|
|
|
|
"测试实例: ulysses8.tsp\n",
|
|
|
|
"\n",
|
|
|
|
"使用算法: test\n",
|
|
|
|
"执行时间:0.0171秒, 路径长度:37.83\n",
|
|
|
|
"\n",
|
|
|
|
"算法在各个实例上的表现:\n",
|
|
|
|
"\n",
|
|
|
|
"test:\n",
|
|
|
|
" GR96.tsp: 路径长度 = 629.57\n",
|
|
|
|
" XIT1083.tsp: 路径长度 = 4018.53\n",
|
|
|
|
" RBU737.tsp: 路径长度 = 3735.38\n",
|
|
|
|
" ulysses16.tsp: 路径长度 = 74.00\n",
|
|
|
|
" PBK411.tsp: 路径长度 = 1544.15\n",
|
|
|
|
" PR76.tsp: 路径长度 = 120233.54\n",
|
|
|
|
" CHN144.tsp: 路径长度 = 33138.13\n",
|
|
|
|
" eil76.tsp: 路径长度 = 588.83\n",
|
|
|
|
" eil101.tsp: 路径长度 = 693.38\n",
|
|
|
|
" ulysses8.tsp: 路径长度 = 37.83\n",
|
|
|
|
" GR96.tsp: 执行时间 = 0.2226秒\n",
|
|
|
|
" XIT1083.tsp: 执行时间 = 169.8405秒\n",
|
|
|
|
" RBU737.tsp: 执行时间 = 60.1185秒\n",
|
|
|
|
" ulysses16.tsp: 执行时间 = 0.0236秒\n",
|
|
|
|
" PBK411.tsp: 执行时间 = 8.7138秒\n",
|
|
|
|
" PR76.tsp: 执行时间 = 0.1272秒\n",
|
|
|
|
" CHN144.tsp: 执行时间 = 0.4914秒\n",
|
|
|
|
" eil76.tsp: 执行时间 = 0.1449秒\n",
|
|
|
|
" eil101.tsp: 执行时间 = 0.2218秒\n",
|
|
|
|
" ulysses8.tsp: 执行时间 = 0.0171秒\n"
|
2025-03-17 16:40:01 +08:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"# 用于存储算法结果\n",
|
|
|
|
"test_results = {}\n",
|
|
|
|
"test_time = {}\n",
|
|
|
|
"\n",
|
|
|
|
"# 遍历测试实例\n",
|
|
|
|
"for test_case in test_files:\n",
|
|
|
|
" print(f\"\\n测试实例: {test_case}\")\n",
|
|
|
|
" \n",
|
|
|
|
" # 加载数据\n",
|
|
|
|
" dist_matrix = load_tsp_data(test_case)\n",
|
|
|
|
" if dist_matrix is None:\n",
|
|
|
|
" continue\n",
|
|
|
|
" \n",
|
|
|
|
" # 仅测试单个算法\n",
|
|
|
|
" test_algo = {\n",
|
|
|
|
" \"test\": tsp_05 # 这里可以改成想测试的其他算法\n",
|
|
|
|
" }\n",
|
|
|
|
" \n",
|
|
|
|
" # 评估算法\n",
|
|
|
|
" for algo_name, algo_func in test_algo.items():\n",
|
|
|
|
" print(f\"\\n使用算法: {algo_name}\")\n",
|
|
|
|
" path_length, exec_time = evaluate_tsp(algo_func, dist_matrix)\n",
|
|
|
|
" \n",
|
|
|
|
" if algo_name not in test_results:\n",
|
|
|
|
" test_results[algo_name] = {}\n",
|
|
|
|
" if algo_name not in test_time:\n",
|
|
|
|
" test_time[algo_name] = {}\n",
|
|
|
|
" \n",
|
|
|
|
" test_results[algo_name][test_case] = path_length\n",
|
|
|
|
" test_time[algo_name][test_case] = exec_time\n",
|
|
|
|
"\n",
|
|
|
|
"# 打印结果\n",
|
|
|
|
"print(\"\\n算法在各个实例上的表现:\")\n",
|
|
|
|
"for algo_name, scores in test_results.items():\n",
|
|
|
|
" print(f\"\\n{algo_name}:\")\n",
|
|
|
|
" for test_case, score in scores.items():\n",
|
|
|
|
" print(f\" {test_case}: 路径长度 = {score:.2f}\")\n",
|
|
|
|
" for test_case, etime in test_time[algo_name].items():\n",
|
|
|
|
" print(f\" {test_case}: 执行时间 = {etime:.4f}秒\")"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"kernelspec": {
|
|
|
|
"display_name": "lead",
|
|
|
|
"language": "python",
|
|
|
|
"name": "python3"
|
|
|
|
},
|
|
|
|
"language_info": {
|
|
|
|
"codemirror_mode": {
|
|
|
|
"name": "ipython",
|
|
|
|
"version": 3
|
|
|
|
},
|
|
|
|
"file_extension": ".py",
|
|
|
|
"mimetype": "text/x-python",
|
|
|
|
"name": "python",
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
"version": "3.11.11"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|