计算机科学 > 数据结构与算法
[提交于 2012年3月22日]
标题:A simpler and more efficient algorithm for the next-to-shortest path problem
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Given an undirected graph $G=(V,E)$ with positive edge lengths and two vertices $s$ and $t$, the next-to-shortest path problem is to find an $st$-path which length is minimum amongst all $st$-paths strictly longer than the shortest path length. In this paper we show that the problem can be solved in linear time if the distances from $s$ and $t$ to all other vertices are given. Particularly our new algorithm runs in $O(|V|\log |V|+|E|)$ time for general graphs, which improves the previous result of $O(|V|^2)$ time for sparse graphs, and takes only linear time for unweighted graphs, planar graphs, and graphs with positive integer edge lengths.
提交历史
来自:Bang Ye Wu[v1] 2012年3月22日 星期四 00:00:00 UTC