dagshortpath.html
来自「数据结构词典(英文)」· HTML 代码 · 共 46 行
HTML
46 行
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>DAG shortest paths</TITLE>
<META name="description"
content="Definition of DAG shortest paths,
possibly with links to more information and implementations.">
<META name="keywords" content="DAG shortest paths">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>DAG shortest paths</H1>
<P>
(algorithm)
<P>
<strong>Definition:</strong>
Solve the <a href="singlsrcshrt.html" tppabs="http://hissa.nist.gov/dads/HTML/singlsrcshrt.html"><em>single-source shortest-path problem</em></a> in a <a href="weightgraph.html" tppabs="http://hissa.nist.gov/dads/HTML/weightgraph.html"><em>weighted</em></a> <a href="diracygraf.html" tppabs="http://hissa.nist.gov/dads/HTML/diracygraf.html"><em>directed acyclic graph</em></a> by 1) doing a <a href="topologcsort.html" tppabs="http://hissa.nist.gov/dads/HTML/topologcsort.html"><em>topological sort</em></a> on the <a href="vertex.html" tppabs="http://hissa.nist.gov/dads/HTML/vertex.html"><em>vertices</em></a> by <a href="edge.html" tppabs="http://hissa.nist.gov/dads/HTML/edge.html"><em>edge</em></a> so vertices with no incoming <a href="edge.html" tppabs="http://hissa.nist.gov/dads/HTML/edge.html"><em>edges</em></a> are first and vertices with only incoming <a href="edge.html" tppabs="http://hissa.nist.gov/dads/HTML/edge.html"><em>edges</em></a> are last, 2) assign an infinite distance to every vertex (dist(v)= <img src="infty.gif" tppabs="http://hissa.nist.gov/dads/HTML/Images/infty.gif" border=0 height=6 width=13 alt="infinity">) and a zero distance to the source, and 3) for each vertex v in sorted order, for each outgoing edge e(v,u), if dist(v) + weight(e) < dist(u), set dist(u)=dist(v) + weight(e) and the predecessor of u to v.
<P><strong>See also</strong>
<a href="dijkstraalgo.html" tppabs="http://hissa.nist.gov/dads/HTML/dijkstraalgo.html"><em>Dijkstra's algorithm</em></a>, <a href="bellmanford.html" tppabs="http://hissa.nist.gov/dads/HTML/bellmanford.html"><em>Bellman-Ford algorithm</em></a>.
<P>Author: <a href="terms.html#authorPEB" tppabs="http://hissa.nist.gov/dads/terms.html#authorPEB">PEB</a>
<hr>
Go to the
<A HREF="terms.html" tppabs="http://hissa.nist.gov/dads/terms.html">Algorithms, Data Structures, and Problems</A>
home page.
<hr>
If you have suggestions, corrections, or comments, please get in touch
with
<a href="javascript:if(confirm('http://hissa.nist.gov/~black/black.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://hissa.nist.gov/~black/black.html'" tppabs="http://hissa.nist.gov/~black/black.html">Paul E. Black</a>
(<a href="mailto:paul.black@nist.gov">paul.black@nist.gov</a>).
<p>
Entry modified Thu Sep 30 10:55:39 1999.<BR>
HTML page formatted Wed Dec 22 09:35:04 1999.
<P>
This page's URL is
<A href="dagShortPath.html" tppabs="http://hissa.nist.gov/dads/HTML/dagShortPath.html">http://hissa.nist.gov/dads/HTML/dagShortPath.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?