前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >开源ALNS 自适应大邻域搜索(Adaptive Large Neighborhood Search)

开源ALNS 自适应大邻域搜索(Adaptive Large Neighborhood Search)

作者头像
CreateAMind
发布2019-12-23 17:56:59
1.9K0
发布2019-12-23 17:56:59
举报
文章被收录于专栏:CreateAMind

https://github.com/N-Wouda/ALNS

This package offers a general, well-documented and tested implementation of the adaptive large neighbourhood search (ALNS) meta-heuristic, based on the description given in Pisinger and Ropke (2010). It may be installed in the usual way as,

代码语言:javascript
复制
pip install alns

How to use

The alns package exposes two classes, ALNS and State. The first may be used to run the ALNS algorithm, the second may be subclassed to store a solution state - all it requires is to define an objective member function.

The ALNS algorithm must be supplied with an acceptance criterion, to determine the acceptance of a new solution state at each iteration. An overview of common acceptance criteria is given in Santini et al. (2018). Several have already been implemented for you, in alns.criteria,

  • HillClimbing. The simplest acceptance criterion, hill-climbing solely accepts solutions improving the objective value.
  • RecordToRecordTravel. This criterion only accepts solutions when the improvement meets some updating threshold.
  • SimulatedAnnealing. This criterion accepts solutions when the scaled probability is bigger than some random number, using an updating temperature.

Each acceptance criterion inherits from AcceptanceCriterion, which may be used to write your own.

Examples

The examples/ directory features some example notebooks showcasing how the ALNS library may be used. Of particular interest are,

  • The travelling salesman problem (TSP), here. We solve an instance of 131 cities to within 2.1% of optimality, using simple destroy and repair heuristics with a post-processing step.
  • The cutting-stock problem (CSP), here. We solve an instance with 180 beams over 165 distinct sizes to within 1.35% of optimality in only a very limited number of iterations.

References

  • Pisinger, D., and Ropke, S. (2010). Large Neighborhood Search. In M. Gendreau (Ed.), Handbook of Metaheuristics (2 ed., pp. 399-420). Springer.
  • Santini, A., Ropke, S. & Hvattum, L.M. (2018). A comparison of acceptance criteria for the adaptive large neighbourhood search metaheuristic. Journal of Heuristics 24 (5): 783-815.
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2019-12-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 CreateAMind 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • How to use
    • Examples
    • References
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档