Pyrite: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>ClueBot NG
m Reverting possible vandalism by 168.216.106.27 to version by Vsmith. False positive? Report it. Thanks, ClueBot NG. (1679033) (Bot)
en>Materialscientist
m Reverted edits by 72.226.41.121 (talk) to last version by Widr
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Distinguish|Dykstra's projection algorithm}}
== not for others ==


{{more footnotes|date=September 2012}}
Somewhat similar, but from a certain extent, this is a part of the General Assembly refining 'medicine' mainland real division between the top level.<br><br>by this Assembly, that is to let people get to know, who is ranked first on the continent today refining 'medicine' division!<br><br>able to participate in 'medicine' typical person, in addition to the 'medicine' family of the tribe, as well as some had [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-1.html カシオ 腕時計 バンド] or now has a great reputation and high refining 'medicine' technique of refining 'medicine' guru on the Plains, also can be invited, but this number is generally invited to very few people, after all, can be 'medicine' family fancy eye refining 'medicine' division, on the mainland, but also [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-4.html カシオ 電波ソーラー時計] the Phoenix 'gross' Linjiao like existence.<br><br>But anyway, it does not prevent the 'medicine' typical grand, not for others, just because that continent first refining 'medicine' division [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-11.html カシオ腕時計 g-shock] title!<br><br>stars fell Court from [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-7.html casio 腕時計 説明書] the 'medicine' Shennong Mountain where the family very far, [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-8.html 時計 メンズ カシオ] but Xiao Yan duo
{{Infobox algorithm
相关的主题文章:
|class=[[Search algorithm]]
<ul>
|image=[[Image:Dijkstra Animation.gif|Dijkstra's algorithm runtime]]
 
|caption = Dijkstra's algorithm. It picks the unvisited vertex with the lowest-distance, calculates the distance through it to each unvisited neighbor, and updates the neighbor's distance if smaller. Mark visited (set to red) when done with neighbors.
  <li>[http://cgi.www5c.biglobe.ne.jp/~hani/yybbs/yybbs.cgi http://cgi.www5c.biglobe.ne.jp/~hani/yybbs/yybbs.cgi]</li>
|data=[[Graph (data structure)|Graph]]
 
|time= <math>O(|E| + |V| \log|V|)</math>
  <li>[http://tltkzy.com/plus/feedback.php?aid=17 http://tltkzy.com/plus/feedback.php?aid=17]</li>
|best-time=
 
|average-time=
  <li>[http://support-arb.com/showthread.php?4470-crashing-is-a-deep-muffled-explosion-in-the-brain-XiaoYan&p=8003#post8003 http://support-arb.com/showthread.php?4470-crashing-is-a-deep-muffled-explosion-in-the-brain-XiaoYan&p=8003#post8003]</li>
|space=
 
|optimal=
</ul>
|complete=
}}
{{graph search algorithm}}


'''Dijkstra's algorithm''', conceived by [[computer scientist]] [[Edsger W. Dijkstra|Edsger Dijkstra]] in 1956 and published in 1959,<ref name="Dijkstra Interview">{{cite journal|last=Dijkstra|first=Edsger|coauthors=Thomas J. Misa, Editor|title=An Interview with Edsger W. Dijkstra|journal=Communications of the ACM|date=August 2010|month=08|volume=53|issue=8|pages=41–47|accessdate=2010-08-12|quote=What is the shortest way to travel from Rotterdam to Groningen? It is the algorithm for the shortest path which I designed in about 20 minutes.  One morning I was shopping with my young fiancée, and tired, we sat down on the café terrace to drink a cup of coffee and I was just thinking about whether I could do this, and I then designed the algorithm for the shortest path.|doi=10.1145/1787234.1787249}}</ref><ref>{{harvnb|Dijkstra|1959}}</ref> is a [[graph search algorithm]] that solves the single-source [[shortest path problem]] for a [[graph (mathematics)|graph]] with non-negative [[edge (graph theory)|edge]] path costs, producing a [[shortest path tree]]. This algorithm is often used in [[routing]] and as a [[subroutine]] in other graph algorithms.
== looking at the broken chest open to the robes ==


For a given source [[vertex (graph theory)|vertex]] (node) in the graph, the algorithm finds the path with lowest cost (i.e. the shortest path) between that vertex and every other vertex. It can also be used for finding costs of shortest paths from a single vertex to a single destination vertex by stopping the algorithm once the shortest path to the destination vertex has been determined. For example, if the vertices of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. As a result, the shortest path first is widely used in network [[routing protocol]]s, most notably [[IS-IS]] and [[OSPF]] (Open Shortest Path First).
, Yunshan face 'color' is gradually cold, chest a shrink, soon suddenly a drum, an impulsive majestic, overwhelming storm surge out, and bear the brunt, and that [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-6.html 電波腕時計 カシオ] is the nearest Xiao Yan!<br><br>series of marching footsteps void, Xiao Yan also pick up behind the wings shake, [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-11.html カシオ腕時計 g-shock] after a good moment, just the kind of momentum built shed, chest Department, [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-7.html カシオソーラー時計] also came the refreshing feeling of tightness.<br><br>cold eyes [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-3.html casio 腕時計 レディース] looked back rapidly Xiao Yan, Yunshan slowly down, looking at the broken chest open to the robes, robes cracked, 'dew' out of its chest, at the moment, a little bit above being printed red boxing India, obviously, this is a previously Xiao Yan stay.<br><br>'Oh, good, very good [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-2.html casio 腕時計 デジタル] ah, to the fight since I Jin cases, you are still left in me first boxing Indian man' looked at the road fist India, Yunshan face is completely cold down , it is the heart of an intention to kill the chill gradually spread out from its body.
相关的主题文章:
<ul>
 
  <li>[http://www.internationalmedialawyers.org/cgi-bin/blog/blosxom.cgi http://www.internationalmedialawyers.org/cgi-bin/blog/blosxom.cgi]</li>
 
  <li>[http://www.ruemorguepress.com/cgi-bin/catsearch.cgi http://www.ruemorguepress.com/cgi-bin/catsearch.cgi]</li>
 
  <li>[http://www.ncdnw.net/bbs/home.php?mod=space&uid=159477 http://www.ncdnw.net/bbs/home.php?mod=space&uid=159477]</li>
 
</ul>


Dijkstra's original algorithm does not use a [[min-priority queue]] and runs in <math>O(|V|^2)</math> (where <math>|V|</math> is the number of vertices). The idea of this algorithm is also given in {{harv|Leyzorek|Gray|Johnson|Ladew|1957}}. The implementation based on a min-priority queue implemented by a [[Fibonacci heap]] and running in <math>O(|E|+|V|\log|V|)</math> (where <math>|E|</math> is the number of edges) is due to {{harv|Fredman|Tarjan|1984}}. This is [[Asymptotic computational complexity|asymptotically]] the fastest known single-source [[shortest path problem|shortest-path algorithm]] for arbitrary [[directed graph]]s with unbounded non-negative weights.
== 'back Gama empire ==


== Algorithm ==
'Clouds, haze, were it seems that old [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-14.html カシオ 時計 電波 ソーラー] bastard Yunshan, really want ruthless ah!' Black eye [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-9.html カシオ 時計 プロトレック] pupil almost been bloodshot, her face 'color' terribly grim, Xiao Yan body trembling rapid surge strong intention to kill filled the room, after a moment, he suddenly stood up, but it was hastily pulled smoked children: '? Xiao Yan brother, you have to go.'<br><br>'back Gama empire! I want cloud-lan everyone buried!' sepulchral voice, with a strong intention to kill and ferocious.<br><br>'You can now go back and die in vain in [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-9.html 電波時計 casio] addition to what is the use? xiaojia now suffering from the disaster, but you still have who can save? if you die, how Xiao Shushu accountable?' askew hideous to see Xiao [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-0.html カシオ 腕時計 チタン] Yan [http://www.ispsc.edu.ph/nav/japandi/casio-rakuten-15.html カシオ 腕時計 激安] look, Kaoru children know, because he is somewhat out of control rage up, the moment hastily loudly.<br><br>'Xiao Yan, you have nothing to say! Brother let me vapid Mania Wanlitiaotiao come find you, not let you
[[Image:Dijkstras progress animation.gif|thumb|Illustration of Dijkstra's algorithm search for finding path from a start node (lower left, red) to a goal node (upper right, green) in a [[robotics|robot]] [[motion planning]] problem. Open nodes represent the "tentative" set. Filled nodes are visited ones, with color representing the distance: the greener, the farther. Nodes in all the different directions are explored uniformly, appearing as a more-or-less circular [[wavefront]] as Dijkstra's algorithm uses a [[consistent heuristic|heuristic]] identically equal to 0.]]
相关的主题文章:
 
<ul>
Let the node at which we are starting be called the '''initial node'''. Let the '''distance of node ''Y''''' be the distance from the '''initial node''' to ''Y''. Dijkstra's algorithm will assign some initial distance values and will try to improve them step by step.
 
 
  <li>[http://www.ciba.org.cn/bbs/forum.php?mod=viewthread&tid=13788&fromuid=7121 http://www.ciba.org.cn/bbs/forum.php?mod=viewthread&tid=13788&fromuid=7121]</li>
# Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all other nodes.
 
# Mark all nodes unvisited. Set the initial node as current. Create a set of the unvisited nodes called the ''unvisited set'' consisting of all the nodes.
  <li>[http://www.windbg.net/forum.php?mod=viewthread&tid=347698 http://www.windbg.net/forum.php?mod=viewthread&tid=347698]</li>
# For the current node, consider all of its unvisited neighbors and calculate their ''tentative'' distances. For example, if the current node ''A'' is marked with a <!--tentative ((commented out because the distance is NOT tentative.. it cannot change while visiting the neighbors.. so calling it tentative implies that it can still change, which is confusing))--> distance of 6, and the edge connecting it with a neighbor ''B'' has length 2, then the distance to ''B'' (through ''A'') will be 6 + 2 = 8.
 
# When we are done considering all of the neighbors of the current node, mark the current node as visited and remove it from the ''unvisited set''. A visited node will never be checked again. <!-- its distance recorded now is final and minimal. ((commented out because the distance is final for the current-node at the point it is taken from the queue.. the distance cannot be dropped while visiting the neighbors.. yet, the current-node remains unvisited until this step.  This is inconsistent and confusing.)) -->
  <li>[http://www.sdxinxi.net/plus/feedback.php?aid=9 http://www.sdxinxi.net/plus/feedback.php?aid=9]</li>
# If the destination node has been marked visited (when planning a route between two specific nodes) or if the smallest tentative distance among the nodes in the ''unvisited set'' is infinity (when planning a complete traversal; occurs when there is no connection between the initial node and remaining unvisited nodes), then stop. The algorithm has finished.
 
# Select the unvisited node that is marked with the smallest tentative distance, and set it as the new "current node" then go back to step 3.
  </ul>
 
== Description ==
:'''''Note:''' For ease of understanding, this discussion uses the terms '''intersection''', '''road''' and '''map''' &mdash; however, formally these terms are '''vertex''', '''edge''' and '''graph''', respectively.''
 
Suppose you would like to find the shortest path between two [[Intersection (road)|intersections]] on a city map, a starting point and a destination.  The order is conceptually simple: to start, mark the distance to every intersection on the map with infinity.  This is done not to imply there is an infinite distance, but to note that  intersection has not yet been ''visited''; some variants of this method simply leave the intersection unlabeled.  Now, at each iteration, select a ''current'' intersection.  For the first iteration, the current intersection will be the starting point and the distance to it (the intersection's label) will be zero.  For subsequent iterations (after the first), the current intersection will be the closest unvisited intersection to the starting point—this will be easy to find.
 
From the current intersection, update the distance to every unvisited intersection that is directly connected to it. This is done by determining the sum of the distance between an unvisited intersection and the value of the current intersection, and [[Graph labeling|relabeling]] the unvisited intersection with this value if it is less than its current value.  In effect, the intersection is relabeled if the path to it through the current intersection is shorter than the previously known paths.  To facilitate shortest path identification, in pencil, mark the road with an arrow pointing to the relabeled intersection if you label/relabel it, and erase all others pointing to it. After you have updated the distances to each [[Neighbourhood (graph theory)|neighboring intersection]], mark the current intersection as ''visited'' and select the unvisited intersection with lowest distance (from the starting point) – or the lowest label—as the current intersection. Nodes marked as visited are labeled with the shortest path from the starting point to it and will not be revisited or returned to.
 
Continue this process of updating the neighboring intersections with the shortest distances, then marking the current intersection as visited and moving onto the closest unvisited intersection until you have marked the destination as visited.  Once you have marked the destination as visited (as is the case with any visited intersection) you have determined the shortest path to it, from the starting point, and can trace your way back, following the arrows in reverse.
 
Of note is the fact that this algorithm makes no attempt to direct "exploration" towards the destination as one might expect.  Rather, the sole consideration in determining the next "current" intersection is its distance from the starting point.  This algorithm, therefore "expands outward" from the starting point, interactively considering every node that is closer in terms of shortest path distance until it reaches the destination.  When understood in this way, it is clear how the algorithm necessarily finds the shortest path, however, it may also reveal one of the algorithm's weaknesses: its relative slowness in some topologies.
 
== Pseudocode ==
 
In the following algorithm, the code <code>u := vertex in ''Q'' with smallest dist[]</code>, searches for the vertex <code><var>u</var></code> in the vertex set <code><var>Q</var></code> that has the least <code>dist[<var>u</var>]</code> value. That vertex is removed from the priority queue <code><var>Q</var></code> and returned to the user. <code>dist_between(<var>u</var>, <var>v</var>)</code> calculates the length between the two neighbor-nodes <code><var>u</var></code> and <code><var>v</var></code>. The variable <code><var>alt</var></code> on lines 20 & 22 is the length of the path from the root node to the neighbor node <code><var>v</var></code> if it were to go through <code><var>u</var></code>. If this path is shorter than the current shortest path recorded for <code><var>v</var></code>, that current path is replaced with this <code><var>alt</var></code> path. The <code>previous</code> array is populated with a pointer to the "next-hop" node on the source graph to get the shortest route to the source.
 
  1  '''function''' Dijkstra(''Graph'', ''source''):
  2      '''for each''' vertex ''v'' in ''Graph'':                                ''// Initializations''
  3          dist[''v'']  := infinity ;                                  ''// Unknown distance function from''
  4                                                                ''// source to v''
  5          previous[''v'']  := undefined ;                            ''// Previous node in optimal path
  6      '''end for'''                                                    ''// from source''
  7     
  8      dist[''source'']  := 0 ;                                        ''// Distance from source to source''
  9      ''Q'' := the set of all nodes in ''Graph'' ;                      ''// All nodes in the graph are''
10                                                                ''// unoptimized – thus are in Q''
11      '''while''' ''Q'' '''is not''' empty:                                      ''// The main loop''
12          ''u'' := vertex in ''Q'' with smallest distance in dist[] ;    ''// Source node in first case''
13          remove ''u'' from ''Q'' ;
14         '''if''' dist[''u''] = infinity:
15              '''break''' ;                                            ''// all remaining vertices are''
16          '''end if'''                                                ''// inaccessible from source''
17         
18          '''for each''' neighbor ''v'' of ''u'':                              ''// where v has not yet been''
19                                                                ''// removed from Q.''
20              ''alt'' := dist[''u''] + dist_between(''u'', ''v'') ;
21              '''if''' ''alt'' < dist[''v'']:                                 ''// Relax (u,v,a)''
22                  dist[''v'']  := ''alt'' ;
23                  previous[''v'']  := ''u'' ;
24                  decrease-key ''v'' in ''Q'';                          ''// Reorder v in the Queue''
25              '''end if'''
26          '''end for'''
27      '''end while'''
28      '''return''' dist;
29  '''endfunction'''
 
If we are only interested in a shortest path between vertices <code><var>source</var></code> and <code><var>target</var></code>, we can terminate the search at line 13 if <code><var>u</var> = <var>target</var></code>.
Now we can read the shortest path from <code><var>source</var></code> to <code><var>target</var></code> by reverse iteration:
 
1  ''S'' := empty sequence
2  ''u'' := ''target''
3  '''while''' previous[''u''] is defined:                              ''// Construct the shortest path with a stack S
4      insert ''u'' at the beginning of ''S''                        ''// Push the vertex into the stack
5      ''u'' := previous[''u'']                                      ''// Traverse from target to source
6  '''end while''' ;
 
Now sequence <code><var>S</var></code> is the list of vertices constituting one of the shortest paths from <code><var>source</var></code> to <code><var>target</var></code>, or the empty sequence if no path exists.
 
A more general problem would be to find all the shortest paths between <code><var>source</var></code> and <code><var>target</var></code> (there might be several different ones of the same length). Then instead of storing only a single node in each entry of <code>previous[]</code> we would store all nodes satisfying the relaxation condition. For example, if both <code><var>r</var></code> and <code><var>source</var></code> connect to <code><var>target</var></code> and both of them lie on different shortest paths through <code><var>target</var></code> (because the edge cost is the same in both cases), then we would add both <code><var>r</var></code> and <code><var>source</var></code> to <code>previous[<var>target</var>]</code>. When the algorithm completes, <code>previous[]</code> data structure will actually describe a graph that is a subset of the original graph with some edges removed. Its key property will be that if the algorithm was run with some starting node, then every path from that node to any other node in the new graph will be the shortest path between those nodes in the original graph, and all paths of that length from the original graph will be present in the new graph. Then to actually find all these shortest paths between two given nodes we would use a path finding algorithm on the new graph, such as [[depth-first search]].
 
===Using a priority queue===
 
A [[min-priority queue]] is an abstract data structure that provides 3 basic operations : <code>add_with_priority()</code>, <code>decrease_priority()</code> and <code>extract_min()</code>. As mentioned earlier, using such a data structure can lead to faster computing times than using a basic queue. Notably, [[Fibonacci heap]] {{harv|Fredman|Tarjan|1984}} or [[Brodal queue]] offer optimal implementations for those 3 operations. As the algorithm is slightly different, we mention it here, in pseudo-code as well :
 
1  '''function''' Dijkstra(''Graph'', ''source''):
2      dist[''source''] := 0                    ''// Initializations
3      '''for each''' vertex ''v'' in ''Graph'':         
4          '''if''' ''v'' ≠ ''source''
5              dist[''v''] := infinity          ''// Unknown distance from source to v
6              previous[''v''] := undefined      ''// Predecessor of v
7          '''end if'''
8          ''PQ''.add_with_priority(''v'',dist[''v''])
9      '''end for'''
10
11
12    '''while''' ''PQ'' is not empty:                ''// The main loop
13        ''u'' := ''PQ''.extract_min()            ''// Remove and return best vertex
14        '''for each''' neighbor v of u:        ''// where v has not yet been removed from PQ.
15            ''alt'' = dist[''u''] + length(''u'', ''v'')
16            '''if''' ''alt'' < dist[''v'']              ''// Relax the edge (u,v)
17                dist[''v''] := ''alt''
18                previous[''v''] := ''u''
19                ''PQ''.decrease_priority(''v'',''alt'')
20            '''end if'''
21        '''end for'''
22    '''end while'''
23    '''return''' previous[]
 
It should be noted that other data structures can be used to achieve even faster computing times in practice.<ref name=chen_07>{{cite book|first1=M.|last1=Chen|first2=R. A.|last2=Chowdhury|first3=V.|last3=Ramachandran|first4=D. L.|last4=Roche|first5=L.|last5=Tong|title=Priority Queues and Dijkstra’s Algorithm &mdash; UTCS Technical Report TR-07-54 &mdash; 12 October 2007|publisher=The University of Texas at Austin, Department of Computer Sciences|location=Austin, Texas|year=2007|url=http://www.cs.sunysb.edu/~rezaul/papers/TR-07-54.pdf|ref=chen}}</ref>
 
== Running time ==
 
An upper bound of the running time of Dijkstra's algorithm on a graph with edges  <math>E</math> and vertices <math>V</math> can be expressed as a function of <math>|E|</math> and <math>|V|</math> using [[Big O notation#Graph theory|big-O notation]].
 
For any implementation of vertex set <math>Q</math> the running time is in <math>O(|E| \cdot dk_Q + |V| \cdot em_Q)</math>, where <math>dk_Q</math> and <math>em_Q</math> are times needed to perform decrease key and extract minimum operations in set <math>Q</math>, respectively.
 
The simplest implementation of the Dijkstra's algorithm stores vertices of set <math>Q</math> in an ordinary linked list or array, and extract minimum from <math>Q</math> is simply a linear search through all vertices in <math>Q</math>. In this case, the running time is <math>O(|E| + |V|^2) = O(|V|^2)</math>.
 
For [[sparse graph]]s, that is, graphs with far fewer than <math>O(|V|^2)</math> edges, Dijkstra's algorithm can be implemented more efficiently by storing the graph in the form of [[adjacency list]]s and using a [[self-balancing binary search tree]], [[binary heap]], [[pairing heap]], or [[Fibonacci heap]] as a [[priority queue]] to implement extracting minimum efficiently. With a self-balancing binary search tree or binary heap, the algorithm requires <math>\Theta((|E| + |V|) \log |V|)</math> time (which is dominated by <math>\Theta( | E | \log | V | )</math>, assuming the graph is connected). To avoid <math>O(|V|)</math> look-up in decrease-key step on a vanilla binary heap, it is necessary to maintain a supplementary index mapping each vertex to the heap's index (and keep it up to date as priority queue <math>Q</math> changes), making it take only <math>O(\log|V|)</math> time instead. The [[Fibonacci heap]] improves this to <math>O(|E| + |V| \log|V|)</math>.
 
Note that for [[directed acyclic graph]]s, it is possible to find shortest paths from a given starting vertex in linear time, by processing the vertices in a topological order, and calculating the path length for each vertex to be the minimum length obtained via any of its incoming edges.<ref>http://www.boost.org/doc/libs/1_44_0/libs/graph/doc/dag_shortest_paths.html</ref>
 
== Related problems and algorithms ==
 
The functionality of Dijkstra's original algorithm can be extended with a variety of modifications. For example, sometimes it is desirable to present solutions which are less than mathematically optimal. To obtain a ranked list of less-than-optimal solutions, the optimal solution is first calculated. A single edge appearing in the optimal solution is removed from the graph, and the optimum solution to this new graph is calculated. Each edge of the original solution is suppressed in turn and a new shortest-path calculated. The secondary solutions are then ranked and presented after the first optimal solution.
 
Dijkstra's algorithm is usually the working principle behind [[link-state routing protocol]]s, [[OSPF]] and [[IS-IS]] being the most common ones.
 
Unlike Dijkstra's algorithm, the [[Bellman–Ford algorithm]] can be used on graphs with negative edge weights, as long as the graph contains no [[negative cycle]] reachable from the source vertex ''s''. The presence of such cycles means there is no shortest path, since the total weight becomes lower each time the cycle is traversed. It is possible to adapt Dijkstra's algorithm to handle negative weight edges by combining it with the Bellman-Ford algorithm (to remove negative edges and detect negative cycles), such an algorithm is called [[Johnson's algorithm]].
 
The [[A-star algorithm|A* algorithm]] is a generalization of Dijkstra's algorithm that cuts down on the size of the subgraph that must be explored, if additional information is available that provides a lower bound on the "distance" to the target. This approach can be viewed from the perspective of [[linear programming]]: there is a natural [[Shortest path problem#Linear programming formulation|linear program for computing shortest paths]], and solutions to its [[dual linear program]] are feasible if and only if they form a [[consistent heuristic]] (speaking roughly, since the sign conventions differ from place to place in the literature). This feasible dual / consistent heuristic defines a non-negative [[reduced cost]] and A* is essentially running Dijkstra's algorithm with these reduced costs. If the dual satisfies the weaker condition of [[Admissible heuristic|admissibility]], then A* is instead more akin to the Bellman–Ford algorithm.
 
The process that underlies Dijkstra's algorithm is similar to the greedy process used in [[Prim's algorithm]].  Prim's purpose is to find a [[minimum spanning tree]] that connects all nodes in the graph; Dijkstra is concerned with only two nodes. Prim's does not evaluate the total weight of the path from the starting node, only the individual path.
 
[[Breadth-first search]] can be viewed as a special-case of Dijkstra's algorithm on unweighted graphs, where the priority queue degenerates into a FIFO queue.
 
== Dynamic programming perspective ==
 
From a [[dynamic programming]] point of view, Dijkstra's algorithm is a successive approximation scheme that solves the dynamic programming functional equation for the shortest path problem by the '''Reaching''' method.<ref name=sniedovich_06>{{cite journal | last = Sniedovich | first = M. | title = Dijkstra’s algorithm revisited: the dynamic programming connexion | journal = Journal of Control and Cybernetics | volume = 35 | issue = 3 | pages = 599–620 | year = 2006 | url = http://matwbn.icm.edu.pl/ksiazki/cc/cc35/cc3536.pdf | format = [[PDF]]}} [http://www.ifors.ms.unimelb.edu.au/tutorial/dijkstra_new/index.html Online version of the paper with interactive computational modules.]</ref><ref name=denardo_03>{{cite book | last = Denardo | first = E.V. | title = Dynamic Programming: Models and Applications | publisher = [[Dover Publications]] | location = Mineola, NY | year = 2003 | isbn = 978-0-486-42810-9}}</ref><ref name=sniedovich_10>{{cite book | last = Sniedovich | first = M. | title = Dynamic Programming: Foundations and Principles | publisher = [[Francis & Taylor]] | year = 2010 | isbn = 978-0-8247-4099-3  }}</ref>
 
In fact, Dijkstra's explanation of the logic behind the algorithm,<ref>{{harvnb|Dijkstra|1959|p=270}}</ref> namely
{{quote|
'''Problem 2.''' Find the path of minimum total length between two given nodes <math>P</math> and <math>Q</math>.
 
We use the fact that, if <math>R</math> is a node on the minimal path from <math>P</math> to <math>Q</math>, knowledge of the latter implies the knowledge of the minimal path from <math>P</math> to <math>R</math>.
}}
 
is a paraphrasing of [[Richard Bellman|Bellman's]] famous [[Principle of Optimality]] in the context of the shortest path problem.
 
== See also ==
{{portal|Computer science}}
* [[A* search algorithm]]
* [[Euclidean shortest path]]
* [[Flood fill]]
* [[Longest path problem]]
* [[Johnson's algorithm]]
* [[Bellman–Ford algorithm]]
* [[Floyd–Warshall algorithm]]
 
==Notes==
{{reflist}}
 
== References ==
* {{cite journal | authorlink = Edsger W. Dijkstra | first1 = E. W. | last1 = Dijkstra | url= http://www-m3.ma.tum.de/twiki/pub/MN0506/WebHome/dijkstra.pdf | title = A note on two problems in connexion with graphs | journal = Numerische Mathematik | volume = 1 | year = 1959 | pages = 269–271 | ref = harv | doi = 10.1007/BF01386390}}
* {{cite book | author1-link = Thomas H. Cormen | first1 = Thomas H. | last1 = Cormen | author2-link = Charles E. Leiserson | first2 = Charles E. | last2 = Leiserson | author3-link = Ronald L. Rivest | first3 = Ronald L. | last3 = Rivest | author4-link = Clifford Stein | first4 = Clifford | last4 = Stein | title = [[Introduction to Algorithms]] | edition = Second | publisher = [[MIT Press]] and [[McGraw–Hill]] | year = 2001 | isbn = 0-262-03293-7 | chapter = Section 24.3: Dijkstra's algorithm | pages = 595–601}}
* {{cite conference|first1=Michael Lawrence|last1=Fredman|authorlink1=Michael Fredman|first2=Robert E.|last2=Tarjan|authorlink2=Robert Tarjan|title=Fibonacci heaps and their uses in improved network optimization algorithms|conference=25th Annual Symposium on Foundations of Computer Science|year=1984|publisher=[[IEEE]]|pages=338&ndash;346|url=http://www.computer.org/portal/web/csdl/doi/10.1109/SFCS.1984.715934|ref=harv|doi=10.1109/SFCS.1984.715934}}
* {{cite journal|first1=Michael Lawrence|last1=Fredman|authorlink1=Michael Fredman|first2=Robert E.|last2=Tarjan|authorlink2=Robert Tarjan|title=Fibonacci heaps and their uses in improved network optimization algorithms|journal=Journal of the Association for Computing Machinery|volume=34|year=1987|pages=596&ndash;615|url=http://portal.acm.org/citation.cfm?id=28874|ref=harv|doi=10.1145/28869.28874|issue=3}}
* {{cite journal | first1 = F. Benjamin | last1 = Zhan | first2 = Charles E. | last2 = Noon |date=February 1998 | title = Shortest Path Algorithms: An Evaluation Using Real Road Networks | journal = [[Transportation Science]] | volume = 32 | issue = 1 | pages = 65–73 | doi = 10.1287/trsc.32.1.65}}
* {{cite book|first1=M.|last1=Leyzorek|first2=R. S.|last2=Gray|first3=A. A.|last3=Johnson|first4=W. C.|last4=Ladew|first5=S. R.|last5=Meaker, Jr.|first6=R. M.|last6=Petry|first7=R. N.|last7=Seitz|title=Investigation of Model Techniques &mdash; First Annual Report &mdash; 6 June 1956 &mdash; 1 July 1957 &mdash; A Study of Model Techniques for Communication Systems|publisher=Case Institute of Technology|location=Cleveland, Ohio|year=1957|ref=harv}}
* {{cite journal|first1=D.E.|last1=[[Donald Knuth|Knuth]]|title=A Generalization of Dijkstra's Algorithm|journal=[[Information Processing Letters]]|volume=6|number=1|pages=1–5|year=1977}}
 
== External links ==
{{external links|date=September 2012}}
{{Commons category|Dijkstra's algorithm}}
* C/C++
** [https://github.com/xtaci/algorithms/blob/master/include/dijkstra.h Dijkstra's Algorithm in C++]
** [http://www.boost.org/doc/libs/1_43_0/libs/graph/doc/dijkstra_shortest_paths.html Implementation in Boost C++ library]
** [http://www.rawbytes.com/dijkstras-algorithm-in-c/ Dijkstra's Algorithm in C Programming Language]
* Java
** [http://www.dgp.toronto.edu/people/JamesStewart/270/9798s/Laffra/DijkstraApplet.html Applet by Carla Laffra of Pace University]
** [http://students.ceid.upatras.gr/~papagel/english/java_docs/minDijk.htm Visualization of Dijkstra's Algorithm]
** [http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/dijkstra/Dijkstra.shtml Shortest Path Problem: Dijkstra's Algorithm]
** [http://www.unf.edu/~wkloster/foundations/DijkstraApplet/DijkstraApplet.htm Dijkstra's Algorithm Applet]
** [http://code.google.com/p/annas/ Open Source Java Graph package with implementation of Dijkstra's Algorithm]
** [http://www.stackframe.com/software/PathFinder A Java library for path finding with Dijkstra's Algorithm and example Applet]
** [https://github.com/graphhopper/graphhopper/tree/90879ad05c4dfedf0390d44525065f727b043357/core/src/main/java/com/graphhopper/routing Dijkstra's algorithm as bidirectional version in Java]
* C#/.Net
** [http://www.codeproject.com/KB/recipes/ShortestPathCalculation.aspx Dijkstra's Algorithm in C#]
** [http://www.codeproject.com/KB/recipes/FastHeapDijkstra.aspx Fast Priority Queue Implementation of Dijkstra's Algorithm in C#]
** [http://quickgraph.codeplex.com/ QuickGraph, Graph Data Structures and Algorithms for .NET]
* [http://optlab-server.sce.carleton.ca/POAnimations2007/DijkstrasAlgo.html Dijkstra's Algorithm Simulation]
* [http://purl.umn.edu/107247 Oral history interview with Edsger W. Dijkstra], [[Charles Babbage Institute]] University of Minnesota, Minneapolis.
* [http://www.cs.sunysb.edu/~skiena/combinatorica/animations/dijkstra.html Animation of Dijkstra's algorithm]
* [http://bonsaicode.wordpress.com/2011/01/04/programming-praxis-dijkstra’s-algorithm/ Haskell implementation of Dijkstra's Algorithm] on Bonsai code
* [http://hansolav.net/sql/graphs.html Implementation in T-SQL]
* [http://www.mathworks.com/matlabcentral/fileexchange/20025-advanced-dijkstras-minimum-path-algorithm A MATLAB program for Dijkstra's algorithm]
* [http://www.turb0js.com/a/Dijkstra%27s_Algorithm Step through Dijkstra's Algorithm in an online JavaScript Debugger]
 
{{Use dmy dates|date=February 2011}}
 
[[Category:1959 in computer science]]
[[Category:Graph algorithms]]
[[Category:Search algorithms]]
[[Category:Routing algorithms]]
[[Category:Combinatorial optimization]]
[[Category:Articles with example pseudocode]]
[[Category:Dutch inventions]]

Latest revision as of 02:22, 16 December 2014

not for others

Somewhat similar, but from a certain extent, this is a part of the General Assembly refining 'medicine' mainland real division between the top level.

by this Assembly, that is to let people get to know, who is ranked first on the continent today refining 'medicine' division!

able to participate in 'medicine' typical person, in addition to the 'medicine' family of the tribe, as well as some had カシオ 腕時計 バンド or now has a great reputation and high refining 'medicine' technique of refining 'medicine' guru on the Plains, also can be invited, but this number is generally invited to very few people, after all, can be 'medicine' family fancy eye refining 'medicine' division, on the mainland, but also カシオ 電波ソーラー時計 the Phoenix 'gross' Linjiao like existence.

But anyway, it does not prevent the 'medicine' typical grand, not for others, just because that continent first refining 'medicine' division カシオ腕時計 g-shock title!

stars fell Court from casio 腕時計 説明書 the 'medicine' Shennong Mountain where the family very far, 時計 メンズ カシオ but Xiao Yan duo 相关的主题文章:

looking at the broken chest open to the robes

, Yunshan face 'color' is gradually cold, chest a shrink, soon suddenly a drum, an impulsive majestic, overwhelming storm surge out, and bear the brunt, and that 電波腕時計 カシオ is the nearest Xiao Yan!

series of marching footsteps void, Xiao Yan also pick up behind the wings shake, カシオ腕時計 g-shock after a good moment, just the kind of momentum built shed, chest Department, カシオソーラー時計 also came the refreshing feeling of tightness.

cold eyes casio 腕時計 レディース looked back rapidly Xiao Yan, Yunshan slowly down, looking at the broken chest open to the robes, robes cracked, 'dew' out of its chest, at the moment, a little bit above being printed red boxing India, obviously, this is a previously Xiao Yan stay.

'Oh, good, very good casio 腕時計 デジタル ah, to the fight since I Jin cases, you are still left in me first boxing Indian man' looked at the road fist India, Yunshan face is completely cold down , it is the heart of an intention to kill the chill gradually spread out from its body. 相关的主题文章:

'back Gama empire

'Clouds, haze, were it seems that old カシオ 時計 電波 ソーラー bastard Yunshan, really want ruthless ah!' Black eye カシオ 時計 プロトレック pupil almost been bloodshot, her face 'color' terribly grim, Xiao Yan body trembling rapid surge strong intention to kill filled the room, after a moment, he suddenly stood up, but it was hastily pulled smoked children: '? Xiao Yan brother, you have to go.'

'back Gama empire! I want cloud-lan everyone buried!' sepulchral voice, with a strong intention to kill and ferocious.

'You can now go back and die in vain in 電波時計 casio addition to what is the use? xiaojia now suffering from the disaster, but you still have who can save? if you die, how Xiao Shushu accountable?' askew hideous to see Xiao カシオ 腕時計 チタン Yan カシオ 腕時計 激安 look, Kaoru children know, because he is somewhat out of control rage up, the moment hastily loudly.

'Xiao Yan, you have nothing to say! Brother let me vapid Mania Wanlitiaotiao come find you, not let you 相关的主题文章: