Question: Problem 1 . Streaming Edges 1 . Suppose ( G = ( V , E ) ) is an undirected graph with edge
Problem Streaming Edges
Suppose GV E is an undirected graph with edge weights w and suppose you have already computed a minweight spanning tree T for G Suppose a new edge eu v with weight we is added to the graph, to obtain a new graph Gprime Show how, given G Tu v and we one can compute a MST Tprime for the larger graph Gprime in time On 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: On time is not enough to reread the original graph. Your proof of correctness has to explain why it is ok to ignore lots of the edges in G
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 edgestream that supports the following two operations: hasnext and nextedge A call to edgestream.hasnext returns true if there are more edges in the stream and false otherwise. edgestream.nextedge returns the next edge in the stream. There is no way to go backwards and reread 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 ldots n
Your goal is to write an algorithm that computes the minimumweight spanning tree of the graph in this streaming setting. Write an algorithm that, given a set of vertices V and an edge stream edgestream, builds a minweight spanning tree of the graph using at most On space and On cdot m time, where mE is the number of edges in edgestream. The stream itself does not count against your space budget, but any data structures or additional storage you use doHint: Use part
An algorithm that uses more than On space will get at most half credit.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
