Greedy Algorithms Flashcards

1
Q

What are some cons of greedy algorithms?

A

Local “correct” steps might not mean global correctness.
Often does not lead to optimal solutions.

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

PROBLEM: Vertex Cover

A

Given an undirected graph G = (V, E) on n vertices, find a set X of minimum size such that each edge of G has at least one-endpoint in X.

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

What is the definition of a spanning tree?

A

A subgraph T = (V’ , E’) of G is said to be a spanning tree of G if

  • spanning: V’ = V
  • tree: |E’ | = n - 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

PROBLEM: MST

A

Given an undirected, connected graph G = (V, E) with edge-costs given by cost : E -> R+ , find a spanning tree T = (V, E’) such that the sum of edge costs is minimized.

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

THEOREM: MST

A

For any S c V , let e be the edge of minimum cost having one end-point in S an other end-point in V \ S.
Then, every MST contains the edge e.

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

PROBLEM: Interval Scheduling

A

Select a set C ⊆ R of requests such that |C| is maximized and no two requests from C conflict.

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