6.1 Weighted Interval Scheduling Flashcards

1
Q

What is the weighted interval scheduling problem?

A

The goal is to maximize the reward by selecting non-overlapping intervals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the function P(i) in the interval scheduling solution where “i” is the index of an interval?

A

It returns the highest index of the previous intervals that interval “i” does not overlap with.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the OPT function in the weighted interval scheduling problem? Use function P.

A

OPT(j) = max((w_j + OPT(P(j))), (OPT(j-1)))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the problem with implementing the solution to WIS in it simplest form.

A

As each interval results in two function calls, the algorithm would take o(2^n) in time, exponential.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can the problem that a WIS solution is in exponential time be solved?

A

By memorizing the results of function calls to the opt function: Storing the result the first time we compute them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the time complexity of the memorization solution to WIS?

A

O(n):
As the memory has n+1 slots and we fill this array, there can be at most O(n) calls to Compute-Opt. SInce compute opt is constant O(1), we get O(n).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you get the solution in addition to its value?

A

By at each memory slot use a pointer that indicates what value was used in the calculation of this value:
Backtracing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly