8. (10 pts, not hard at all after the hint) Let G be a directed graph where each edge has distance 1. Let vo be a design

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

8. (10 pts, not hard at all after the hint) Let G be a directed graph where each edge has distance 1. Let vo be a design

Post by answerhappygod »

8 10 Pts Not Hard At All After The Hint Let G Be A Directed Graph Where Each Edge Has Distance 1 Let Vo Be A Design 1
8 10 Pts Not Hard At All After The Hint Let G Be A Directed Graph Where Each Edge Has Distance 1 Let Vo Be A Design 1 (101.86 KiB) Viewed 37 times
Please write the algorithm, please don't write code.
8. (10 pts, not hard at all after the hint) Let G be a directed graph where each edge has distance 1. Let vo be a designated node in G (G has many other nodes). I would like to find a shortest walk a (assuming that it exists) from vo back to vo in G such that the walk passes at least one other node in between. Notice that if you run the classic Dijkstra's shortest path algorithm on G starting from vo, it will not return such an a. Please design an efficient algorithm to find such an a by running Dijkstra's shortest path algorithm exactly once. (Hint: my way is to modify, in certain way, G with n nodes into a new graph G' with n+1 nodes and run Dijkstra's shortest path algorithm on G' only once.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply