You arc given a digraph H = (V, E). where element of the vertex set V are 1, 2,
ID: 3622949 • Letter: Y
Question
You arc given a digraph H = (V, E). where element of the vertex set V are 1, 2, 3, 4, 5. and 6. Members of the edge set E are (1, 2), (1, 3), (2, 3), (2, 4), (3, 4), (3, 5), (4, 6), (5, 3), (5, 4), (5, 6). and (6, 4). The lengths of these arcs arc c12 = 1 c13 = 2, c23 = 5, c24 = 7, c34 = 1, c35 = 2, c46 = 2, c53 = 8, c54 = 3, c56 = 5, and c64 = 9. Assume that the source-node is node 1. Determine the distance and predecessor vectors. D = d1, d2, d3, d4, d5, d6), and respectively. Code Dijkstra's algorithm in any high-level language you want. You can use either C, or C++, or Java, etc. You can use the pseudo-code given in the handout on Graph Algorithms. You are also permitted to use another source (or book) to code this algorithm. However, mention the source of your code. Test your code against the given problem. You should submit: A hard copy of jour code. Soft copies are not acceptable. Test result (printed output) when you use the above digraph.Explanation / Answer
This link provides a Java implementation of Dijkstra's algorith, along with explanation. If you have further questions feel free to private message me.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.