In eduladder you can Ask,Answer,Listen,Earn and Download Questions and Question papers.

Watch related videos of your favorite subject.

Connect with students from different parts of the world.

Apply or Post Jobs, Courses ,Internships and Volunteering opportunity. For FREE

See Our team

Wondering how we keep quality?

Got unsolved questions? Ask Questions

GATE
GMAT
CBSE
NCERT
Career
Interview
Railway
UPSC
NID
NIFT-UG
NIFT-PG
PHP
AJAX
JavaScript
Node Js
Shell Script
Research

## The arc lengths of a directed graph of a project are as shown in the figure. The shortest path length from node 1 to node 6 is _______. (Gate 2018 Mechanical engineering)

Asked On2019-06-02 02:22:54 by:gokilapriya

Taged users:

Likes:

Be first to like this question

Dislikes:

Be first to dislike this question

Talk about this Like Dislike

Download question setAnswersalgorithm(or Dijkstra'sShortest PathFirstalgorithm, SPFalgorithm) is analgorithm for finding the shortest pathsbetween nodes in agraph, which may represent, for example, road networks.Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning tree. Like Prim’s MST, we generate a

SPT (shortest path tree)with given source as root. We maintain two sets, one set contains vertices included in shortest path tree, other set includes vertices not yet included in shortest path tree. At every step of the algorithm, we find a vertex which is in the other set (set of not yet included) and has a minimum distance from the source.Below are the detailed steps used in Dijkstra’s algorithm to find the shortest path from a single source vertex to all other vertices in the given graph.

Algorithm

1)Create a setsptSet(shortest path tree set) that keeps track of vertices included in shortest path tree, i.e., whose minimum distance from source is calculated and finalized. Initially, this set is empty.2)Assign a distance value to all vertices in the input graph. Initialize all distance values as INFINITE. Assign distance value as 0 for the source vertex so that it is picked first.3)WhilesptSetdoesn’t include all vertices….

a)Pick a vertex u which is not there insptSetand has minimum distance value.….

b)Include u tosptSet.….

c)Update distance value of all adjacent vertices of u. To update the distance values, iterate through all adjacent vertices. For every adjacent vertex v, if sum of distance value of u (from source) and weight of edge u-v, is less than the distance value of v, then update the distance value of v.Ans: 7

i means infinity

- means already selected vertex

1 2 3 4 5 6

Step 1: 0 i i i i i // start vertex

Step 2: - 2 4 i i i //2 vertex is selected as it has minimum distance from source vertex (here)

Step 3: - - 3 6 4 i //3 vertex is selected as it has minimum distance from source vertex (here)

Step 4: - - - 6 4 i //5 vertex is selected as it has minimum distance from source vertex (here)

Step 5: - - - 5 - 8 //updated the distance. 5 vertex is selected as it has minimum distance from source vertex (here)

Step 6: - - - - - 7 //updated the distance. 4 vertex is selected as it has minimum distance from source vertex (here)

Hence, the graph looks like this and the distance can be seen clearly i.e. 7

Likes:

Be first to like this answer

Dislikes:

Be first to dislike this answer

Talk about this Like Dislike

## You might like this video:Network and IP Address

Watch more here

## Watch more videos from this user Here

Learn how to upload a video over here

Lets together make the web is a better placeWe made eduladder by keeping the ideology of building a supermarket of all the educational material available under one roof. We are doing it with the help of individual contributors like you, interns and employees. So the resources you are looking for can be easily available and accessible also with the freedom of remix reuse and reshare our content under the terms of creative commons license with attribution required close.

You can also contribute to our vision of "Helping student to pass any exams"with these.Answer a question:You can answer the questions not yet answered in eduladder.How to answer a questionCareer:Work or do your internship with us.Work with usCreate a video:You can teach anything and everything each video should be less than five minutes should cover the idea less than five min.How to upload a video on eduladder