Transcript for:
Shortest Path Routing Algorithm

let us discuss about shortest path rooting algorithm this algorithm can also be called as disra algorithm why because this algorithm was developed by disra so disra is nothing but the developer name so here our major aim is we have to find out the shortest path from Source router to destination router here we have a graph this graph totally contains eight roter A B C D E F G H uh here the roters are represented by nodes here the nodes are a b c d e f g h so this Edge this Edge represents that communication link so what is the distance from A to B or what is the distance from E to F so this number represents distance or cost or weight or we can also call as delay also so here we have uh here our major is we need to find out the shortest path from Source router to the destination router so let us assume that source rter is a destination rout is D so we have to find out the shortest path from Source a a node to the destination D node okay here we have three types of nodes the first node is tentative node second node is working node third node is permanent node so tentative node means it is a Wide Circle so C is a tentative node D is a tentative node so this white circle is nothing but tentative node whereas current working node means it is represented by yo so before the circle we have some yo symbol so if You observe here in every graph we will have one current working node so here a is the current working node in this graph B is the current working node in this graph G is the current working node likewise and the permanent node is represented by a solid Circle permanent node is represented by solid Circle so here we have we have to solve this problem uh we have for that we we have we have 1 2 3 4 six steps so let us see step by step uh initially we have to assume the source vertex as the current working node so that is represented by arrow and we have to make the first node that is Source node as the permanent node Source node as the permanent node okay and remaining all nodes are tentative nodes so tentative node means white circle so let us see the Second Step B diagram uh here the current working node is y so now we have to explore a so find the neighboring roters of a so the neighboring roters of a are B and G here what is the cost of B in order to Traverse from A to B the cost is two so here we we can update this path length by a pair the first argument represents the cost second argument represents the current working node so here the cost is two comma the current working node is a so we are traversing to B from a so 2 comma a next what is the cost of G that is six so this cost this length is updated by 6 comma 8 6 comma 8 next we don't know e path length F path length C path length H path length D path length so that's why they are updated with infinity infinity specifies that we don't know that path length cost minus specifies the current working load is not not known to us so minus specifies this hypon specifies current working node is not known next here we have two two paths here the cost is two here the distance is two here the distance is six out of two and six two is the smaller value so we have to make this node as the permanent node so permanent node means solid Circle so this Arrow represents this this is the current working note so in the next step what we have to do we have to explore B so find the neighboring roters of B so the neighboring roters of B are e and C let us focus on C here what is the cost of b 2 let us find out the cost of C here the cost from the distance from B to C is 7 so 7 + 2 means 9 so 9 comma hypon so here here we are finding the path length of ab C so here c c distance means the path length from a to c so likewise H distance means the path length from a to H why because here our Target is from source to destination vertex we need to find the distance so here we have to update with here already the cost is two so here this path length is 7 so 2 + 7 means 9 9 9 comma what is the current working node B so here we have to update C path length by 9 comma B next what is another neighboring note E so here the cost is two whereas the distance from B to e is two so 2 + 2 means 4 so this this path length is updated by 4 comma B 4 comma B so now out of out of so here what are the uh additional notes we we got here yeah C node next e node so out of four and N the short the smaller value is four so we have to make this e node as the permanent node this e node as the permanent node so now let us explore e let us explore e so what are the neighboring nodes of e we have two neighboring nodes F and six f and g already the C of the path length of G is already calculated that is six suppose if you get a new value then we have to update with that new value why because here our major intention is always we need to find the shortest path length if you focus on this one here the cost of e is four next what is the distance from E to Z the distance from E to Z is 1 so 4 + 1 means 5 so 5 Comm e so here previously we have six but now we got five 5 is less than 6 so we have to update the 6 by five what is the current working note from E so 5 comma e 5 comma e next another neighboring node is f what is the distance from E to F two so 2 + 4 that is 6 6 comma e 6 comma e so so now what are the uh tentative notes now now here we have so f as well as g f g and we have C also so these are the tentative notes okay yeah out of c f and g five 6 and 9 which is the smaller value so five is the smaller value so we have to make this node as the current working node and made this node as the par permanent node so in the next step here we don't know the remaining paths length so that's why they are updated by Infinity comma minus only if you don't know that path length distance then their path length is infinity comma minus so in the next step we have to explore G so what are the neighboring noes of G we have only one neighboring node that is H so what is the path length here here from G to H the path length is 4 so 5 + 4 means 9 so Infinity comma minus is updated with 9 comma G so 9 comma G 9 comma G so here we have only one neighboring node so this is the only neighboring node so now we need to find out the shortest value so here this is one tentative node this is another tentative node and this is another tentative node so out of 9 six and 9 which is the smaller value so six is the smaller value so we have to make this node as the permanent node and current working node now we need to explore F what are the neighboring notes of f what are the neighboring notes of f we have c h we have C and H so we have two notes C and H so let us find out the cost of H here uh so already uh the distance of f is calculated that is six that is six now let us find out from F2 G F2 H F2 H the distance is 2 so 6 + 2 6 + 2 means 8 so previously the cost is 9 but now we got 8 so 9 comma G is updated with 8 comma F 8 comma F 8 comma F so next out of 9 8 which is the smaller value8 is the smaller value so now we have to explore this node so from H directly we can go to the D so this is the path here so now let us write the path here so here what is the destination rout D is the destination rout so we are traversing to D from which node from which node H H next we are traversing to H from which node h 8 comma f f f so let us see F we are traversing to F from which node e e yeah it is not visible let us write a little bit upper side so here what is the destination node D is the destination node D is the destination rotor so D we are traversing to D from H this H so H let us find out the shortest path next d h we are traversing to H from which node h 8 comma F so f f so let us see F we are traversing to F from which current working node e so e next e we are traversing to E from which node which rout B next we are traversing to B from which node a so this is the shortest path A to B next B to e next e to f f to H H to D so what is the cost here 2+ 2+ 2+ 2+ 2+ uh two this is the cost here A2 B B2 e E2 F F2 H H2 D so this is the shortest path so this is about shortest path rooting algorithm or disra rooting algorithm