Optimization using Greedy Algorithms - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Optimization using Greedy Algorithms

Description:

Global optimal solutions can be obtained by making locally optimal choices. Optimal Substructure. Global optimal solution contains optimal solutions to subproblems ... – PowerPoint PPT presentation

Number of Views:145
Avg rating:3.0/5.0
Slides: 6
Provided by: houg5
Category:

less

Transcript and Presenter's Notes

Title: Optimization using Greedy Algorithms


1
Optimization using Greedy Algorithms
  • Greedy Algorithms produce optimal solutions if
    they have the following characteristics
  • Greedy-Choice Property
  • Global optimal solutions can be obtained by
    making locally optimal choices
  • Optimal Substructure
  • Global optimal solution contains optimal
    solutions to subproblems

2
Activity Selection Problem Description (see
section 16.1, CLRS)
  • We have a set of activities a1, , an
  • We have a resource that can only be used by 1
    activity at a time
  • ai starts at time si and finishes at time fi
    (sifi)
  • ai and aj are compatible if si ? fj or sj ? fi
  • Optimization problem select a maximum-size set
    of mutually compatible activities.

3
Activity Selection Algorithm and Example
  • A a1
  • j 1
  • for(i 1 i lt n i)
  • if(si gt fi)
  • A A U ai
  • j i

4
Matroid Properties(see section 16.4, CLRS)
  • A matroid M (S,I) satisfies the following
  • I is hereditary if B is in I, and A is a subset
    of B, then A is also in I
  • Exchange property If A and B are both in I, and
    A lt B then there must be an element x in B-A
    such that AUx is in I.

5
General Greedy Algorithm for Matroids
  • This algorithm will find an optimal subset A of
    the matroid M (S,I) with weight function w.
  •  
  • A ?
  • Sort S into non-increasing order by weight w
  • For each x in S (in non-increasing order)
  • if A U x is in I
  • then A A U x
  • return A
Write a Comment
User Comments (0)
About PowerShow.com