Greedy Algorithms Flashcards

The type of algorithms, proofs and questions (20 cards)

1
Q

What are Greedy Algorithms?

A

Picking the nest thing to do that looks like the best option in that moment

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

What is Interval Scheduling?

A

GOAL: find maximum subset of mutually compatible jobs.

Compatible: jobs that don’t overlap

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

What is Interval Partitioning?

A

Consider Lecture j that starts at s_j and fnishes at f_j.

GOAL : find the least number of classrooms to schedule all lectures so that no two occur at the same time in the same room.

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

What is minimizing lateness?

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

What is Optimal Offline Caching?

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

What is Coin Changing?

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

What is meant by ‘Selecting Breakpoints’?

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

What are the methods of proving that the greedy strategy is the optimal strategy?

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

What is the Greedy Template for Interval Scheduling?

A
  • Earliest Start Time : choosing earliest start time (s_j)
  • Earliest Finish Time : choosing earliest finish time (f_j)
  • Shortest Duration: Choosing lowest (f_j - s_j)
  • Fewest Conflicts: for each job j counter conflicts and order in ascending conflicts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Out of each greedy options for interval scheduling which are optimal and which are not?

A
  • Earliest start time: NOT OPTIMAL
  • Earliest finish time: OPTIMAL
  • Shortest Duration: NOT OPTIMAL
  • Fewest Conflicts: NOT OPTIMAL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the Counterexample for the earliest start time for interval scheduling?

A

consider selecting job with early start time but extremely long duration, taking up entire time

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

Counter example for using shortest duration greedy template for interval scheduling?

A

consider job with short duration that is incompatible with 2 longer duration jobs which are compatible with each other

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

Counterexample for using fewest conflicts greedy template for interval scheduling?

A

consider a job with few conflicts that is incompatible with a jobs with more conflicts however those 2 jobs are compatible with each other and the original job is compatible with neither.

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

What is the proof that the earliest-finish-first greedy strategy is optimal for interval scheduling?

A
  • Assume for contradiction that the greedy algorithm is not optimal
  • Assume that the greedy algorithm is a set of defined intervals i_… and the optimal solution is a set of defined intervals/jobs b_..
  • Say that they are the same up to some maximum value r.
  • Now consider the next job to be selected by either algorithms and use the exchange arguement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly