Question

The below question refers to shortest paths trees in weighted, directed graphs. Read the following carefully....

The below question refers to shortest paths trees in weighted, directed graphs. Read the following carefully. Assume that No two edges have the same weight There are no cycles of net negative weight. There are no self-edges (edges leading from a vertex to itself). There are V vertices and E edges.

1. Assume that in addition to the conditions specified at the beginning, graphs are dense. If a graph contains V vertices and E edges, what is the greatest number of edges that a path in its shortest paths tree can contain?  

2. Assume that in addition to the conditions specified at the beginning, there are no negative edges, graphs are dense, and they are represented with adjacency matrices. What sort of priority queue implementation would make Dijkstra's algorithm asymptotically as bad as Bellman-Ford?

a. one in which deleteMin is O(V) and insert is O(1)
b. one in which both deleteMin and insert are O(log V)
c. one in which both deleteMin and insert are O(1)
d. one in which deleteMin is O(1) and insert is O(V)
0 0
Add a comment Improve this question Transcribed image text
Answer #1

(1)Given :- A Weighted and directed Dense Graph G(v,e)
where v = number of vertices e = number of edges
Hence e= O(v^2) i.e there is and edge between any two
vertices of Graph.
Therefore,the greatest number of edges that a path in
its shortest paths tree can contain is v-1;

(2)Graph is represented using adjacency matrices
Hence e=O(v^2)
Bellmenford complexity = O(v*e) = O(v*(v^2))=O(v^3)

Dijkestra algorithm complexity = O(e*(Time complexity
of deleting minKey from priority Queue));

a. one in which deleteMin is O(V) and insert is O(1)
=>O((v^2)*(v))= O(v^3)
b. one in which both deleteMin and insert are O(log V)
=>O(v^2 *(logv))
c. one in which both deleteMin and insert are O(1)
=>O(v^2 *(1)) = O(v^2)
d.one in which deleteMin is O(1) and insert is O(V)
=>O(v^2 *(1)) = O(v^2)

Hence option a is correct

Add a comment
Know the answer?
Add Answer to:
The below question refers to shortest paths trees in weighted, directed graphs. Read the following carefully....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT