Question

Problem 1 (20 points). For each of the following statements, either give a (short) proof to show that it 1. Let G- (V,E) be a
Comments
    0 0
    Add a comment Improve this question Transcribed image text
    Answer #1

    I hope here distance means shortest path length. If distance is euclidean distance then everything will be uncertain.

    1. dist(s,u) < dist(s,v). In BFS we go by breadth. So the vertices added to the queue at same time are all equidistant from the source and all vertices added after have more distance.

    2. what does this greater than relation mean? In general we can't say about this as if v is traversed at first then such relation might not hold.

    3. May not hold as there may be 2 shortest paths from s to t

    4. This is true. As |V| = |E|, this is not a tree. There is a cycle. Choose a vertex v at first. then we can see that we can always change an edge from that cycle which will not change distance of other vertices from that node as if there is a cycle not all edges give  role in distance from v.

    Add a comment
    Know the answer?
    Add Answer to:
    Problem 1 (20 points). For each of the following statements, either give a (short) proof to show ...
    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
    • Show the operation of depth-first search (DFS) on the graph of Figure 1 starting from vertex...

      Show the operation of depth-first search (DFS) on the graph of Figure 1 starting from vertex q. Always process vertices in alphabetical order. Show the discovery and finish times for each vertex, and the classification of each edge. (b) A depth-first forest classifies the edges of a graph into tree, back, forward, and cross edges. A breadth-first search (BFS) tree can also be used to classify the edges reachable from the source of the search into the same four categories....

    • please help me make this into a contradiction or a direct proof please. i put the question, my answer, and the textbook i used. thank you also please write neatly proof 2.5 Prove har a Sim...

      please help me make this into a contradiction or a direct proof please. i put the question, my answer, and the textbook i used. thank you also please write neatly proof 2.5 Prove har a Simple sraph and 13 cdges cannot be bipartite CHint ercattne gr apn in to ertex Sets and Court tne忤of edges Claim Splitting the graph into two vertex, Sets ves you a 8 Ver ices So if we Change tne书 apn and an A bipartite graph...

    • Please help me with 2 (c), thank you!!! Figure 2: 4 10 Figure 3:1 4 Problems 1. Trace BFS on the following graphs. For...

      Please help me with 2 (c), thank you!!! Figure 2: 4 10 Figure 3:1 4 Problems 1. Trace BFS on the following graphs. For each vertex, record its color, parent, and distance fields, draw the resulting BFS tree, and determine the order in which vertices are added to the Queue. Process adjacency lists in ascending numerical order. a. The graph in figure 1, with 1 as the source. b. The directed graph in figure 2 with 1 as source. 2....

    • Problem E: For each of the following parts, state True or False. If true, give a short proof. If ...

      Problem E: For each of the following parts, state True or False. If true, give a short proof. If false, givera counterexample: (1). Using Kruskal's algorithm, edges are (always) inserted into the MST in the same order as using Prim's (2). If an edge e is part of a TSP tour found by the quick TSP method then it must also be part of the (3). If an edge e is part of a Shortest Path Tree rooted at A...

    • Please answer all three parts. And show step-by-step answers for each part. Draw anything if necessary....

      Please answer all three parts. And show step-by-step answers for each part. Draw anything if necessary. And please don't copy other answers to be at risk being downvoted. Thank you. Question 1 (50 POINTS): Given a graph G and the Breadth First Search (BFS) and Depth First Search (DFS) traversal algorithms as follows: BFSG) 1 for each vertex u € G.V – {3} 1 2 u.color = WHITE 3 u.d = 0 4 un = NIL 3 5 S.color =...

    • Problem 3 (15 points). Let G (V,E) be the following directed graph. a. 1. Draw the...

      Problem 3 (15 points). Let G (V,E) be the following directed graph. a. 1. Draw the reverse graph G of G. 2. Run DFS on G to obtain a post number for each vertex. Assume that in the adjacency list representation of G, vertices are stored alphabetically, and in the list for each vertex, its adjacent vertices are also sorted alphabetically. In other words, the DFS algorithm needs to examine all vertices alphabetically, and when it traverses the adjacent vertices...

    • Show how depth-first search works on the graph of Figure 22.6. Assume that the for loop of lines 5–7 of the DFS proced...

      Show how depth-first search works on the graph of Figure 22.6. Assume that the for loop of lines 5–7 of the DFS procedure considers the vertices in reverse alphabetical order, and assume that each adjacency list is ordered alphabetically. Show the discovery and finishing times for each vertex, and show the classification of each edge. DIJKSTRA(G,w,s) 1INITIALIZE-SINGLE-SOURCE(G,s) 2 S ?? 3 Q ? V[G] 4 while Q =? 5 do u ? EXTRACT-MIN(Q) 6 S ? S?{u} 7 for each...

    • Input a simple undirected weighted graph G with non-negative edge weights (represented by w), and a...

      Input a simple undirected weighted graph G with non-negative edge weights (represented by w), and a source node v of G. Output: TDB. D: a vector indexed by the vertices of G. Q: priority queue containing the vertices of G using D[] as key D[v]=0; for (all vertex ut-v) [D[u]-infinity:) while not Q. empty() 11 Q is not empty fu - Q.removein(); // retrieve a vertex of Q with min D value for (all vertex : adjacent to u such...

    • from collections import defaultdict    # This class represents a directed graph using # adjacency list...

      from collections import defaultdict    # This class represents a directed graph using # adjacency list representation class Graph:        # Constructor     def __init__(self):            # default dictionary to store graph         self.graph = defaultdict(list)        # function to add an edge to graph     def addEdge(self,u,v):         self.graph[u].append(v)        # Function to print a BFS of graph     def BFS(self, s):            # Mark all the vertices as not visited         visited = [False] * (len(self.graph))            # Create a queue for BFS         queue...

    • a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps...

      a. (15 marks) i (7 marks) Consider the weighted directed graph below. Carry out the steps of Dijkstra's shortest path algorithm as covered in lectures, starting at vertex S. Consequently give the shortest path from S to vertex T and its length 6 A 2 3 4 S T F ii (2 marks) For a graph G = (V, E), what is the worst-case time complexity of the version of Dijkstra's shortest path algorithm examined in lectures? (Your answer should...

    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
    ADVERTISEMENT