subject

Suppose we have a number of events mi. Each event starts at time si and finishes at time ei, where 0 <= si <= e. We represent the event mi with the closed interval [si, ei]. Our goal is to construct a maximum size set of events, where no two events in the set overlap (note that two events mi and mj where mi = [., x] and mj = [x, .] are not considered to overlap). Suppose the following intervals are provided.

Event Index Interval
A [1,4]
B [2,3]
C [3,6]
D [5, 9]
E [7,11]

Required:
a. Give the optimal set of events for this example set of intervals.
b. Consider the following greedy approach: at each step, select the event with the earliest starting time that does not conflict with any event already in our set. Show that this approach is not optimal by providing the greedy solution generated by this approach for the above example intervals.
c. Consider a second greedy approach: first order the events by length. Then, at each step, select the event with the shortest length that does not conflict with any event already in our set. While this approach generates the optimal set for the above example, it is not guaranteed to do so for this problem generally. Give a set of 5 intervals for which this second greedy approach fails to generate the optimal solution. Explicitly state both the optimal solution and the solution generated by this approach for your example.
d. State a greedy approach to this problem that always finds the optimal solution.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 16:00
How do i draw hello world in python and how do i make it loop?
Answers: 1
question
Computers and Technology, 22.06.2019 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
question
Computers and Technology, 22.06.2019 22:30
Jason needs to learn a new web tool. he went through his books to understand more about it. now he wants hands-on experience with using that tool. what would him? jason can use websites where workspace is provided to test the results of your code.
Answers: 2
You know the right answer?
Suppose we have a number of events mi. Each event starts at time si and finishes at time ei, where 0...
Questions
question
Mathematics, 21.08.2019 23:40
Questions on the website: 13722362