{"id":9686,"date":"2018-10-17T17:09:33","date_gmt":"2018-10-17T17:09:33","guid":{"rendered":"https:\/\/assignment.essayshark.com\/blog\/?p=9686"},"modified":"2021-12-30T14:30:26","modified_gmt":"2021-12-30T14:30:26","slug":"dijkstras-shortest-path-algorithm-example","status":"publish","type":"post","link":"https:\/\/assignmentshark.com\/blog\/dijkstras-shortest-path-algorithm-example\/","title":{"rendered":"Dijkstra\u2019s Shortest Path Algorithm Example"},"content":{"rendered":"<blockquote><p><em>Dijkstra\u2019s shortest path algorithm finds the shortest paths between all nodes of the graph. In this article we will describe the operation principle of Dijkstra\u2019s algorithm, which finds optimal routes. The disadvantage of this algorithm is that it will not work correctly if the graph has negative edge weights. In this tutorial you can read Dijkstra\u2019s shortest path algorithm example. The author has solved a particular task and provided a vivid description of the solution. Following each step you will be able to solve a similar solution by yourself with ease.<br \/>\n<\/em><!--more--><\/p>\n<p><em>With our Dijkstra\u2019s shortest path algorithm example you can learn how to create and solve similar tasks. Look attentively to each step and highlight the important points that you need to consider while solving such an assignment. On our blog you can find various samples connected with this and other topics. Our service helps hundreds of students that have troubles with assignments in various disciplines: programming, mathematics, chemistry, physics, statistics, and more. If for some reason you can\u2019t manage the assignment by yourself you can ask our writers for <a href=\"https:\/\/assignmentshark.com\/\" target=\"_blank\" rel=\"noopener\">online assignment help<\/a>.<\/em><\/p><\/blockquote>\n<p style=\"text-align: center;\"><strong>Dijkstra\u2019s Shortest Path Algorithm Task<\/strong><\/p>\n<p><strong>Task:<\/strong> find all the shortest paths from the vertex # 1 for the graph shown in the figure below using the Dijkstra algorithm.<\/p>\n<p><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-9688 size-full\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra.jpg\" alt=\"dijkstra's shortest path algorithm\" width=\"269\" height=\"153\" \/><\/a><\/p>\n<p><strong>Solution:<\/strong><\/p>\n<p>First, we form the matrix of lengths of shortest arcs for a given graph.<\/p>\n<p><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-9690 size-full\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-table.png\" alt=\"dijkstra's shortest path algorithm example\" width=\"714\" height=\"526\" srcset=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-table.png 714w, https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-table-300x221.png 300w\" sizes=\"auto, (max-width: 714px) 100vw, 714px\" \/><\/a><\/p>\n<p>The starting vertex from which the tree of shortest paths is constructed is the vertex 1.<\/p>\n<p>We set the starting conditions:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-ed3b34455756a7e9716e609431b28939_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#49;&#41;&#32;&#61;&#32;&#48;&#44;&#32;&#100;&#32;&#40;&#120;&#41;&#32;&#61;&#32;&#92;&#105;&#110;&#102;&#116;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"165\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>We color vertex 1, <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-4242eec47087a2b9ccad8e135fcc576a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#121;&#32;&#61;&#32;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"18\" width=\"46\" style=\"vertical-align: -4px;\"\/>.<\/p>\n<p>We find the nearest vertex to the one that was colored by us, using the formula:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-74c94ffa2c79dcd73cd596db8e3b3b05_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#50;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#50;&#41;&#59;&#32;&#100;&#32;&#40;&#49;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#49;&#44;&#50;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#48;&#43;&#49;&#48;&#92;&#125;&#32;&#61;&#32;&#49;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"493\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-be847c60246652be9cdfcec10120212b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#51;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#51;&#41;&#59;&#32;&#100;&#32;&#40;&#49;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#49;&#44;&#51;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#48;&#43;&#49;&#56;&#92;&#125;&#32;&#61;&#32;&#49;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"493\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-b447f3693bcab283017f6afa5de5c15c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#52;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#52;&#41;&#59;&#32;&#100;&#32;&#40;&#49;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#49;&#44;&#52;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#48;&#43;&#56;&#92;&#125;&#32;&#61;&#32;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"473\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-4e51933182d7d1c1cfe857aea626be96_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#53;&#41;&#59;&#32;&#100;&#32;&#40;&#49;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#49;&#44;&#53;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#48;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#102;&#116;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"492\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-b4ad76196bab259de3c23fdfc1e67840_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#54;&#41;&#59;&#32;&#100;&#32;&#40;&#49;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#49;&#44;&#54;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#48;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#102;&#116;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"492\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>The minimum length has a path from vertex 1 to vertex 4 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-132bd268af744ff4f0c5039f18a0ab17_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#52;&#41;&#32;&#61;&#32;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"73\" style=\"vertical-align: -5px;\"\/>. We include the vertex # 4 in the current oriented tree, as well as the arc leading to this vertex.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-1dab501e7350f7462cdf8f1cf12f7df6_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#50;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#50;&#41;&#59;&#32;&#100;&#32;&#40;&#52;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#52;&#44;&#50;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#49;&#48;&#59;&#32;&#56;&#43;&#57;&#92;&#125;&#32;&#61;&#32;&#49;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"483\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-3550eca5815a88169c88ea95a5152ac5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#51;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#51;&#41;&#59;&#32;&#100;&#32;&#40;&#52;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#52;&#44;&#51;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#49;&#56;&#59;&#32;&#56;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#49;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"493\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-4a24269a25962b9b1b7e795da6c29974_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#53;&#41;&#59;&#32;&#100;&#32;&#40;&#52;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#52;&#44;&#53;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#56;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#92;&#105;&#110;&#102;&#116;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"492\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-c67f4a26cc9b2b0022b16e5f1c3ff653_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#54;&#41;&#59;&#32;&#100;&#32;&#40;&#52;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#52;&#44;&#54;&#41;&#92;&#125;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#56;&#43;&#49;&#50;&#92;&#125;&#32;&#61;&#32;&#50;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"493\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>The minimum length is the path from vertex 1 to vertex 2 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-6cb5ba4cc21f99e1a46a38a418111526_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#50;&#41;&#32;&#61;&#32;&#49;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"83\" style=\"vertical-align: -5px;\"\/>. We include vertex # 2 in the current oriented tree, as well as the arc leading to this vertex. According to the expression this is the arc (1,2).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-90c611d8e09f700743d11bd8df51ef4c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#51;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#51;&#41;&#59;&#32;&#100;&#32;&#40;&#50;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#50;&#44;&#51;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#49;&#56;&#59;&#32;&#49;&#48;&#43;&#49;&#54;&#92;&#125;&#32;&#61;&#32;&#49;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"503\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-cc50c3e78ebc302cd9e503b0dfcf4066_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#53;&#41;&#59;&#32;&#100;&#32;&#40;&#50;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#50;&#44;&#53;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#92;&#105;&#110;&#102;&#116;&#121;&#59;&#32;&#49;&#48;&#43;&#50;&#49;&#92;&#125;&#32;&#61;&#32;&#51;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"502\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-b2c145a4a41d4a5ad68c431a8129330c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#54;&#41;&#59;&#32;&#100;&#32;&#40;&#50;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#50;&#44;&#54;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#50;&#48;&#59;&#32;&#49;&#48;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#50;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"503\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>The minimum length is the path from vertex 1 to vertex 3 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-b94deb3759844121907ab3dac2a83296_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#51;&#41;&#32;&#61;&#32;&#49;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"83\" style=\"vertical-align: -5px;\"\/>. We include vertex # 3 in the current oriented tree, as well as the arc leading to this vertex. According to the expression, this is the arc (1.3).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-e95892eab8ff2fab9b0cd8f7c43fffa3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#53;&#41;&#59;&#32;&#100;&#32;&#40;&#51;&#41;&#32;&#43;&#97;&#32;&#40;&#51;&#44;&#53;&#41;&#92;&#125;&#32;&#61;&#109;&#105;&#110;&#32;&#92;&#123;&#51;&#49;&#59;&#32;&#49;&#56;&#43;&#49;&#53;&#92;&#125;&#32;&#61;&#32;&#51;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"502\" style=\"vertical-align: -5px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-a69aa52bd053aa8ab848588abf1728d0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#54;&#41;&#59;&#32;&#100;&#32;&#40;&#51;&#41;&#32;&#43;&#97;&#32;&#40;&#51;&#44;&#54;&#41;&#92;&#125;&#32;&#61;&#109;&#105;&#110;&#32;&#92;&#123;&#50;&#48;&#59;&#32;&#49;&#56;&#43;&#92;&#105;&#110;&#102;&#116;&#121;&#92;&#125;&#32;&#61;&#32;&#50;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"503\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>The minimum length is the path from vertex 1 to vertex 6 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-d9d2a8dbacc414d4e40b023a89c354ad_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#32;&#50;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"83\" style=\"vertical-align: -5px;\"\/>. We include the vertex # 6 in the current oriented tree, as well as the arc leading to this vertex. According to the expression, this is the arc (4.6).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-9f292ea97936fdabbfa04e4c29943292_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#100;&#32;&#40;&#53;&#41;&#59;&#32;&#100;&#32;&#40;&#54;&#41;&#32;&#43;&#32;&#97;&#32;&#40;&#54;&#44;&#53;&#41;&#92;&#125;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#123;&#51;&#49;&#59;&#32;&#50;&#48;&#43;&#50;&#51;&#92;&#125;&#32;&#61;&#32;&#51;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"502\" style=\"vertical-align: -5px;\"\/><\/p>\n<p>The minimum length is the path from vertex 1 to vertex 5 <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-621d73961f761ff3bd6c659a1d9ca7df_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#51;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"82\" style=\"vertical-align: -5px;\"\/>. We include vertex # 5 in the current oriented tree, as well as the arc leading to this vertex. According to the expression, this is the arc (2.5). We have obtained an oriented tree of the shortest paths starting at vertex # 1 for the original graph.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-624fa9e3240a58a7f625707aae4d12d5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#49;&#41;&#32;&#61;&#32;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"72\" style=\"vertical-align: -5px;\"\/> The length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-c600289787b703210120d674389d5b82_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"50\" style=\"vertical-align: 0px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-071c505e395de46b5e8573aa73b6841a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#50;&#41;&#32;&#61;&#32;&#49;&#45;&#50;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"106\" style=\"vertical-align: -5px;\"\/> The length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-69f64e5c23dca1c4ee6bea97cee47be8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#49;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"60\" style=\"vertical-align: -1px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-556b226797efdd1bce917aafd864012f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#51;&#41;&#32;&#61;&#32;&#49;&#45;&#51;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"107\" style=\"vertical-align: -5px;\"\/> Length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-4cf3103d2516f6c291517f32024de90a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#49;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"60\" style=\"vertical-align: -1px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-25ff96b92eb7ca124f0ba17d44a19fdc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#52;&#41;&#32;&#61;&#32;&#49;&#45;&#52;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"107\" style=\"vertical-align: -5px;\"\/> The length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-bd39987c779ae78614ded9e225e036fe_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#56;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"50\" style=\"vertical-align: 0px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-55dcca5279158179459968bc11deab99_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#53;&#41;&#32;&#61;&#32;&#49;&#45;&#50;&#45;&#53;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"141\" style=\"vertical-align: -5px;\"\/> The length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-42a9fdf23876dffc89903e84788f62c6_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#51;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"59\" style=\"vertical-align: -1px;\"\/><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-8177ccf28244704c3bcaa869070b8a92_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#100;&#32;&#40;&#54;&#41;&#32;&#61;&#32;&#49;&#45;&#52;&#45;&#54;\" title=\"Rendered by QuickLaTeX.com\" height=\"20\" width=\"142\" style=\"vertical-align: -5px;\"\/> The length of the route <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/ql-cache\/quicklatex.com-1f9dcbdb3c17ca607c01afb7ede2aa5e_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#61;&#32;&#50;&#48;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"60\" style=\"vertical-align: 0px;\"\/><\/p>\n<p>An oriented tree with a root in vertex 1:<\/p>\n<p><a href=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-solution.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-9694 size-full\" src=\"https:\/\/assignmentshark.com\/blog\/wp-content\/uploads\/2018\/08\/Dijkstra-solution.jpg\" alt=\"how to find shortest path using dijkstra algorithm\" width=\"269\" height=\"153\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dijkstra\u2019s shortest path algorithm finds the shortest paths between all nodes of the graph. In this article we will describe the operation principle of Dijkstra\u2019s algorithm, which finds optimal routes. The disadvantage of this algorithm is that it will not work correctly if the graph has negative edge weights. In this tutorial you can read [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,35],"tags":[],"class_list":["post-9686","post","type-post","status-publish","format-standard","hentry","category-math","category-samples"],"_links":{"self":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/9686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/comments?post=9686"}],"version-history":[{"count":6,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/9686\/revisions"}],"predecessor-version":[{"id":12807,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/posts\/9686\/revisions\/12807"}],"wp:attachment":[{"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/media?parent=9686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/categories?post=9686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmentshark.com\/blog\/wp-json\/wp\/v2\/tags?post=9686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}