Question: Problem 1 . Streaming Edges 1 . Suppose ( G = ( V , E ) ) is an undirected graph with edge

Problem 1. Streaming Edges
1. Suppose \( G=(V, E)\) is an undirected graph with edge weights \( w \), and suppose you have already computed a min-weight spanning tree \( T \) for \( G \). Suppose a new edge \( e=(u, v)\) with weight \( w(e)\) is added to the graph, to obtain a new graph \( G^{\prime}\). Show how, given \( G, T,(u, v)\) and \( w(e)\), one can compute a MST \( T^{\prime}\) for the larger graph \( G^{\prime}\) in time \( O(n)\) where \( n \) is the number of nodes in \( G \). You may assume \( T \) is given as a graph with the same node set as \( G \).
Note: \( O(n)\) time is not enough to re-read the original graph. Your proof of correctness has to explain why it is ok to ignore lots of the edges in \( G \).
2. Now consider a setting where you are given the edges of a graph in a streaming fashion, that is, you get them one at a time and want to process them using very little additional space. Each edge is described by a triple \((u, v, w)\), where \( u \) and \( v \) are vertices and \( w \) is the weight of the edge. The edges are undirected.
Specifically, you have access to a data structure edge_stream that supports the following two operations: has_next() and next_edge(). A call to edge_stream.has_next() returns true if there are more edges in the stream and false otherwise. edge_stream.next_edge() returns the next edge in the stream. There is no way to go backwards and re-read previous edges. (If you want to access edges again, you have to store them.) You may assume that the nodes' names are all integers in \(\{1,\ldots, n\}\).
Your goal is to write an algorithm that computes the minimum-weight spanning tree of the graph in this streaming setting. Write an algorithm that, given a set of vertices \( V \) and an edge stream edge_stream, builds a min-weight spanning tree of the graph using at most \( O(n)\) space and \( O(n \cdot m)\) time, where \( m=|E|\) is the number of edges in edge_stream. The stream itself does not count against your space budget, but any data structures or additional storage you use do.[Hint: Use part 1.]
An algorithm that uses more than \( O(n)\) space will get at most half credit.
Problem 1 . Streaming Edges 1 . Suppose \ ( G = (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!