SLIDE 5 17/04/2015 5
25
Ho w to c o mpute the lo ng e st pa th?
ind a to po lo g ic a l o rde r o f the g ive n c p-DAG A to po lo g ic a l o rde r is suc h tha t o f the re is a n a rc fro m to in the c p-DAG, the n a ppe a rs b e fo re in the to po lo g ic a l o rde r → c a n b e do ne in E xa mple : fo r this c p-DAG po ssib le to po lo g ic a l o rde rs a re
- , , , , , , , ,
- , , , , , , , ,
- , , , , , , , ,
- 2. Longest path
26
Ho w to c o mpute the lo ng e st pa th?
- 2. F
- r e a c h ve rte x , o f the c p-DAG in the to po lo g ic a l o rde r,
c o mpute the le ng th o f the lo ng e st pa th e nding a t , b y lo o king a t its inc o ming ne ig hb o rs a nd a dding , to the ma ximum le ng th re c o rde d fo r tho se ne ig hb o rs If , ha s no inc o ming ne ig hb o rs, se t the le ng th o f the lo ng e st pa th e nding a t , to , E xa mple :
- F
- r , re c o rd 1
- F
- r , re c o rd 2
- F
- r , re c o rd 5
- F
- r , re c o rd 6
- F
- r , re c o rd max 5, 6 6
- 2. Longest path
27
Ho w to c o mpute the lo ng e st pa th?
ina lly, the lo ng e st pa th in the c p-DAG ma y b e o b ta ine d b y sta rting a t the ve rte x , with the la rg e st re c o rde d va lue , the n re pe a te dly ste pping b a c kwa rds to its inc o ming ne ig hb o r with the la rg e st re c o rde d va lue , a nd re ve rsing the se q ue nc e fo und in this wa y E xa mple : recorded values Co mple xity o f the lo ng e st pa th c o mputa tio n:
- 2. Longest path
- Sta rting a t a nd ste pping
b a c kwa rd we find the se q ue nc e , , , , ,
he lo ng e st pa th is the n , , , , , 28
I n the absence o f c o nditio nal b ra nc he s, the vo lume o f a ta sk is the wo rst-c a se e xe c utio n time ne e de d to c o mple te it o n a de dic a te d sing le -c o re pla tfo rm I t c a n b e c o mpute d a s the sum o f the WCE T s o f a ll its ve rtic e s: ,
,∈
1
It a lso re pre se nts the ma ximum a mo unt o f wo rklo a d g e ne ra te d b y a sing le insta nc e o f a DAG-ta sk
29
I n the presence o f c o nditio nal b ra nc he s, the wo rst-c a se wo rklo a d o f a ta sk is the wo rst-c a se e xe c utio n time ne e de d to c o mple te it o n a de dic a te d sing le -c o re pla tfo rm, o ve r all c o mbinatio n o f c ho ic e s fo rthe c o nditio nalbranc he s I n this e xa mple , the wo rst-c a se wo rklo a d is g ive n b y a ll the ve rtic e s e xc e pt , sinc e the b ra nc h c o rre spo nding to yie lds a la rg e r wo rklo a d
It a lso re pre se nts the ma ximum a mo unt o f wo rklo a d g e ne ra te d b y a sing le insta nc e o f a c p-ta sk
30
Ho w c a n it b e c o mpute d?
re ve rse to po lo g ic a l o rde r ta ke s the e le me nt o f the pe rmuta tio n S ta ke s the a c c umula te d wo rst-c a se wo rklo a d fro m till the e nd o f the c p-DAG if the ve rte x ha s so me suc c e sso rs if the ve rte x is the he a d no de o f a c o nditio na l pa ir ∗ is the suc c e sso r o f a c hie ving the la rg e st pa rtia l wo rklo a d ∗ is me rg e d into if inste a d the ve rte x is a re g ula r o ne the wo rklo a d o f a ll suc c e sso rs is me rg e d into the wo rst-c a se wo rklo a d a c c umula te d by the so urc e ve rte x is re turne d a s o utput