We present an improved solution to the Weighted Job Scheduling (WJS) problem. While the classical dynamic programming (DP) solution for $n$ jobs runs in $O(n \log(n))$ time due to comparison-based sorting and per-job binary search, we eliminate the binary search bottleneck. In its place, we introduce a novel multi-phase preprocessing technique called \emph{Global Predecessor Indexing (GPI)}, which computes the latest non-overlapping job (i.e., the predecessor) for all jobs via a two-pointer linear-time pass after sorting. This yields a time complexity of $O(S(n) + n)$ where $S(n)$ is the time to sort all jobs. GPI enables direct use in the classical DP recurrence. When combined with linear-time sorting, GPI yields a complete $O(n)$ solution. Even with comparison-based sorting, GPI significantly outperforms the classical solution in practice by avoiding repeated binary searches in favor of the more cache-efficient extra sort and two-pointer pass.


翻译:我们提出了一种针对加权作业调度问题的改进解决方案。虽然针对 $n$ 个作业的经典动态规划解决方案由于基于比较的排序和每个作业的二分查找而具有 $O(n \log(n))$ 的时间复杂度,但我们消除了二分查找这一瓶颈。取而代之,我们引入了一种新颖的多阶段预处理技术,称为 \emph{全局前驱索引}。该技术在排序后,通过一次双指针线性时间遍历,为所有作业计算其最新的非重叠作业。这实现了 $O(S(n) + n)$ 的时间复杂度,其中 $S(n)$ 是对所有作业进行排序所需的时间。GPI 使得经典动态规划递推式可以直接使用。当与线性时间排序结合时,GPI 产生了一个完整的 $O(n)$ 解决方案。即使在基于比较的排序下,GPI 在实践中也显著优于经典解决方案,因为它避免了重复的二分查找,转而采用缓存效率更高的额外排序和双指针遍历。

0
下载
关闭预览

相关内容

FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
163+阅读 · 2019年10月12日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Arxiv
10+阅读 · 2024年3月11日
Arxiv
34+阅读 · 2022年12月20日
Deep Learning in Video Multi-Object Tracking: A Survey
Arxiv
58+阅读 · 2019年7月31日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
相关论文
Arxiv
10+阅读 · 2024年3月11日
Arxiv
34+阅读 · 2022年12月20日
Deep Learning in Video Multi-Object Tracking: A Survey
Arxiv
58+阅读 · 2019年7月31日
相关基金
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员