Upload
jesse-lockhart
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
Lecture 11
Overview
Self-Reducibility
Overview on Greedy Algorithms
strategy.greedy thefrom followsproperty
exchange themeanwhile ty,reducibili-self andproperty
exchangewith together foundoften is algorithmgreedy The
Revisit Minimum Spanning Tree
Exchange Property
tree.spanning minimum a
still is )\(such that in edgean exist
must there, without treespanning minimum a and
graph ain eight smallest w with the edgean For
e e'TTe'
eT
Ge
Self-Reducibility
.' of treespanning minimum a is Then point. a
into shrinkingby ly respective , and from
obtained be and Let . of edgean is and
graph a of treespanning minimum a is Suppose
GT'
eTG
T'G'Te
GT
Max Independent Set in Matroid
Exchange Property
tree.spanning minimum a
still is )\(such that in edgean exist
must there, without set t independen minimum a and
matroid ain eight smallest w with theelement an For
e e'TTe'
eT
Ge
Self-Reducibility
.' of treespanning minimum a is Then point. a
into shrinkingby ly respective , and from
obtained be and Let . of edgean is and
graph a of treespanning minimum a is Suppose
GT'
eTG
T'G'Te
GT
etc.. Ratio, Local as
such ,algorithms of sother type ofdesign in used
also isty reducibili-self The ty.reducibili-self
using algorithms of pespopular ty threeare
Greedy Program, Dynamic Conquer,-and-Divide
Overview on Greedy Algorithms
Exchange Property
Matroid
Self-Reducibility
Local Ratio Method
Basic Idea
*)(*)(*)()()()(
*)()( *),()(
.function objectivefor solution optimalan is *then
,function objectivefor solution optimalan also and
function objectivefor solution optimalan is * If
).()()( Suppose
)(maxor )(minx
problemtion optimimizaan Consider
2121
2211
2
1
21
xcxcxcxcxcxc
xcxcxcxc
cx
c
cx
xcxcxc
xcxcxx
Proof
Basic Idea
).(min toreduced is
problem thesolutions, optimal ofset large a has )(When
.function objectivefor solution optimalan is *then
,function objectivefor solution optimalan also and
function objectivefor solution optimalan is * If
).()()( Suppose
)(maxor )(minx
problemtion optimimizaan Consider
2
1
2
1
21
xc
xc
cx
c
cx
xcxcxc
xcxc
x
xx
Minimum Spanning Tree
1
56
3 4
2
7 5
1
1 1
1 1
1
1 1
0
4 4
1
2 3
5 6
solution! optimalan
is treespanningEvery
1
44
5 6
2
Activity Selection
.),[),[ : pingnonoverlap
y.cardinalit themaximize tointervals
pingnonoverlap ofsubset a find ),,[
),...,,[),,[ intervals ofset aGiven 2211
jjii
nn
fsfs
fs
fsfs
Puzzle
solution? optimalan find way toefficient an findyou can not, If
hold? stillproperty exchange theDoes
intervals.
pingnonoverlap weight totalmaximum thefind want to weandweight
enonnegativ a has intervaleach suppose problem,selection -activityIn
17
Independent Set in Interval Graphs
Activity 9Activity 8Activity 7Activity 6Activity 5Activity 4Activity 3Activity 2Activity 1
• We must schedule jobs on a single processor with no preemption. • Each job may be scheduled in one interval only.• The problem is to select a maximum weight subset of non-conflicting
jobs.
time
18
Independent Set in Interval Graphs
I
IxIp )( }1,0{Ix
)()(:
1IftIsIIx
Activity9Activity8Activity7Activity6Activity5Activity4Activity3Activity2 Activity1
Maximize s.t. For each instance I
For each time t
time
Slide from http://www.cs.technion.ac.il/~reuven/STOC2000.ppt
19
Maximal Solutions
• We say that a feasible schedule is I-maximal if either it contains instance I, or it does not contain I but adding I to it will render it infeasible.
Activity9Activity8Activity7Activity6Activity5Activity4Activity3Activity2 Activity1
time
I2I1
The schedule above is I1-maximal and also I2-maximal
20
An effective profit function
P1= P(Î)
P1=0
P1=0
P1=0
P1=0
P1=0
Activity9Activity8Activity7Activity6Activity5Activity4Activity3Activity2 Activity1
Let Î be an interval that ends first;
Î
P1= P(Î)
P1= P(Î)
P1= P(Î)
Slide from http://www.cs.technion.ac.il/~reuven/STOC2000.ppt
negative.) becan )( :(note )()()(
otherwise 0
ˆith conflect win if )ˆ()(
212
1
IpIpIpIp
IIIpIp
21
An effective profit function
P1= P(Î)
P1=0
P1=0
P1=0
P1=0
P1=0
Activity9Activity8Activity7Activity6Activity5Activity4Activity3Activity2 Activity1
Î
P1= P(Î)
P1= P(Î)
P1= P(Î)
For every feasible solution x: p1 ·x p(Î) For every Î-maximal solution x: p1 ·x p(Î)
Every Î-maximal is optimal.
Slide from http://www.cs.technion.ac.il/~reuven/STOC2000.ppt
22
Independent Set in Interval Graphs:An Optimization Algorithm
Algorithm MaxIS( S, p )1. If S = Φ then return Φ ;2. If I S p(I) 0 then return MaxIS( S - {I}, p);3. Let Î S that ends first;4. I S define: p1 (I) = p(Î) (I in conflict with Î) ;5. IS = MaxIS( S, p- p1 ) ;6. If IS is Î-maximal then return IS else return IS {Î};
Slide from http://www.cs.technion.ac.il/~reuven/STOC2000.ppt
23
Running Example
P(I1) = 5 -5
P(I4) = 9 -5 -4
P(I3) = 5 -5
P(I2) = 3 -5
P(I6) = 6 -4 -2
P(I5) = 3 -4
-5 -4 -2
Slide from http://www.cs.technion.ac.il/~reuven/STOC2000.ppt
Minimum Weight Arborescence
Definition
.other every to frompath a is There (b)
tree.spanning a is
then ignored, are edges theof directions theIf (a)
hold. conditions following thesuch that and edges
opposite ofpair acontain not does which ),( of
),(subgraph a is root with An
Vvr
T
EVG
FV T rcearborescen
Problem
cost. totalminimum with earborecenc
an find , node a and :cost edge
enonnegativ with ),(graph directed aGiven
VrREc
EVG
Key Point 1
. nodeat edges-in ofset the)( vvin
. cycle a contains * Otherwise, optimal. is
* then ce,arborescenan is }}{|{* If
).( from edgecheapest a choose ,each For
CF
FrVveF
verv
v
inv
Key Point 2
. nodeat edges-in ofset the)( vvin
. cycle a contains * Otherwise, optimal. is
* then ce,arborescenan is }}{|{* If
).( from edgecheapest a choose ,each For
CF
FrVveF
verv
v
inv
'.' .cost w.r.tminiman isit iff
cost w.r.t minimum is cearborescenan Then,
).,('),(),('' and
)(),(' define ),(),(For
c
cF
vucvucvuc
ecvucvvu vin
Why?
'.function cost for solution
optimalan is cearborescenany that means This
.)()('
, cearborescenany For
}{
c
ecFc
F
rVvv
Key Point 3
once.exactly enters which ),(
cearborescencost -minimum a exists Then there
.0)(''with containingnot cycle a be Let
C FVT
Ccr C
0
A Property of MST
.)(\*)(in edges least
at contains ,*)(\)(subset any for :Claim
. ,in edgeevery fore and edge contains
which cycle a contains * *),(\)(each For
.)(set ,)(*)( edgeevery For
. oflength thedenotes
where,)(),(every for such that *)()( :
mapping onto one-to-one a is Then there ly.respective network, a of
treespanning minimum theand treespanning a be * and Let
TETE|F|
QTETEF
ee'Qe'e
QTeTETEe
eeTETEe
ee
eeTEeTETE
TT
eFe
e
e
.)(\*)(in edges| contains that
obtain we,'back Adding .)(\*)(in edges 1
least at contains ' ,hypothesisinduction By
.'''in contained is 'Each . ' Clearly,
.'by denoted ,'' containing one is ewhich ther
in cycles ofunion a is then , contains If
.'set then ,contain not does If
}.{''Consider .')( = Denote
.))(\*)(( choose and edgean fix 2, For
tree.a is that ingcontradict ,
for cycle contains otherwise, since, trivialisit ,1For
''}{''
''''}{''
''
''''
''''''
TETE|FQ
eTETE|F|-
Q
eTQQQ
Qe
QQe'Q
QQe'Q
eFeeeTT'
TETEQe'Fe|F|
TFe
QT |F|=
eFe
eeFe
eeFeeeFe
e
eee
eee
e
e
.)(e hence and in is )(
,*)(\)(every for such that )(\*)( to*)(\)(
from mapping one-to-one a exists thereTheorem, Marriage sHall'By
eQe
TETEeTETETETE
e
*).()()(
Therefore, .)(
hence ),(such that )( exists theredifferent,
are and * Since .)(such that *)()(:
mapping onto one-to-one a exists Then there . tree
spanninganother Consider tree.spanning minimum a be *Let
tree.
spanning minimum unique has Then weights.enonnegativ
distinct have ),(graph connected of edges all Suppose
)()(
TlengtheeTlength
ee
eeTEe
TTeeTETE
T
T
G
EVG
TEeTEe
*).())(()()(
Therefore, (e)).()(
Then, .most at lengths of piecessmaller into of edges all
partition torequired pointsSteiner ofnumber minimum the
denote )(Let .)(such that *)()(:
mapping onto one-to-one a exists Then there . tree
spanninganother Consider tree.spanning minimum a be *Let
tree.spanning
minimum thefrom obtained is pointsSteiner ofnumber
minimum with spanning dsteinerize that theShow .most
at length ofeach piences into break them toedges itson points
Steiner some puttingby on treespanning a from obtained
treea is on treespanning dsteinerizeA number. positive
fixed a be Let plane.Euclidean in the set point aConsider
)()(
TnenenTn
nen
RT
TneeTETE
T
T
R
P
P
RP
sTEe
sTEe
ss
ss
s
*).(cost)()(cost
Therefore, .)(such that *)()(:
mapping onto one-to-one a exists Then there . tree
spanninganother Consider tree.spanning minimum a be *Let
. minimizes
whichone thei.e., tree,spanning minimum theis 0 fixed
anyfor minimizes which treespaning that theShow
.: weight edge with ),(graph aConsider
)()(
)(
)(
TeeT
eeTETE
T
T
e
eT
REwEVG
TEeTEe
TEe
TEe