weixin_39758953
weixin_39758953
2021-01-06 23:21

Update dominated_indices in greedy.py

Previously, the condition is if all(v>=w). Suppose that the vectors are just scalars and there are two minimal value v1 and v2. Now, because v1 >= v2 and v2 >= v1, they are both added to dominated_indices. This means that the corresponding swap candidates both won't be considered. Additionally for any w >= v1 = v2, the corresponding swap candidate for w won't be considered. In the end, this means that none the swap candidates will be considered. In stead, the algorithm falls back everytime on bring_farthest_pair_together.

该提问来源于开源项目:quantumlib/Cirq

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39560066 weixin_39560066 4月前

    It's not clear to me that this is always better, though it might be. Let's make it an option: introduce a strict_cmp: bool argument to _get_dominated_indices and attribute to GreedyRouter.

    点赞 评论 复制链接分享
  • weixin_39929595 weixin_39929595 4月前

    any opinion here?

    点赞 评论 复制链接分享
  • weixin_39833270 weixin_39833270 4月前

    I didn't have a chance to use this code yet but having another option to tune the heuristic is something that I would definitely appreciate very much.

    点赞 评论 复制链接分享
  • weixin_39949954 weixin_39949954 4月前

    Hi - are you planning to work on this still? In case yes, would you mind adding a parameter to tune the heuristic as suggested by and ? Also a test case covering it would be great.

    点赞 评论 复制链接分享
  • weixin_39929595 weixin_39929595 4月前

    It seems like this has stalled out. I'm going to close, but if there is a desire to revive this, please reopen.

    点赞 评论 复制链接分享

相关推荐