SlideShare una empresa de Scribd logo
1 de 17
Push Re Label –Maximum Flow
Preflow Push Algorithm 1
Preflow Push Algorithm 2
Preflow Push Algorithm for Maxflow problem
 Relaxation algorithm:
 Performs local updates repeatedly until global constraint is
satisfied
 Similar to Stencil computations
 Fluid flows from a higher point to a lower point
 In the beginning
 “Source” is the highest point
 “Sink” and all other nodes are at the lowest point
 Source sends maximum flow on its outgoing edges
 Sending flow to out-neighbors is called “Push” operation
 The height of Source’s neighbors is then increased so
that fluid can flow out
 Increasing height of a node is called “Relabel” operation
Preflow Push Algorithm 3
Preflow Push Algorithm for Maxflow problem
 A node is allowed (temporarily) to have
more flow coming into it than flow going
out
i.e. a node can have “excess flow”
But the edges must respect the capacity
condition
Source can have arbitrary amount of excess
flow
 A node is said to be “active” if it has
excess flow in it
Preflow Push Algorithm 4
Preflow Push Algorithm for Maxflow problem
 We increase the height of the “active” node with
a “Relabel” operation
 If h is the minimum height among neighbors that can
accept flow
 Then height is relabeled to (h+1)
 Then we “push” the excess flow to the neighbors
 That are lower than the active node and can admit
flow
 Thus make them active
 Algorithm terminates when there are no “active”
nodes left
Preflow Push Algorithm 5
Example
 A simple graph:
 Nodes have two attributes:
 Height ‘h’
 Excess flow ‘e’
 Edges have pairs:
 First value is edge capacity
 Second value is flow
 Initialize:
 s has h=6 i.e. number of
nodes
 Push 10 along (s,a)
 e(a) = 10
 Push 12 along (s,c)
 e(c) = 12
s
c
a b
t
d
h=6
h=0
e=0
h=0
e=0
h=0
e=0
h=0
e=0
h=0
e=0
10,0
12,0
5,0
8,0
15,0
6,0
17,0
3,0
Preflow Push Algorithm 6
Example
 Relabel c with h=1
 Push 6 along (c,d)
 e(d) = 6
 Relabel c with h=2
 Push 5 along (c,a)
 e(a) = 5
 Relabel c with h=7
 Push -1 along (s,c)
s
c
a b
t
d
h=6
h=0
e=10
h=0
e=10
h=0
e=0
h=1
e=12
h=0
e=0
10,10
12,12
5,0
8,0
15,0
6,0
17,0
3,0
Preflow Push Algorithm 7
Example
 Relabel a with h=1
 Push 15 along
(a,b)
 e(b) = 15
s
c
a b
t
d
h=6
h=1
e=15
h=0
e=0
h=0
e=0
h=7
e=0
h=0
e=5
10,10
12,11
5,5
8,0
15,0
6,6
17,0
3,0
Preflow Push Algorithm 8
Example
 Relabel b with h=1
 Push 3 along (b,t)
 e(t) = 3
 Push 8 along (b,d)
 e(d) = 14
 Relabel b with h=2
 Push -4 along (a,b)
 e(a) = 4
s
c
a b
t
d
h=6
h=1
e=0
h=1
e=15
h=0
e=3
h=7
e=0
h=0
e=6
10,10
12,11
5,5
8,0
15,15
6,6
17,0
3,0
Preflow Push Algorithm 9
Example
 Relabel d with h=1
 Push 14 along (d,t)
 e(t) = 17 s
c
a b
t
d
h=6
h=1
e=4
h=2
e=0
h=0
e=3
h=7
e=0
h=1
e=14
10,10
12,11
5,5
8,8
15,11
6,6
17,0
3,3
Preflow Push Algorithm 10
Example
 Relabel a with h=3
 Push 4 along (a,b)
 e(b) = 4 s
c
a b
t
d
h=6
h=3
e=4
h=2
e=0
h=0
e=17
h=7
e=0
h=1
e=0
10,10
12,11
5,5
8,8
15,11
6,6
17,14
3,3
Preflow Push Algorithm 11
Example
 Relabel b with h=4
 Push -4 along (a,b)
 e(a) = 4 s
c
a b
t
d
h=6
h=3
e=0
h=4
e=4
h=0
e=17
h=7
e=0
h=1
e=0
10,10
12,11
5,5
8,8
15,15
6,6
17,14
3,3
Preflow Push Algorithm 12
Example
 Relabel a with h=5
 Push 4 along (a,b)
 e(b) = 4 s
c
a b
t
d
h=6
h=5
e=4
h=4
e=0
h=0
e=17
h=7
e=0
h=1
e=0
10,10
12,11
5,5
8,8
15,11
6,6
17,14
3,3
Preflow Push Algorithm 13
Example
 Relabel b with h=6
 Push -4 along (a,b)
 e(a) = 4 s
