Dijkstras algorithm, Data Structure & Algorithms

Assignment Help:

Djikstra's algorithm (named after it is discovered by Dutch computer scientist E.W. Dijkstra) resolves the problem of finding the shortest path through a point in a graph (the source) to a destination along non-negative weight edge.

It turns out that one can determine the shortest paths from given source to all vertices (points) into a graph in the similar time. Therefore, this problem is sometimes called the single-source shortest paths problem. Dijkstra's algorithm is greedy algorithm, which determine shortest path among all pairs of vertices within the graph. Before defining the algorithms formally, let us study the method through an example.

1564_Dijkstras Algorithm.png

Figure: A Directed Graph with no negative edge(s)

Dijkstra's algorithm has two sets of vertices that are following:

S   = set of vertices whose shortest paths from the source have been determined already

Q = V-S is the set of remaining vertices.

The other data structures required are following:

d is array of best estimates of shortest path to each of the  vertex from the source

pi is array of predecessors for each of vertex. predecessor is an array of vertices to which shortest path has already been find out.

The fundamental operation of Dijkstra's algorithm is edge relaxation. If there is any edge from u to v, then the shortest known path from s to u can be extended to a path from s to v by adding up edge (u,v) at the end. This path will have length d[u]+w(u,v). If this is less than d[v], we can replace the current value of d[v] along with new value.

The predecessor list is an array of indices, one for each vertex of any graph. Each vertex entry has the index of its predecessor in a path through the graph.


Related Discussions:- Dijkstras algorithm

Internal sorting, In internal sorting, all of the data to be sorted is obta...

In internal sorting, all of the data to be sorted is obtainable in the high speed main memory of the computer. We will learn the methods of internal sorting which are following:

Algorithm for linear search, Here,  m represents the unordered array of ele...

Here,  m represents the unordered array of elements n  represents number of elements in the array and el  represents the value to be searched in the list Sep 1: [Initialize]

Explain the concept of colouring, Colouring The use of colours in CAD/C...

Colouring The use of colours in CAD/CAM has two main objectives : facilitate creating geometry and display images. Colours can be used in geometric construction. In this case,

Compound interest, Write the algorithm for compound interest

Write the algorithm for compound interest

Explain the prim''s minimum spanning tree algorithm, Question 1. Explai...

Question 1. Explain the different types of traversal on binary tree 2. Explain the Prim's minimum spanning tree algorithm 3. Differentiate fixed and variable storage allo

Complexity classes, Complexity classes All decision problems fall in se...

Complexity classes All decision problems fall in sets of comparable complexity, called as complexity classes. The complexity class P is the set of decision problems which ca

Algorithm that counts number of nodes in a linked list, Q. Write an algorit...

Q. Write an algorithm that counts number of nodes in a linked list.                                       A n s . Algo rithm to Count No. of Nodes in Linked List C

frequenty count of function, Ask question find frequency count of function...

Ask question find frequency count of function- {for(i=1;i {for(j=1;j {for(k=1;k } } }

Tower of hanoi problem., Write an algorithm for getting solution to the Tow...

Write an algorithm for getting solution to the Tower's of Hanoi problem. Explain the working of your algorithm (with 4 disks) with appropriate diagrams. Ans: void Hanoi(int

Accept a file and form a binary tree - huffman encoding, Huffman Encoding i...

Huffman Encoding is one of the very simple algorithms to compress data. Even though it is very old and simple , it is still widely used (eg : in few stages of JPEG, MPEG etc). In t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd