Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description Dijkstra's algorithm is to find and to store shortest paths in a kind of rooted spanning tree. We can denote the result by its

Description
Dijkstra's algorithm is to find and to store shortest paths in a kind of rooted spanning tree. We can denote the result by its edges set T subeE. In Dijkstra's algorithm, we divide vertices to 2 groups, visited group V' and unvisited group U.
If we want to move a vertex viinU to V', we should apply our operation by a bridge edge eb=(sb,vi,wb)inE and sbinV'.
V'larr{s},UlarrV??V',Tlarr{(s,s,0)}.
Find the minimum bridge edge eb between V' and U.
Find bridged node erinT that tr=sb with minimal wb+wr.
4 Make an edge eb'=(sb,tb,wb+wr).
Update information V'larrV'U{tb},U=U??{tb},TlarrT{eb',}.
Repeat step 2 to step 5 until U=O?.
Questions
1 Analyze the time complexity when implement step 2 by sequential searching whole adjacency list.
2 Analyze the time complexity when implement step 2 by a priority queue that maintained the bridge edges.
2.1 Implement the priority queue by double-linked list.
2.2 Implement the priority queue by Min-heap.
3 Design an algorithm to reconstruct the path from spanning tree T(the result).
4 How to find the unreachable (have no path from s) set?
Can you describe the answers. And please use cpp programs for the implementations of the algorithms
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Name three sources of guidance for tax professionals.

Answered: 1 week ago