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) |
(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
The below question refers to shortest paths trees in weighted, directed graphs. Read the following carefully....
5. (10 pts) Give a concrete example of a directed and weighted graph G and two vertices u and v, where the Dijkstra's algorithm does not find the shortest path from u to v in G but the Bellman-Ford algorithm does. Obviously such a graph must have at least one negative- weight edge.
Question 3 (20%) In this course we elaborated the Dijkstra algorithm for finding the shortest paths from one vertex to the other vertices in a graph. However, this algorithm has one restriction; It does not work for the graphs that have negative weight edges. For this question you need to search and find an algorithm for finding the shortest paths from one vertex to all the other vertices in a graph with negative weight edges. You need to explain step...
Please answer question 2. Introduction to Trees
Thank you
1. Graphs (11 points) (1) (3 points) How many strongly connected components are in the three graphs below? List the vertices associated with each one. 00 (2) (4 points) For the graph G5: (a) (0.5 points) Specify the set of vertices V. (b) (0.5 points) Specify the set of edges E. (c) (1 point) Give the degree for each vertex. (d) (1 point) Give the adjacency matrix representation for this graph....
in c++
The Bellman-Ford Algorithm In this assignment, you are asked to implement the Bellman-Ford Algorithm which solves the single-source shortest-paths problem. Specifically, you are given as input a directed graph G = (V. E) with weight w(u, v) on each edge (u, v) E E along with a source vertex s EV. Edges may have negative weights. Input The input has the following format. There are two integers on the first line. The first integer represents the number of...
10) Shortest Paths (10 marks) Some pseudocode for the shortest path problem is given below. When DIJKSTRA (G, w,s) is called, G is a given graph, w contains the weights for edges in G, and s is a starting vertex DIJKSTRA (G, w, s) INITIALIZE-SINGLE-SOURCE(G, s) 1: RELAX (u, v, w) 1: if dlv] > dlu (u, v) then 2d[v] <- d[u] +w(u, v) 3 4: end if 4: while Q φ do 5: uExTRACT-MIN Q) for each vertex v...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...
I have done the a and b, but i'm so confuse with other
questions, could someone help me to fix these questions, thanks so
much.
4 Directed graphs Directed graphs are sometimes used operating systems when trying to avoid deadlock, which is a condition when several processes are waiting for a resource to become available, but this wil never happen because Page 2 p2 T2 Figure 1: Minimal example of a resource allocation graph with deadlock other processes are holding...
Please read the case provided below and answer the following question: In 2007, JetBlue was a booming young airline with a strong reputation for outstanding service. In fact, the low-fare airline referred to itself as a customer service company that just happened to fly planes. But on Valentine's Day 2007, JetBlue was hit by the perfect storm-literally-of events that led to an operational meltdown. One of the most severe storms of the decade covered JetBlue's main hub at New York's...
summatize the following info and break them into differeng key points. write them in yojr own words
apartus
6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...