Highlights
Task:
Question 1
This question is to he attempted individually. In each of the following. a greedy algorithm is proposed for the given problem. Give a simple counterexample for each of them to show that the proposal greedy algorithm doss not always return the optimal slum111. You should give an example input, State the solution Mutual 1w the greedy algorithm on that input, and another solution that is better than the greedy solution for that input. (a) Input: An undirected complete graph C (i.e. there is an alge (with weight) between any two vertices in the graph): a starting vertex s and a destination vertex t in G. Problem: Find a path that begins at m, ends at I, and visits every other vertex in C exactly Inlet, and such that the total might of this path iS its small aspcssible. Algorithm: Let u be the current vertex (which 'ally is s). Find the mi ll i ttttttttttttttttt edge among all edges (ti, r) when- r is neither t nor any vertex already visited. Add this edge to the path. and update the current vertex to r. Repeat this until t is the only vertex not yet viand. At this point add the edge from the current vertex to f as the final edge of the path. [10 marks] (to) Input: A set Y of joutube channels. a set P of people and a and a set of pairs (y,,p,) indicating person pi subscribed channel ye. Problem: Choose a suhwt r of rmitube channel% from 1 so that everyone in P sub-minim. to at least one channel iu Y'. and that the number of chmmels in /' is as small as passible. Algorithm: Repeatedly add to V the channel that %mild give the largest number of 'new' subscriber. (i.e. thaw who did not suss riles to any channel already in 1"), until everyone in P has subscribed something in 1'. [10 marloq (r) Input: A set of objects. each with a weight between 0 and I. Problem: Put all objects into a number of containers, where each container CRII hold objects of total weight at most I. and such that the number of C011taillttS tthed is Iitiitii1160d. Algorithm: Sort all objects ill drUTIII2?11114 order of weights. For each object in this sorted order, among all existing container: that would fit this object, put it into the one with the largaot total aright of objects already in there. If no existing contaitwr can fit this object in. put it into a new container. [10 marks'
This IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment Experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.