c
a b
t
d
h=6
h=5
e=0
h=6
e=4
h=0
e=17
h=7
e=0
h=1
e=0
10,10
12,11
5,5
8,8
15,15
6,6
17,14
3,3
Preflow Push Algorithm 14
Example
 Relabel a with h=7
 Push -4 along (s,a)
 e(a) = 0 s
c
a b
t
d
h=6
h=7
e=4
h=6
e=0
h=0
e=17
h=7
e=0
h=1
e=0
10,10
12,11
5,5
8,8
15,11
6,6
17,14
3,3
Preflow Push Algorithm 15
Example
 No active nodes
left
 The algorithm
terminates
s
c
a b
t
d
h=6
h=7
e=0
h=6
e=0
h=0
e=17
h=7
e=0
h=1
e=0
10,6
12,11
5,5
8,8
15,11
6,6
17,14
3,3
Preflow Push Algorithm 16
Pseudo code
1. Worklist wl = initializePreflowPush();
2. while (!wl.isEmpty()) {
3. Node n = wl.remove();
4. n.relabel();
5. for (Node w in n.neighbors()) {
6. if (n can push flow to w) {
7. pushflow(n, w);
8. wl.add(w);
9. }
10. }
11. if (n has excess flow) {
12. wl.add(n);
13. }
14. }
Preflow Push Algorithm 17
Conclusion
 Preflow Push is an algorithm to find the
max-flow in a graph
 It exhibits amorphous data parallelism
Parallelism is dependent on the structure of
the graph

Más contenido relacionado

Último

VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130
VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130
VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130Suhani Kapoor
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceanilsa9823
 
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfSoham Mondal
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...gurkirankumar98700
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjLewisJB
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceanilsa9823
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)Delhi Call girls
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubaikojalkojal131
 
Get To Know About "Lauren Prophet-Bryant''
Get To Know About "Lauren Prophet-Bryant''Get To Know About "Lauren Prophet-Bryant''
Get To Know About "Lauren Prophet-Bryant''Lauren Prophet-Bryant
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMotilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMaulikVasani1
 
Zeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectZeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectPriyanshuRawat56
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...Call Girls in Nagpur High Profile
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfKen Fuller
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceSanjay Bokadia
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 

Último (20)

VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130
VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130
VIP Call Girls Service Film Nagar Hyderabad Call +91-8250192130
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best sexual service
 
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Patparganj 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdfExperience Certificate - Marketing Analyst-Soham Mondal.pdf
Experience Certificate - Marketing Analyst-Soham Mondal.pdf
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbj
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
 
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls DubaiDark Dubai Call Girls O525547819 Skin Call Girls Dubai
Dark Dubai Call Girls O525547819 Skin Call Girls Dubai
 
Get To Know About "Lauren Prophet-Bryant''
Get To Know About "Lauren Prophet-Bryant''Get To Know About "Lauren Prophet-Bryant''
Get To Know About "Lauren Prophet-Bryant''
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptxMotilal Oswal Gift City Fund PPT - Apr 2024.pptx
Motilal Oswal Gift City Fund PPT - Apr 2024.pptx
 
Zeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectZeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effect
 
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...Booking open Available Pune Call Girls Ambegaon Khurd  6297143586 Call Hot In...
Booking open Available Pune Call Girls Ambegaon Khurd 6297143586 Call Hot In...
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
CFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector ExperienceCFO_SB_Career History_Multi Sector Experience
CFO_SB_Career History_Multi Sector Experience
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

