In the Dijkstra's algorithm, the choice of the input graph representation and the priority queue implementation will
No answer yet for this question.
Ask a Tutor
Question:
In the Dijkstra's algorithm, the choice of the input graph representation and the priority queue implementation will affect its time complexity.
- Suppose the input graph G = (V, E) is stored in an adjacency matrix and we
use an array for the priority queue. Implement the Dijkstra's algorithm using this setting and analyze its time complexity with respect to |V| and |E| both theoretically and empirically. - Suppose the input graph G = (V, E) is stored in an array of adjacency lists and
we use a minimizing heap for the priority queue. Implement the Dikstra's algorithm using this setting and analyze its time complexity with respect to |V| and |E| both theoretically and empirically. - Compare the two implementations in (a) and (b). Discuss which implementation is better and in what circumstances.
Please provide complete code in python(jupyter notebook) and related graphs for all the sub questions below with proper explanation for each part.
(Please dont provide half code or half explanation)
- Provide code in python for part a) and b).
- Provide theoritical time complexity for part a) and b).
- Provide empirical time complexity for part a) and b) separately along with the code in python (Jupyter nootbook) and data visulization graphs for various |E| and |v| values example |v|=25,|v|=50,|v|=75,|v|=100.
- Compare the two implementations a) and b) and show which one is better using data visualization graphs for empirical time complexity and theoritical time complexity.
- Suppose the input graph G = (V, E) is stored in an adjacency matrix and we
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: