当前位置: 首页 > news >正文

3网站建设公司怎样建设责任文化

3网站建设公司,怎样建设责任文化,稳定的网站建设,佛山现在什么网络推广好在解决相关的TSP,VRP,PDP等方法中使用启发式算法中,需要借用初始解的有以下方法: 0. 算法简介 0.1 TS: 禁忌搜索算法 禁忌搜索算法(TS)搞懂什么是禁忌搜索算法Tabu Search【附应用举例】 0.2 GA:遗传算法 构造初始种群(100个) → \to →种群根据适应…

在解决相关的TSP,VRP,PDP等方法中使用启发式算法中,需要借用初始解的有以下方法:

0. 算法简介

0.1 TS: 禁忌搜索算法

  • 禁忌搜索算法(TS)
  • 搞懂什么是禁忌搜索算法Tabu Search【附应用举例】

0.2 GA:遗传算法

构造初始种群(100个) → \to 种群根据适应度适者生存 → \to 种群的发展:交叉+突变 → \to 保留有效基因,提高适应度,从而逼近最优解.

  • [基因遗传算法]原理思想和python代码的结合理解之(一) :单变量
  • 遗传算法原理及其python实现

0.3 SA: 模拟退化算法

  • 模拟退火算法(SA)

0.4 DPSO:粒子群算法

  • 最优化算法之粒子群算法(PSO)

0.5 ALNS: 自适应大领域算法

单个初始解–破坏+修复–>新解,计算obj值不断的优化

  • 自适应大领域搜索算法(ALNS) 详解及python示例
0.6 ACO:蚁群算法
  • 蚁群算法java实现以及TSP问题蚁群算法求解

一、 初始解的构造

1.1随机构造法

demand_id_list=np.arange(10) 
random.shuffle(demand_id_list) 

在这里插入图片描述

1. 2. 插入法

  • 原文:《求解PDPTW问题的快速LNS》

设L LL为所有未安排的客户集合。(或:未拜访过的站点集合)
对每个未安排的客户,找出它在当前构造的解中插入代价最小的客户,将其插入当前解中,如果是第一个客户或者没有可行插入位置,则新安排一辆车给此客户
从L LL中删除被插入的客户。
如果L为空,停止;否则跳转到步骤2

LNS中破坏和修复,其修复过程也可以看作是插入节点的过程.如何插入可以快速得到最优解则是快速LNS的核心. 有点类同于ALNS.

二、解的解码

2.1 分割法

看Better.C所提供的方法

2.2 导弹发射算法

2.3 快速插入法

####2opt局部搜索

import randomfrom utils import distance_matrix, objclass LocalSearch():def __init__(self):passdef solve(self, points):num = len(points)distance_matrix_ = distance_matrix(points, num)current_solution = [i for i in range(num)]random.shuffle(current_solution)current_distance = obj(points, current_solution)while True:best_length = 100000000best_solution = []for index1 in range(num - 1):for index2 in range(index1 + 1, num - 1):temp_solution, temp_distance = self.one_step(num, current_solution, distance_matrix_,current_distance, index1, index2)if temp_distance < best_length:best_length = temp_distancebest_solution = [temp_solution]elif temp_distance == best_length:best_solution.append(temp_solution)if best_length >= current_distance:breakelse:# print(best_length)current_distance = best_lengthcurrent_solution = random.sample(best_solution, 1)[0]return current_solutiondef one_step(self, num, current_solution, distance_matrix, current_distance, index1, index2):a = current_solution[:index1]b = current_solution[index1:index2 + 1][::-1]c = current_solution[index2 + 1:]new_solution = a + b + cnew_distance = current_distance - distance_matrix[current_solution[(index1 - 1) % num]][current_solution[index1]] - distance_matrix[current_solution[index2]][current_solution[(index2 + 1) % num]] + \distance_matrix[current_solution[(index1 - 1) % num]][current_solution[index2]] + \distance_matrix[current_solution[index1]][current_solution[(index2 + 1) % num]]return new_solution, new_distance

ddd


def distance_matrix(points, num):distance_matrix = np.zeros([num, num])for i in range(num):for j in range(num):distance_matrix[i][j] = length(points[i], points[j])return distance_matrixdef obj(points, solution):obj = length(points[solution[-1]], points[solution[0]])for index in range(0, len(points) - 1):obj += length(points[solution[index]], points[solution[index + 1]])return obj
http://www.dtcms.com/a/508302.html

相关文章:

  • 网站开发实战框架网站建设
  • w3c网站模板可视化app开发工具
  • Orleans 可观测性实战:基于源码的指标与分布式追踪(含 Prometheus 集成)
  • 成都 企业网站设计天眼查询企业信息电话
  • 肥料网站建设 中企动力网站企业备案和个人备案的区别吗
  • 用coze工作流生成软著申请材料
  • 【SAP FI】3.资产会计_3.固定资产模块的基本业务操作-资产价值浏览器折旧
  • 力扣(LeetCode) ——118.杨辉三角(C++)
  • 媒体发布的技术革命:Infoseek如何用AI重构企业传播全链路
  • docker拉镜像失败终极解决方案
  • 自己建设网站要花多少钱wordpress really static
  • 如何在百度推广网站大连工业大学专升本
  • 英语单词中有趣的颠倒与学习
  • vue实现模拟deepseekAI功能
  • html网站开发例子wordpress 远程附件
  • 在线心理健康网站建设杨凌做网站
  • Git将本地项目推送到GitLab
  • 廊坊网站建设公司哪个好北京微信网站设计报价
  • wordpress搜索返回页面内容优化seo公司哪家好
  • Termux 安装盘搜搜PanSou,快速找到网盘资源链接,支持各大网盘,自定义部署,数据存储到手机,打造移动搜索资源库
  • Foundation 网格实例
  • 股票300394(天孚通信)2025年4月20日
  • 公司网站怎么做啊ui设计行业的现状和发展前景
  • 专门做图片是网站深圳百度首页优化
  • 清镇网站建设推广科技感网站设计
  • GEO内容更新与迭代策略:长青内容vs时效内容的平衡
  • 专业网站优化推广医疗网站设计风格
  • 贵州毕节建设局网站官网网络营销策略包括哪些方面
  • Hugging Face 2025年10月20日 Top 10 热门AI模型
  • C#基础——GC(垃圾回收)的工作流程与优化策略