SlideServe
Menu
Préférences
© SlideServe · v2026

Network Flow

glustig avatar
22 diapositives · 1.3K Views · Jan 03, 2020

Network Flow. How to solve maximal flow and minimal cut problems. What is Network Flow?. Network Flow is a subsection of graph theory related specifically to situations where something moves from one location to another.

Network Flow - slide 1
01 / 22Network Flow
1 / 17

Télécharger la présentation

Network Flow
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Network Flow How to solve maximal flow and minimal cut problems

  2. What is Network Flow? • Network Flow is a subsection of graph theory related specifically to situations where something moves from one location to another. • An easily visualized example of network flow is piping system through which a quantity of water must pass.

  3. Concepts in Network Flow • “Sources” are nodes which supply a commodity • “Sinks” are nodes which use up a commodity • An edge’s capacity is the maximum amount of flow which can pass through it • Graphs are usually directed

  4. An example • What is the maximum flow from A to B? 4 1 4 5 2 3 A 3 B 6 3 2 2 3 1 5

  5. The Ford-Fulkerson method • This is a relatively simple way to find maximum flow through a network: • Find an unsaturated path from the source to the sink • Add an amount of flow to each edge in that path equal to the smallest capacity in it • Repeat this process till no more paths can be found • The total amount of flow added is then maximal

  6. Storing the graph • It is easiest to store, for each edge in the graph, its capacity in both directions, as well as the current flow in each direction. • Thus for a directed graph, the capacity in the reverse direction will start as zero. • When flow is put through the edge, decrease its capacity in the direction and increase the capacity in the opposite direction.

  7. Finding a path • The eventual answer given by this method is not affected by the path chosen, although the algorithm’s speed will be affected • If possible, the shortest path or the path with maximum flow is a good choice, else simply using a DFS works reasonably well

  8. Minimum Cuts • It is sometimes necessary to know the minimum total weight of a cut that splits the graph in two, separating the source and the sink • This will be equal to the maximum flow through the network

  9. To find the minimum cut • First create the maximum flow graph • Select all the nodes that can be reached from the source by unsaturated edges • Cut all the edges that connect these nodes to the rest of the nodes in the graph • This cut will be minimal

  10. An example • Maximal flow in the graph shown earlier 4 1 4 5 2 3 A 3 B 6 3 2 2 3 1 5

  11. An example • Choose a path and put flow through it 4 1 4 5 2 3 A 3 B 6 2 2 2 2 0 5

  12. An example • Current flow = 1 4 1 4 5 2 3 A 3 B 6 2 2 2 2 0 5

  13. An example • Current flow = 3 4 1 4 3 0 3 A 3 B 4 0 2 2 2 0 5

  14. An example • Current flow = 3 4 1 4 3 0 3 A 3 B 4 0 2 2 2 0 5

  15. An example • Current flow = 5 4 1 2 3 0 3 A 1 B 4 0 0 2 0 0 5

  16. An example • Total flow = 5 4 1 2 3 0 3 A 1 B 4 0 0 2 0 0 5

  17. An example • To find a minimal cut 4 1 [2] 2 3 [3] 0 [4] 3 [5] A 1 B [6] [3] 4 0 [2] 0 [3] 2 0 [1] 0 5

  18. An example • Minimal cut = 1 + 2 + 2 = 5 4 1 2 2 2 3 A 2 B 2 3 2 2 3 1 5

  19. Variations on Network Flow • Undirected graphs – give the edge the capacity in both directions, then increase or decrease this capacity as flow changes, as before.

  20. Variations on Network Flow • Multiple sources / sinks – create a “supersource” or “supersink” which connects directly to each of these nodes, and has infinite capacity 3 S 3 5 5

  21. Variations on Network Flow • Node capacity – split the node into an “in” node, an “out” node and an edge 2 1 4 5 3 2 4 1 3 5

  22. Conclusion • Network flow problems can come in a number of forms, usually relating to some commodity being moved from suppliers to where it is needed. • Also look for minimal cut problems, which can be solved easily with graph theory.