I think... it will work :) -------------------------------------------------- Rohit Saraf Second Year Undergraduate, Dept. of Computer Science and Engineering IIT Bombay http://www.cse.iitb.ac.in/~rohitfeb14
On Fri, May 14, 2010 at 2:20 PM, divya <sweetdivya....@gmail.com> wrote: > Given a graph's shortest path algorithm, how can you make use of it to > find the second shortest path? > > my solution > well just a thought... > is it something like.....assume this is the smallest distance path.... > start->node1->node2->node3->node4->destination > (now the graph will be represented by a matrix of order 2) > in order start breaking any of the link(break only one) > eg:- break the link start->node(i.e. delete the entry in the matrix > which connects start and node1) > and then again use dijikras to find a distance(store it) > now again link the start node with the node1 and break the node1- > >node2 and find a distance... > after getting all the distances.....find the min...that will be the > second min of all... > hope i am going on the right track....tell me if i am wrong...thanks > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.