【问题标题】:Optaplanner: Meta Heuristic and Brute Force Solution do not match even if enough time is given to MHOptaplanner:即使给 MH 足够的时间,元启发式和蛮力解决方案也不匹配
【发布时间】:2018-02-04 09:24:53
【问题描述】:

我的理解是蛮力总是会给出最好的解决方案,但不会扩展。而元启发式将在一定的时间限制内提供最好的。含义如果给定足够的时间,它应该与蛮力解决方案相匹配。

但是,在我的实现中并没有发生。我通过蛮力算法得到了最好的解决方案,但即使我给了足够的时间,MH 也不一样。可能是什么原因。我认为我能想到的原因是 MH 陷入了局部最大值。但是,我试图从我的理解中避免这种情况。

我不分享实现,因为它很复杂。如果需要将分享代码。

更新:

我的 MoveSelector 配置-

<?xml version="1.0" encoding="UTF-8"?>
<solver>
  <!-- Domain model configuration -->
  <solutionClass>com.example.CutSolution</solutionClass>
  <entityClass>com.example.Size</entityClass>


  <!-- Score configuration -->
  <scoreDirectorFactory>
    <easyScoreCalculatorClass>com.example.CutplanEasyScoreCalculator</easyScoreCalculatorClass>
  </scoreDirectorFactory>

  <constructionHeuristic>
    <constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
  </constructionHeuristic>
  <localSearch>
    <termination>
      <unimprovedSecondsSpentLimit>10</unimprovedSecondsSpentLimit>
    </termination>
    <unionMoveSelector>
      <changeMoveSelector/>
      <swapMoveSelector/>
      <pillarChangeMoveSelector/>
      <pillarSwapMoveSelector/>
    </unionMoveSelector>
    <acceptor>
      <entityTabuRatio>0.02</entityTabuRatio>
    </acceptor>
    <forager>
      <acceptedCountLimit>1000</acceptedCountLimit>
    </forager>
  </localSearch>
</solver>

我只有一个计划实体和一个计划变量。

谢谢。

【问题讨论】:

    标签: optaplanner drools-planner


    【解决方案1】:

    确实可能陷入局部最优。添加额外的移动选择器来帮助它解开通常是最好的解决方案。

    这种卡住更多发生在小型数据集上(缩减)。 Metaheuristics 擅长放大,但是 - 只有普通的移动选择器 - 在某些情况下它不能很好地缩小。

    【讨论】:

    • 我已经用我的移动选择器配置更新了问题。你能帮我正确配置吗?
    • 关于数据集大小,我的计划变量从 4-13 不等,计划实体从 4-16 不等。所以,搜索空间的最大大小是 13^16,这对于蛮力来说太大了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 2015-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-01
    相关资源
    最近更新 更多