preflowpush.ppt

  • 1. Push Re Label –Maximum Flow Preflow Push Algorithm 1
  • 2. Preflow Push Algorithm 2 Preflow Push Algorithm for Maxflow problem  Relaxation algorithm:  Performs local updates repeatedly until global constraint is satisfied  Similar to Stencil computations  Fluid flows from a higher point to a lower point  In the beginning  “Source” is the highest point  “Sink” and all other nodes are at the lowest point  Source sends maximum flow on its outgoing edges  Sending flow to out-neighbors is called “Push” operation  The height of Source’s neighbors is then increased so that fluid can flow out  Increasing height of a node is called “Relabel” operation
  • 3. Preflow Push Algorithm 3 Preflow Push Algorithm for Maxflow problem  A node is allowed (temporarily) to have more flow coming into it than flow going out i.e. a node can have “excess flow” But the edges must respect the capacity condition Source can have arbitrary amount of excess flow  A node is said to be “active” if it has excess flow in it
  • 4. Preflow Push Algorithm 4 Preflow Push Algorithm for Maxflow problem  We increase the height of the “active” node with a “Relabel” operation  If h is the minimum height among neighbors that can accept flow  Then height is relabeled to (h+1)  Then we “push” the excess flow to the neighbors  That are lower than the active node and can admit flow  Thus make them active  Algorithm terminates when there are no “active” nodes left
  • 5. Preflow Push Algorithm 5 Example  A simple graph:  Nodes have two attributes:  Height ‘h’  Excess flow ‘e’  Edges have pairs:  First value is edge capacity  Second value is flow  Initialize:  s has h=6 i.e. number of nodes  Push 10 along (s,a)  e(a) = 10  Push 12 along (s,c)  e(c) = 12 s c a b t d h=6 h=0 e=0 h=0 e=0 h=0 e=0 h=0 e=0 h=0 e=0 10,0 12,0 5,0 8,0 15,0 6,0 17,0 3,0
  • 6. Preflow Push Algorithm 6 Example  Relabel c with h=1  Push 6 along (c,d)  e(d) = 6  Relabel c with h=2  Push 5 along (c,a)  e(a) = 5  Relabel c with h=7  Push -1 along (s,c) s c a b t d h=6 h=0 e=10 h=0 e=10 h=0 e=0 h=1 e=12 h=0 e=0 10,10 12,12 5,0 8,0 15,0 6,0 17,0 3,0
  • 7. Preflow Push Algorithm 7 Example  Relabel a with h=1  Push 15 along (a,b)  e(b) = 15 s c a b t d h=6 h=1 e=15 h=0 e=0 h=0 e=0 h=7 e=0 h=0 e=5 10,10 12,11 5,5 8,0 15,0 6,6 17,0 3,0
  • 8. Preflow Push Algorithm 8 Example  Relabel b with h=1  Push 3 along (b,t)  e(t) = 3  Push 8 along (b,d)  e(d) = 14  Relabel b with h=2  Push -4 along (a,b)  e(a) = 4 s c a b t d h=6 h=1 e=0 h=1 e=15 h=0 e=3 h=7 e=0 h=0 e=6 10,10 12,11 5,5 8,0 15,15 6,6 17,0 3,0
  • 9. Preflow Push Algorithm 9 Example  Relabel d with h=1  Push 14 along (d,t)  e(t) = 17 s c a b t d h=6 h=1 e=4 h=2 e=0 h=0 e=3 h=7 e=0 h=1 e=14 10,10 12,11 5,5 8,8 15,11 6,6 17,0 3,3
  • 10. Preflow Push Algorithm 10 Example  Relabel a with h=3  Push 4 along (a,b)  e(b) = 4 s c a b t d h=6 h=3 e=4 h=2 e=0 h=0 e=17 h=7 e=0 h=1 e=0 10,10 12,11 5,5 8,8 15,11 6,6 17,14 3,3
  • 11. Preflow Push Algorithm 11 Example  Relabel b with h=4  Push -4 along (a,b)  e(a) = 4 s c a b t d h=6 h=3 e=0 h=4 e=4 h=0 e=17 h=7 e=0 h=1 e=0 10,10 12,11 5,5 8,8 15,15 6,6 17,14 3,3
  • 12. Preflow Push Algorithm 12 Example  Relabel a with h=5  Push 4 along (a,b)  e(b) = 4 s c a b t d h=6 h=5 e=4 h=4 e=0 h=0 e=17 h=7 e=0 h=1 e=0 10,10 12,11 5,5 8,8 15,11 6,6 17,14 3,3
  • 13. Preflow Push Algorithm 13 Example  Relabel b with h=6  Push -4 along (a,b)  e(a) = 4 s c a b t d h=6 h=5 e=0 h=6 e=4 h=0 e=17 h=7 e=0 h=1 e=0 10,10 12,11 5,5 8,8 15,15 6,6 17,14 3,3
  • 14. Preflow Push Algorithm 14 Example  Relabel a with h=7  Push -4 along (s,a)  e(a) = 0 s c a b t d h=6 h=7 e=4 h=6 e=0 h=0 e=17 h=7 e=0 h=1 e=0 10,10 12,11 5,5 8,8 15,11 6,6 17,14 3,3
  • 15. Preflow Push Algorithm 15 Example  No active nodes left  The algorithm terminates s c a b t d h=6 h=7 e=0 h=6 e=0 h=0 e=17 h=7 e=0 h=1 e=0 10,6 12,11 5,5 8,8 15,11 6,6 17,14 3,3
  • 16. Preflow Push Algorithm 16 Pseudo code 1. Worklist wl = initializePreflowPush(); 2. while (!wl.isEmpty()) { 3. Node n = wl.remove(); 4. n.relabel(); 5. for (Node w in n.neighbors()) { 6. if (n can push flow to w) { 7. pushflow(n, w); 8. wl.add(w); 9. } 10. } 11. if (n has excess flow) { 12. wl.add(n); 13. } 14. }
  • 17. Preflow Push Algorithm 17 Conclusion  Preflow Push is an algorithm to find the max-flow in a graph  It exhibits amorphous data parallelism Parallelism is dependent on the structure of the graph