SlideShare uma empresa Scribd logo
1 de 42
Algorithm Design and Complexity

                         Course 12
Overview
   Flow Networks
   Positive Flow and Net Flow
   Flow Properties
   Maximum Flow
   Minimum Cut
   Ford-Fulkerson Method
   Edmonds-Karp Algorithm
   Sample Applications
Flow Networks
   Graphs that model materials that are transported
    through conduits
   Each edge represents a conduit: it has a capacity
    that is an upper bound for the flow rate
   Some vertices may produce materials: sources
   Other vertices may consume materials: sinks
Flow Networks (2)
   The simplest version of flow networks:
       Think of edges as pipes of different sizes (capacities)
       The flow is the effective quantity of liquid that is transported
        through the pipes

   Flow Networks are also called transportation networks
   But you can transport a lot of things beside liquids, like
    commodities, information, electricity, traffic

   There are some interesting and difficult problems for flow
    networks:
       Maximum flow problem
       Maximum flow with minimum cost problem
       Circulation problem
       Multi-commodity problem
Flow Networks (3)
   G(V, E) – directed graph
   The capacity function c: E → R+
   c(u, v) = the capacity of the edge (u, v)
    (u,v)  E  c(u,v) = 0

   Assume we have a single source vertex: s
   Assume we have a single sink vertex: t
   Assume we have a path s .. v .. t  vV
Positive Flow
   We can define a function called positive flow
       p: V x V  R+

   Properties of positive flow:
   Capacity constraint:
         u, vV: p(u, v) <= c(u, v)
   Flow conservation:
         uV  {s, t}: flow_in(u) = flow_out(u)
         uV  {s, t}: vV(p(v, u)) = vV(p(u, v))
Positive Flow – Example
   Notation on each edge: positive flow/capacity
   Note that the two properties are respected
       The flow is always lower than the capacity of each edge
       The flow is conserved in each vertex
       The source produces flow
       The sink consumes flow
Cancellation for Positive Flow
   Note that in the previous example we have:
       1 unit of flow from x  z
       2 units of flow from z  x
   We can cancel 1 unit of flow in both directions
       0 units of flow from x  z
       1 unit of flow from z  x
       Flow conservation is still respected (we cancel the same
        amount of flow in each direction)
       Capacity constraint is still respected (the flow is decreased)
   In both cases, the “net flow” is 1 from z  x

   Without loss of generality, we may always define a
    positive flow in a flow network such that for each (u, v),
    u,vV, we have positive flow either from u  v or from v
     u, but not in both directions!
Net Flow
   We can define a function called net flow
       f: V x V  R

   Properties of net flow:
   Capacity constraint:
         u, vV: f(u, v) <= c(u, v)
   Flow conservation:
         uV  {s, t}: total_net_flow_in(u) = 0
         uV  {s, t}: vV(f(u, v)) = 0
   Skew symmetry:
         u, vV: f(u, v) = - f(v, u)
Net Flow (2)
   Conservation of net flow can be rewritten:

vV (f(u, v)) = 0

As f(u, v) might be either positive or negative
 uV  {s, t}: vV and f(u,v)<0(f(u, v)) + vV and f(u,v)>0 (f(u, v))
  =0
 uV  {s, t}: vV and f(v,u)>0(f(v, u)) = vV and f(u,v)>0 (f(u, v))
  “total positive flow entering u” = “total positive flow
  leaving u”
  “flow in” = “flow out”
Net Flow – Example
   Only positive flow is illustrated in graphical
    representations
   Nevertheless, this does not mean that the (negative)
    net flow does not exist in the other direction
Positive Flow and Net Flow
   Differences

   Net flow satisfies skew symmetry

   p(u, v) >= 0, while
                      f(u, v) >= 0 or f(u, v) <= 0
Positive Flow and Net Flow (2)
   Equivalence
   We can define net flow using only positive flow and vice-
    versa

   f(u, v) = p(u, v) – p(v, u)  u, vV
   Need to show that using this definition, the net flow still
    satisfies the three properties: capacity constraint,
    conservation and skew symmetry

   p(u, v) = f(u, v)   if f(u, v) > 0
   p(u, v) = 0         otherwise
   Need to show that this definition satisfies the two
    properties of positive flow: capacity constraint and
    conservation
Positive Flow and Net Flow (3)
   f(u, v) = p(u, v) – p(v, u)  u, vV
   Capacity constraint:
    p(u, v) <= c(u, v) and p(v, u) >= 0
    => f(u, v) = p(u, v) – p(v, u) <= p(u, v) <= c(u, v)
   Flow conservation:
    vV (f(u, v)) = vV (p(u, v) – p(v, u)) = vV (p(u, v)) – vV
    (p(v, u)) = (from positive flow conservation) = 0
   Skew symmetry:
    f(u, v) = p(u, v) – p(v, u) = –(p(v, u) – p(u, v)) = –f(v,u)

    Similar for the transformation from f(u, v)  p(u, v). Prove
    them at home!
Value of the Flow
   From now on, we shall only use net flow

   Value of the flow = |f| = vV (f(s, v)) = vV (f(v, t))
       In the example below: |f| = 3
Cancellation of (Net) Flow
   Let’s say that f(u, v) = 5 and c(u, v) = 8
       We can “ship” at most 3 units of flow from u  v
       => f(u, v) = 8 = c(u, v)
       But we can also “ship” up to 5 units of flow back from v 
        u
       => f(u, v) = 3 if we cancel 2 units of flow!
       Called flow cancellation
   If (v, u) E => f(v, u) <= c(v, u) = 0
       We are not allowed to have a positive flow from v  u
       But we are allowed to have negative flow!
       This negative flow is equal in absolute value with the
        positive value from u  v
Cancellation of (Net) Flow (2)
   Due to cancellation, a flow only gives us this so-
    called “net” effect. We cannot reconstruct actual
    “shipments” of products from a net flow.
   A flow f(u, v) = 5 and f(v, u) = -5 can mean either:

    5 units u  v     6 units u  v       8 units u  v
    0 units v  u     1 units v  u       3 units v  u
Flow Operations
   Extend the definition of the flow to sets of vertices
   X,Y  V
   f(X,Y) = ΣxXΣyY f(x,y) = total flow between X and Y

   Possible operations:
       XV f(X,X) = 0;
       X,YV f(X,Y) = -f(Y,X);
       X,Y,ZV si Y⊆X
           f(X Y, Z) = f(X,Z) - f(Y,Z);
           f(Z, X Y) = f(Z,X) - f(Z,Y);
       X,Y,ZV si XY=
           f(X Y, Z) = f(X,Z) + f(Y,Z);
           f(Z, X Y) = f(Z,X) + f(Z,Y)
       |f| = f(s,V) = f(V,t)
Examples (1)

                           X             1/2
                                    a               b
                     1/8                                  2/2

                               4/4            3/3
                 s                                            t

                                                        3/9   Y
                                c                   d
                                        3/5


                       f(X,Y) = ΣxXΣyY f(x,y)


f(X,X) = f(s,a) + f(a,s) + f(s,b) + f(b,s) + f(a,b) + f(b,a) = 0
f(X,Y) = f(b,c) + f(b,t) = -f(c,b) - f(t,b) = -f(Y,X)
                                        Proiectarea Algoritmilor 2010
Examples (2)

                           X              1/2
                                     a             b
                     1/8                                        2/2
                                                 Y
                 s             4/4           3/3                               t

                                c                                        3/9       Z
                                                 3/5           d


 X, Y, Z  V si Y ⊆ X
            f(X Y, Z) = f(X, Z) - f(Y, Z)
            f(Z, X Y) = f(Z, X) - f(Z, Y)

     f(X Y, Z) = 0 = f(b,t) + f(c,d) - f(b,t) - f(c,d) = f(X,Z) - f(Y,Z)
     f(Z, X Y) = 0 = f(t,b) + f(d,c) - f(t,b) - f(d,c) = f(Z,X) - f(Z,Y)

                                         Proiectarea Algoritmilor 2010
Examples (3)
                                                      Z
                         X             1/2
                                  a               b
                   1/8                                    2/2

               s             4/4            3/3              t

                                                       3/9   Y
                              c                   d
                                      3/5

 X, Y, Z  V si X  Y = 
            f(XY, Z) = f(X,Z) + f(Y,Z)
            f(Z, XY) = f(Z,X) + f(Z,Y)

    f(X Y, Z) = f(s,b) + f(a,b) + f(t,b) + f(d,c) = f(X,Z) + f(Y,Z)
    f(Z, X Y) = f(b,a) + f(b,s) + f(b,t) + f(c,d) = f(Z,X) + f(Z,Y)

                                      Proiectarea Algoritmilor 2010
Examples (4)

                                1/2
                            a               b
                 1/8                                2/2
                       4/4            3/3
             s                                            t

                                                  3/9
                        c                   d
                                3/5



  f(s, V) = f(V, t)

  f(s, V) = f(s,a) + f(s,b) = 5 = f(d,t) + f(b,t) = f(V, t)


                                 Proiectarea Algoritmilor 2010
Maximum Flow Problem
   Given G(V, E), c: E  R+, sV and tV
   Find the maximum flow that can be “transported” from s
    to t

   We start with an initial void flow on all edges
   We want to compute the net flow between each pair of
    vertices that determines a maximum flow!

   Various methods are used
   Only look at one of the simplest:
       Ford-Fulkerson and Edmonds-Karp
       Uses the notion of residual network
Residual Network
   Given G(V, E), c: E  R+, sV and tV
   Knowing a given flow in the graph, f: E  R

   We can compute the residual capacity for any pair of
    vertices:
       cf(u, v) = c(u, v) – f(u, v) >= 0 (due to capacity constraint)
       Residual means: how much flow we can still transport from u 
        v
   We can compute the residual network of the graph:
       It is a graph Gf = (V, Ef)
       Ef = {(u, v)  V x V | cf(u, v) > 0}
       It is a graph that contains edges that have residual capacity
        (that can still transport flow!)
       How many edges does Gf have? Find the minimum and the
        maximum value!
Residual Network – Example
Augmenting Path
   Any path from the residual graph admits more flow
    from the start vertex to the end vertex
   Therefore, we want to find a path from the source s
    to the sink t in the residual graph: augmenting path

   Look for p = s..t in Gf
   If we can find this augmenting path, compute how
    much flow we can send along it!
       We are constrained by the minimum residual capacity of
        any edge along the augmenting path
       cf(p) = min(cf(u, v) | (u, v) is on p)
Augmenting Path – Example
   p = <(s, w), (w, y), (y, z), (z, t)>
   Is it unique? Can you find another?
Summing Flows
   If the graph G has a flow f
   And we can find another flow f’
   We can sum up the two flows to find the new flow:
          f(u,v) + f’(u,v)
   The value of the new flow is |f| + |f’|

   Therefore, if we can find an augmenting path, p, in the residual
    network of a graph, we can also find another flow, fp: V x V 
    R
   fp(u,v) = cf(p) if (u,v) is on p
   fp(u,v) = -cf(p) if (v,u) is on p
   fp(u,v) = 0

   We can thus define a new flow in G: |f’| = |f| + |fp| > |f|
       Thus, we can improve the existing flow!
Graph Cuts
   A cut (S, T) of a flow network G(V, E) is a partitionof
    the vertices into two sets S (sS) and T = V  S (t
    T)
       Already know cuts for minimum spanning trees
   The flow across the cut is f(S, T)
   The capacity of the cut is c(S, T) = summing up the
    capacities of all the edges starting from a vertex in S
    and ending in a vertex in T
   A minimum cut in G is a cut whose capacity is
    minimum over all the possible cuts in G
Graph Cuts – Example
   S = {s, w, y}, T = {x, z, t}
   f(S, T) = f(w, x) + f (y, x) + f(y, z) = 2 + (-1) + 2 = 3
       Includes positive flow that goes either direction across the
        cut
       But only takes into account net flow that goes from any
        vertex in S to any vertex in T
   c(S, T) = c(w, x) + c(y, z) = 2 + 3 = 5
Max-Flow Min-Cut Theorem
   The following statements are equivalent:
       f is a maximum flow in G
       There is no augmenting path in Gf
       |f| = c(S, T) for all minimum cuts (S, T)

   This theorem gives us a method to compute the
    maximum flow: push flow along augmenting paths
    until you cannot find any
   This theorem also tells us how to compute a
    minimum cut once the maximum flow is known
       When f is a maximum flow, all the vertices reachable from
        s in Gf are in S, the others are in T => (S, T) is a minimum
        cut
Ford-Fulkerson Method
1.        Start with a void flow
2.        Compute the residual graph for the given flow
3.        If there is an augmenting path in this residual graph
     a)     Increase the flow along it
     b)     Go to step 2
4.        The maximum flow has been reached!

         The disadvantage of this method is that it does not
          specify how to look for the augmenting path in step 3
           Any method can be used
           Pick a random augmenting path
           Use any search algorithms to compute the path: DFS, BFS
           Be greedy: look for the fattest pipe each time! How?
Ford-Fulkerson Method (2)
   If the augmenting path is not picked smartly, then the
    worst case running time for the algorithm is O(E*|fmax|)
   Why?
   Each augmenting path has at most O(E) edges that will
    cause a change in the value of the flow along them at
    each step!
   Maximum number of steps is fmax if a each step cf(p)=1
   See the example on the next slides!
   It is not good that the running time depends on fmax
       What happens if the capacities of the edges are irrational
        number? => so is fmax
Exemplu Ford – Fulkerson (1)
                                                   1000         B   1000
    0/1000    B         0/1000
                                                                1
                                                                                   G
              0/1                      Gf      A                               D
A                                 D
                                                   1000         C   1000
    0/1000    C         0/1000
                                              Residual Path: A-B-C-D; Cf = 1
                                                   1
     1/1000   B         0/1000                              B     1000
                                                          999                      G
                  1/1                  Gf      A                1              D
A                                 D                                 999

    0/1000    C          1/1000                    1000         C          1

                                              Residual Path : A-B-C-D; Cf = 1
    1/1000    B         1/1000                  1          B      999 1
                                       Gf                 999                      G
A             0/1                 D            A                1          D
                                                                    999
    1/1000    C         1/1000                         999 C          1
                                                   1
              Proiectarea Algoritmilor 2010
                                               Residual Path : A-B-C-D; Cf = 1
Exemplu Ford – Fulkerson (2)

                                                    2
    2/1000      B      1/1000                                  B         999        1
                                                        998                                 G
                 1/1                Gf                         1
A                               D           A                                       D
                                                                       998
                                                    999        C
    1/1000      C      2/1000                   1                               2



                           …                Residual Path: A-C-B-D; Cf = 1


1000/1000       B      1000/1000                               B
                                                        1000                 1000
                 0/1
                                    Gf
A                               D             A                    1                    D
 1000/1000      C      1000/1000                        1000   C             1000

                                                        Residual Path: Ø
             How many steps are needed to reach the maximum flow?

                                    Proiectarea Algoritmilor 2010
Edmonds-Karp Algorithm
   Is a variant of the Ford-Fulkerson algorithm that
    guarantees to have a running time that is
    independent of fmax
   Always picks the augmenting path using BFS on Gf
       Source vertex for BFS is s
       You may stop when t is reached
   This way, the length of the augmenting paths is
    increasing when running the algorithm
       We always pick an augmenting path with an equal or
        greater length than the previous one
Edmonds-Karp Algorithm (2)
Edmonds–Karp(G, s, t)
   FOREACH (u,v) in E
      f(u,v) = f(v,u) = 0          // O(E)
   WHILE (1)                       // O(E*V)
           p = find-augmenting-path-using-bfs(G, f, s, t) // O(E)
           IF (p == null)
              BREAK
           cf(p) = min{cf(u,v) | (u,v) in p}  // O(E)
           FOREACH (u,v) in p                 // O(E)
                f(u,v) = f(u,v) + cf(p)
                f(v,u) = -f(u,v)
   RETURN f

    Complexity: O(V*E2)
Edmonds-Karp – Example
                                                            1000           B   1000
    0/1000      B         0/1000
                                                                           1
                                                                                                     G
                0/1                            Gf       A                                   D
A                                   D
                                                            1000           C       1000
    0/1000      C         0/1000
                                                      Residual Path: A-B-D; Cf = 1000
    1000/1000   B         1000/1000                             1000       B
                                                                                    1000
                    0/1                        Gf                          1
                                                                                                     G
A                                    D                  A                                   D
    0/1000      C          1/1000                            1000          C        1000

                                                       Residual Path: A-C-D; Cf = 1000
1000/1000       B          1000/1000
                                                              1000     B
                                                                                          1000
                    0/1                         Gf
A                                    D                                         1
                                                            A                                    D
    1000/1000   C          1000/1000                                1000           1000
                                                                             C
                                    Proiectarea Algoritmilor 2010
                                                                       Residual Path: Ø
Application: Maximum Bipartite Matching
   Bipartite graph: we can partition the graph into two sets
    of vertices L, R such as L U R = V and for all (u, v)E,
    uL, vR
   Matching: a subset of edges, M, such that for all vV at
    most an edge in M is incident in v
   Need to transform this problem into a maximum flow
Application: The Escape Problem
   http://webcourse.cs.technion.ac.il/234247/Spring2006/ho/
    WCFiles/The%20Escape%20Problem.pdf
Conclusions
   Flow networks are met very often in real life
   A lot of applications and interesting problems to be solved:
    maximum flow is only one of them

   It is important to know the main concepts of flow networks:
    positive flow, net flow, cuts, augmenting networks, etc.

   Ford-Fulkerson gives us a generic method to compute the
    maximum flow in a graph
       Edmonds-Karp is a variant of FF that runs in O(V*E2)
   There are other algorithms that work better

   A lot of problems can be solved using maximum flow, but you
    need to be able to “transform” them into a flow problem!
References
   CLRS – Chapter 26

   http://www.cs.princeton.edu/courses/archive/fall04/cos22
    6/lectures/maxflow.4up.pdf

   www.brics.dk/~sskyum/dSoegOpt/public_html/ek.pdf

Mais conteúdo relacionado

Mais procurados

Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Traian Rebedea
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)Madhu Bala
 
Bellman ford
Bellman fordBellman ford
Bellman fordKiran K
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmKiran K
 
Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14ingroy
 
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...Mahmood Adel
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm sachin varun
 
My presentation all shortestpath
My presentation all shortestpathMy presentation all shortestpath
My presentation all shortestpathCarlostheran
 
A Generalization of QN-Maps
A Generalization of QN-MapsA Generalization of QN-Maps
A Generalization of QN-MapsIOSR Journals
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiIbrahim Alfayoumi
 
Linear transformation.ppt
Linear transformation.pptLinear transformation.ppt
Linear transformation.pptRaj Parekh
 
Divergence,curl,gradient
Divergence,curl,gradientDivergence,curl,gradient
Divergence,curl,gradientKunj Patel
 
B.tech admission in india
B.tech admission in indiaB.tech admission in india
B.tech admission in indiaEdhole.com
 
Linear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.comLinear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.comAbu Bakar Soomro
 

Mais procurados (20)

Graph
GraphGraph
Graph
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10Algorithm Design and Complexity - Course 10
Algorithm Design and Complexity - Course 10
 
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
GRAPH APPLICATION - MINIMUM SPANNING TREE (MST)
 
Bfs dfs
Bfs dfsBfs dfs
Bfs dfs
 
Bellman ford
Bellman fordBellman ford
Bellman ford
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
 
Minimum spanning Tree
Minimum spanning TreeMinimum spanning Tree
Minimum spanning Tree
 
Derivatives Lesson Oct 14
Derivatives Lesson  Oct 14Derivatives Lesson  Oct 14
Derivatives Lesson Oct 14
 
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...
Dokumen.tips mathematics ii-institute-of-aeronautical-engineering-pptpdfadvan...
 
vcla
vclavcla
vcla
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm
 
My presentation all shortestpath
My presentation all shortestpathMy presentation all shortestpath
My presentation all shortestpath
 
A Generalization of QN-Maps
A Generalization of QN-MapsA Generalization of QN-Maps
A Generalization of QN-Maps
 
Minimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumiMinimum spanning tree algorithms by ibrahim_alfayoumi
Minimum spanning tree algorithms by ibrahim_alfayoumi
 
Pdfcode
PdfcodePdfcode
Pdfcode
 
Linear transformation.ppt
Linear transformation.pptLinear transformation.ppt
Linear transformation.ppt
 
Divergence,curl,gradient
Divergence,curl,gradientDivergence,curl,gradient
Divergence,curl,gradient
 
B.tech admission in india
B.tech admission in indiaB.tech admission in india
B.tech admission in india
 
Linear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.comLinear transformations-thestuffpoint.com
Linear transformations-thestuffpoint.com
 

Semelhante a Algorithm Design and Complexity - Course 12

aads_assignment1_answer-1.pdf
aads_assignment1_answer-1.pdfaads_assignment1_answer-1.pdf
aads_assignment1_answer-1.pdfNanaKoori
 
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)Harrisson David Assis Santos
 
Section 4 3_the_scattering_matrix_package
Section 4 3_the_scattering_matrix_packageSection 4 3_the_scattering_matrix_package
Section 4 3_the_scattering_matrix_packageJamal Kazazi
 
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUB
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUBPresentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUB
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUBWorld University of Bangladesh
 
Mesh Processing Course : Multiresolution
Mesh Processing Course : MultiresolutionMesh Processing Course : Multiresolution
Mesh Processing Course : MultiresolutionGabriel Peyré
 
Capitulo 10, 7ma edición
Capitulo 10, 7ma ediciónCapitulo 10, 7ma edición
Capitulo 10, 7ma ediciónSohar Carr
 
23Network FlowsAuthor Arthur M. Hobbs, Department of .docx
23Network FlowsAuthor Arthur M. Hobbs, Department of .docx23Network FlowsAuthor Arthur M. Hobbs, Department of .docx
23Network FlowsAuthor Arthur M. Hobbs, Department of .docxeugeniadean34240
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Ford Fulkerson Algorithm
Ford Fulkerson AlgorithmFord Fulkerson Algorithm
Ford Fulkerson AlgorithmAdarsh Rotte
 
Gradually Varied Flow in Open Channel
Gradually Varied Flow in Open ChannelGradually Varied Flow in Open Channel
Gradually Varied Flow in Open ChannelAmro Elfeki
 
Transmission line By Lipun
Transmission line By LipunTransmission line By Lipun
Transmission line By LipunNanigopal Jena
 
Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows IJECEIAES
 
Lecture02_Part02.pptx
Lecture02_Part02.pptxLecture02_Part02.pptx
Lecture02_Part02.pptxMahdiAbbasi31
 
Chapter3partialderivatives 150105021210-conversion-gate02
Chapter3partialderivatives 150105021210-conversion-gate02Chapter3partialderivatives 150105021210-conversion-gate02
Chapter3partialderivatives 150105021210-conversion-gate02Cleophas Rwemera
 

Semelhante a Algorithm Design and Complexity - Course 12 (20)

aads_assignment1_answer-1.pdf
aads_assignment1_answer-1.pdfaads_assignment1_answer-1.pdf
aads_assignment1_answer-1.pdf
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
 
Network flows
Network flowsNetwork flows
Network flows
 
Graphs
GraphsGraphs
Graphs
 
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)
[Paul lorrain] solutions_manual_for_electromagneti(bookos.org)
 
Section 4 3_the_scattering_matrix_package
Section 4 3_the_scattering_matrix_packageSection 4 3_the_scattering_matrix_package
Section 4 3_the_scattering_matrix_package
 
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUB
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUBPresentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUB
Presentation 3 ce801 by Rabindra Ranjan Saha, PEng, Assoc. Prof. WUB
 
Mesh Processing Course : Multiresolution
Mesh Processing Course : MultiresolutionMesh Processing Course : Multiresolution
Mesh Processing Course : Multiresolution
 
Capitulo 10, 7ma edición
Capitulo 10, 7ma ediciónCapitulo 10, 7ma edición
Capitulo 10, 7ma edición
 
Capitulo 10 7 ed
Capitulo 10 7 edCapitulo 10 7 ed
Capitulo 10 7 ed
 
Maxflow
MaxflowMaxflow
Maxflow
 
23Network FlowsAuthor Arthur M. Hobbs, Department of .docx
23Network FlowsAuthor Arthur M. Hobbs, Department of .docx23Network FlowsAuthor Arthur M. Hobbs, Department of .docx
23Network FlowsAuthor Arthur M. Hobbs, Department of .docx
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Ford Fulkerson Algorithm
Ford Fulkerson AlgorithmFord Fulkerson Algorithm
Ford Fulkerson Algorithm
 
Gradually Varied Flow in Open Channel
Gradually Varied Flow in Open ChannelGradually Varied Flow in Open Channel
Gradually Varied Flow in Open Channel
 
Transmission line By Lipun
Transmission line By LipunTransmission line By Lipun
Transmission line By Lipun
 
Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows Extended network and algorithm finding maximal flows
Extended network and algorithm finding maximal flows
 
Lecture02_Part02.pptx
Lecture02_Part02.pptxLecture02_Part02.pptx
Lecture02_Part02.pptx
 
Chapter3partialderivatives 150105021210-conversion-gate02
Chapter3partialderivatives 150105021210-conversion-gate02Chapter3partialderivatives 150105021210-conversion-gate02
Chapter3partialderivatives 150105021210-conversion-gate02
 

Mais de Traian Rebedea

An Evolution of Deep Learning Models for AI2 Reasoning Challenge
An Evolution of Deep Learning Models for AI2 Reasoning ChallengeAn Evolution of Deep Learning Models for AI2 Reasoning Challenge
An Evolution of Deep Learning Models for AI2 Reasoning ChallengeTraian Rebedea
 
AI @ Wholi - Bucharest.AI Meetup #5
AI @ Wholi - Bucharest.AI Meetup #5AI @ Wholi - Bucharest.AI Meetup #5
AI @ Wholi - Bucharest.AI Meetup #5Traian Rebedea
 
Deep neural networks for matching online social networking profiles
Deep neural networks for matching online social networking profilesDeep neural networks for matching online social networking profiles
Deep neural networks for matching online social networking profilesTraian Rebedea
 
Intro to Deep Learning for Question Answering
Intro to Deep Learning for Question AnsweringIntro to Deep Learning for Question Answering
Intro to Deep Learning for Question AnsweringTraian Rebedea
 
How useful are semantic links for the detection of implicit references in csc...
How useful are semantic links for the detection of implicit references in csc...How useful are semantic links for the detection of implicit references in csc...
How useful are semantic links for the detection of implicit references in csc...Traian Rebedea
 
A focused crawler for romanian words discovery
A focused crawler for romanian words discoveryA focused crawler for romanian words discovery
A focused crawler for romanian words discoveryTraian Rebedea
 
Detecting and Describing Historical Periods in a Large Corpora
Detecting and Describing Historical Periods in a Large CorporaDetecting and Describing Historical Periods in a Large Corpora
Detecting and Describing Historical Periods in a Large CorporaTraian Rebedea
 
Practical machine learning - Part 1
Practical machine learning - Part 1Practical machine learning - Part 1
Practical machine learning - Part 1Traian Rebedea
 
Propunere de dezvoltare a carierei universitare
Propunere de dezvoltare a carierei universitarePropunere de dezvoltare a carierei universitare
Propunere de dezvoltare a carierei universitareTraian Rebedea
 
Automatic plagiarism detection system for specialized corpora
Automatic plagiarism detection system for specialized corporaAutomatic plagiarism detection system for specialized corpora
Automatic plagiarism detection system for specialized corporaTraian Rebedea
 
Relevance based ranking of video comments on YouTube
Relevance based ranking of video comments on YouTubeRelevance based ranking of video comments on YouTube
Relevance based ranking of video comments on YouTubeTraian Rebedea
 
Opinion mining for social media and news items in Romanian
Opinion mining for social media and news items in RomanianOpinion mining for social media and news items in Romanian
Opinion mining for social media and news items in RomanianTraian Rebedea
 
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...Traian Rebedea
 
Importanța algoritmilor pentru problemele de la interviuri
Importanța algoritmilor pentru problemele de la interviuriImportanța algoritmilor pentru problemele de la interviuri
Importanța algoritmilor pentru problemele de la interviuriTraian Rebedea
 
Web services for supporting the interactions of learners in the social web - ...
Web services for supporting the interactions of learners in the social web - ...Web services for supporting the interactions of learners in the social web - ...
Web services for supporting the interactions of learners in the social web - ...Traian Rebedea
 
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...Traian Rebedea
 
Conclusions and Recommendations of the Romanian ICT RTD Survey
Conclusions and Recommendations of the Romanian ICT RTD SurveyConclusions and Recommendations of the Romanian ICT RTD Survey
Conclusions and Recommendations of the Romanian ICT RTD SurveyTraian Rebedea
 
Istoria Web-ului - part 2 - tentativ How to Web 2009
Istoria Web-ului - part 2 - tentativ How to Web 2009Istoria Web-ului - part 2 - tentativ How to Web 2009
Istoria Web-ului - part 2 - tentativ How to Web 2009Traian Rebedea
 
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009Istoria Web-ului - part 1 (2) - tentativ How to Web 2009
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009Traian Rebedea
 

Mais de Traian Rebedea (20)

An Evolution of Deep Learning Models for AI2 Reasoning Challenge
An Evolution of Deep Learning Models for AI2 Reasoning ChallengeAn Evolution of Deep Learning Models for AI2 Reasoning Challenge
An Evolution of Deep Learning Models for AI2 Reasoning Challenge
 
AI @ Wholi - Bucharest.AI Meetup #5
AI @ Wholi - Bucharest.AI Meetup #5AI @ Wholi - Bucharest.AI Meetup #5
AI @ Wholi - Bucharest.AI Meetup #5
 
Deep neural networks for matching online social networking profiles
Deep neural networks for matching online social networking profilesDeep neural networks for matching online social networking profiles
Deep neural networks for matching online social networking profiles
 
Intro to Deep Learning for Question Answering
Intro to Deep Learning for Question AnsweringIntro to Deep Learning for Question Answering
Intro to Deep Learning for Question Answering
 
What is word2vec?
What is word2vec?What is word2vec?
What is word2vec?
 
How useful are semantic links for the detection of implicit references in csc...
How useful are semantic links for the detection of implicit references in csc...How useful are semantic links for the detection of implicit references in csc...
How useful are semantic links for the detection of implicit references in csc...
 
A focused crawler for romanian words discovery
A focused crawler for romanian words discoveryA focused crawler for romanian words discovery
A focused crawler for romanian words discovery
 
Detecting and Describing Historical Periods in a Large Corpora
Detecting and Describing Historical Periods in a Large CorporaDetecting and Describing Historical Periods in a Large Corpora
Detecting and Describing Historical Periods in a Large Corpora
 
Practical machine learning - Part 1
Practical machine learning - Part 1Practical machine learning - Part 1
Practical machine learning - Part 1
 
Propunere de dezvoltare a carierei universitare
Propunere de dezvoltare a carierei universitarePropunere de dezvoltare a carierei universitare
Propunere de dezvoltare a carierei universitare
 
Automatic plagiarism detection system for specialized corpora
Automatic plagiarism detection system for specialized corporaAutomatic plagiarism detection system for specialized corpora
Automatic plagiarism detection system for specialized corpora
 
Relevance based ranking of video comments on YouTube
Relevance based ranking of video comments on YouTubeRelevance based ranking of video comments on YouTube
Relevance based ranking of video comments on YouTube
 
Opinion mining for social media and news items in Romanian
Opinion mining for social media and news items in RomanianOpinion mining for social media and news items in Romanian
Opinion mining for social media and news items in Romanian
 
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...
PhD Defense: Computer-Based Support and Feedback for Collaborative Chat Conve...
 
Importanța algoritmilor pentru problemele de la interviuri
Importanța algoritmilor pentru problemele de la interviuriImportanța algoritmilor pentru problemele de la interviuri
Importanța algoritmilor pentru problemele de la interviuri
 
Web services for supporting the interactions of learners in the social web - ...
Web services for supporting the interactions of learners in the social web - ...Web services for supporting the interactions of learners in the social web - ...
Web services for supporting the interactions of learners in the social web - ...
 
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...
Automatic assessment of collaborative chat conversations with PolyCAFe - EC-T...
 
Conclusions and Recommendations of the Romanian ICT RTD Survey
Conclusions and Recommendations of the Romanian ICT RTD SurveyConclusions and Recommendations of the Romanian ICT RTD Survey
Conclusions and Recommendations of the Romanian ICT RTD Survey
 
Istoria Web-ului - part 2 - tentativ How to Web 2009
Istoria Web-ului - part 2 - tentativ How to Web 2009Istoria Web-ului - part 2 - tentativ How to Web 2009
Istoria Web-ului - part 2 - tentativ How to Web 2009
 
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009Istoria Web-ului - part 1 (2) - tentativ How to Web 2009
Istoria Web-ului - part 1 (2) - tentativ How to Web 2009
 

Último

Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 

Último (20)

Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 

Algorithm Design and Complexity - Course 12

  • 1. Algorithm Design and Complexity Course 12
  • 2. Overview  Flow Networks  Positive Flow and Net Flow  Flow Properties  Maximum Flow  Minimum Cut  Ford-Fulkerson Method  Edmonds-Karp Algorithm  Sample Applications
  • 3. Flow Networks  Graphs that model materials that are transported through conduits  Each edge represents a conduit: it has a capacity that is an upper bound for the flow rate  Some vertices may produce materials: sources  Other vertices may consume materials: sinks
  • 4. Flow Networks (2)  The simplest version of flow networks:  Think of edges as pipes of different sizes (capacities)  The flow is the effective quantity of liquid that is transported through the pipes  Flow Networks are also called transportation networks  But you can transport a lot of things beside liquids, like commodities, information, electricity, traffic  There are some interesting and difficult problems for flow networks:  Maximum flow problem  Maximum flow with minimum cost problem  Circulation problem  Multi-commodity problem
  • 5. Flow Networks (3)  G(V, E) – directed graph  The capacity function c: E → R+  c(u, v) = the capacity of the edge (u, v)   (u,v)  E  c(u,v) = 0  Assume we have a single source vertex: s  Assume we have a single sink vertex: t  Assume we have a path s .. v .. t  vV
  • 6. Positive Flow  We can define a function called positive flow p: V x V  R+  Properties of positive flow:  Capacity constraint:  u, vV: p(u, v) <= c(u, v)  Flow conservation:  uV {s, t}: flow_in(u) = flow_out(u)  uV {s, t}: vV(p(v, u)) = vV(p(u, v))
  • 7. Positive Flow – Example  Notation on each edge: positive flow/capacity  Note that the two properties are respected  The flow is always lower than the capacity of each edge  The flow is conserved in each vertex  The source produces flow  The sink consumes flow
  • 8. Cancellation for Positive Flow  Note that in the previous example we have:  1 unit of flow from x  z  2 units of flow from z  x  We can cancel 1 unit of flow in both directions  0 units of flow from x  z  1 unit of flow from z  x  Flow conservation is still respected (we cancel the same amount of flow in each direction)  Capacity constraint is still respected (the flow is decreased)  In both cases, the “net flow” is 1 from z  x  Without loss of generality, we may always define a positive flow in a flow network such that for each (u, v), u,vV, we have positive flow either from u  v or from v  u, but not in both directions!
  • 9. Net Flow  We can define a function called net flow f: V x V  R  Properties of net flow:  Capacity constraint:  u, vV: f(u, v) <= c(u, v)  Flow conservation:  uV {s, t}: total_net_flow_in(u) = 0  uV {s, t}: vV(f(u, v)) = 0  Skew symmetry:  u, vV: f(u, v) = - f(v, u)
  • 10. Net Flow (2)  Conservation of net flow can be rewritten: vV (f(u, v)) = 0 As f(u, v) might be either positive or negative  uV {s, t}: vV and f(u,v)<0(f(u, v)) + vV and f(u,v)>0 (f(u, v)) =0  uV {s, t}: vV and f(v,u)>0(f(v, u)) = vV and f(u,v)>0 (f(u, v)) “total positive flow entering u” = “total positive flow leaving u” “flow in” = “flow out”
  • 11. Net Flow – Example  Only positive flow is illustrated in graphical representations  Nevertheless, this does not mean that the (negative) net flow does not exist in the other direction
  • 12. Positive Flow and Net Flow  Differences  Net flow satisfies skew symmetry  p(u, v) >= 0, while f(u, v) >= 0 or f(u, v) <= 0
  • 13. Positive Flow and Net Flow (2)  Equivalence  We can define net flow using only positive flow and vice- versa  f(u, v) = p(u, v) – p(v, u)  u, vV  Need to show that using this definition, the net flow still satisfies the three properties: capacity constraint, conservation and skew symmetry  p(u, v) = f(u, v) if f(u, v) > 0  p(u, v) = 0 otherwise  Need to show that this definition satisfies the two properties of positive flow: capacity constraint and conservation
  • 14. Positive Flow and Net Flow (3)  f(u, v) = p(u, v) – p(v, u)  u, vV  Capacity constraint: p(u, v) <= c(u, v) and p(v, u) >= 0 => f(u, v) = p(u, v) – p(v, u) <= p(u, v) <= c(u, v)  Flow conservation: vV (f(u, v)) = vV (p(u, v) – p(v, u)) = vV (p(u, v)) – vV (p(v, u)) = (from positive flow conservation) = 0  Skew symmetry: f(u, v) = p(u, v) – p(v, u) = –(p(v, u) – p(u, v)) = –f(v,u) Similar for the transformation from f(u, v)  p(u, v). Prove them at home!
  • 15. Value of the Flow  From now on, we shall only use net flow  Value of the flow = |f| = vV (f(s, v)) = vV (f(v, t))  In the example below: |f| = 3
  • 16. Cancellation of (Net) Flow  Let’s say that f(u, v) = 5 and c(u, v) = 8  We can “ship” at most 3 units of flow from u  v  => f(u, v) = 8 = c(u, v)  But we can also “ship” up to 5 units of flow back from v  u  => f(u, v) = 3 if we cancel 2 units of flow!  Called flow cancellation  If (v, u) E => f(v, u) <= c(v, u) = 0  We are not allowed to have a positive flow from v  u  But we are allowed to have negative flow!  This negative flow is equal in absolute value with the positive value from u  v
  • 17. Cancellation of (Net) Flow (2)  Due to cancellation, a flow only gives us this so- called “net” effect. We cannot reconstruct actual “shipments” of products from a net flow.  A flow f(u, v) = 5 and f(v, u) = -5 can mean either: 5 units u  v 6 units u  v 8 units u  v 0 units v  u 1 units v  u 3 units v  u
  • 18. Flow Operations  Extend the definition of the flow to sets of vertices  X,Y  V  f(X,Y) = ΣxXΣyY f(x,y) = total flow between X and Y  Possible operations:  XV f(X,X) = 0;  X,YV f(X,Y) = -f(Y,X);  X,Y,ZV si Y⊆X  f(X Y, Z) = f(X,Z) - f(Y,Z);  f(Z, X Y) = f(Z,X) - f(Z,Y);  X,Y,ZV si XY=  f(X Y, Z) = f(X,Z) + f(Y,Z);  f(Z, X Y) = f(Z,X) + f(Z,Y)  |f| = f(s,V) = f(V,t)
  • 19. Examples (1) X 1/2 a b 1/8 2/2 4/4 3/3 s t 3/9 Y c d 3/5 f(X,Y) = ΣxXΣyY f(x,y) f(X,X) = f(s,a) + f(a,s) + f(s,b) + f(b,s) + f(a,b) + f(b,a) = 0 f(X,Y) = f(b,c) + f(b,t) = -f(c,b) - f(t,b) = -f(Y,X) Proiectarea Algoritmilor 2010
  • 20. Examples (2) X 1/2 a b 1/8 2/2 Y s 4/4 3/3 t c 3/9 Z 3/5 d X, Y, Z  V si Y ⊆ X f(X Y, Z) = f(X, Z) - f(Y, Z) f(Z, X Y) = f(Z, X) - f(Z, Y) f(X Y, Z) = 0 = f(b,t) + f(c,d) - f(b,t) - f(c,d) = f(X,Z) - f(Y,Z) f(Z, X Y) = 0 = f(t,b) + f(d,c) - f(t,b) - f(d,c) = f(Z,X) - f(Z,Y) Proiectarea Algoritmilor 2010
  • 21. Examples (3) Z X 1/2 a b 1/8 2/2 s 4/4 3/3 t 3/9 Y c d 3/5 X, Y, Z  V si X  Y =  f(XY, Z) = f(X,Z) + f(Y,Z) f(Z, XY) = f(Z,X) + f(Z,Y) f(X Y, Z) = f(s,b) + f(a,b) + f(t,b) + f(d,c) = f(X,Z) + f(Y,Z) f(Z, X Y) = f(b,a) + f(b,s) + f(b,t) + f(c,d) = f(Z,X) + f(Z,Y) Proiectarea Algoritmilor 2010
  • 22. Examples (4) 1/2 a b 1/8 2/2 4/4 3/3 s t 3/9 c d 3/5 f(s, V) = f(V, t) f(s, V) = f(s,a) + f(s,b) = 5 = f(d,t) + f(b,t) = f(V, t) Proiectarea Algoritmilor 2010
  • 23. Maximum Flow Problem  Given G(V, E), c: E  R+, sV and tV  Find the maximum flow that can be “transported” from s to t  We start with an initial void flow on all edges  We want to compute the net flow between each pair of vertices that determines a maximum flow!  Various methods are used  Only look at one of the simplest:  Ford-Fulkerson and Edmonds-Karp  Uses the notion of residual network
  • 24. Residual Network  Given G(V, E), c: E  R+, sV and tV  Knowing a given flow in the graph, f: E  R  We can compute the residual capacity for any pair of vertices:  cf(u, v) = c(u, v) – f(u, v) >= 0 (due to capacity constraint)  Residual means: how much flow we can still transport from u  v  We can compute the residual network of the graph:  It is a graph Gf = (V, Ef)  Ef = {(u, v)  V x V | cf(u, v) > 0}  It is a graph that contains edges that have residual capacity (that can still transport flow!)  How many edges does Gf have? Find the minimum and the maximum value!
  • 26. Augmenting Path  Any path from the residual graph admits more flow from the start vertex to the end vertex  Therefore, we want to find a path from the source s to the sink t in the residual graph: augmenting path  Look for p = s..t in Gf  If we can find this augmenting path, compute how much flow we can send along it!  We are constrained by the minimum residual capacity of any edge along the augmenting path  cf(p) = min(cf(u, v) | (u, v) is on p)
  • 27. Augmenting Path – Example  p = <(s, w), (w, y), (y, z), (z, t)>  Is it unique? Can you find another?
  • 28. Summing Flows  If the graph G has a flow f  And we can find another flow f’  We can sum up the two flows to find the new flow: f(u,v) + f’(u,v)  The value of the new flow is |f| + |f’|  Therefore, if we can find an augmenting path, p, in the residual network of a graph, we can also find another flow, fp: V x V  R  fp(u,v) = cf(p) if (u,v) is on p  fp(u,v) = -cf(p) if (v,u) is on p  fp(u,v) = 0  We can thus define a new flow in G: |f’| = |f| + |fp| > |f|  Thus, we can improve the existing flow!
  • 29. Graph Cuts  A cut (S, T) of a flow network G(V, E) is a partitionof the vertices into two sets S (sS) and T = V S (t T)  Already know cuts for minimum spanning trees  The flow across the cut is f(S, T)  The capacity of the cut is c(S, T) = summing up the capacities of all the edges starting from a vertex in S and ending in a vertex in T  A minimum cut in G is a cut whose capacity is minimum over all the possible cuts in G
  • 30. Graph Cuts – Example  S = {s, w, y}, T = {x, z, t}  f(S, T) = f(w, x) + f (y, x) + f(y, z) = 2 + (-1) + 2 = 3  Includes positive flow that goes either direction across the cut  But only takes into account net flow that goes from any vertex in S to any vertex in T  c(S, T) = c(w, x) + c(y, z) = 2 + 3 = 5
  • 31. Max-Flow Min-Cut Theorem  The following statements are equivalent:  f is a maximum flow in G  There is no augmenting path in Gf  |f| = c(S, T) for all minimum cuts (S, T)  This theorem gives us a method to compute the maximum flow: push flow along augmenting paths until you cannot find any  This theorem also tells us how to compute a minimum cut once the maximum flow is known  When f is a maximum flow, all the vertices reachable from s in Gf are in S, the others are in T => (S, T) is a minimum cut
  • 32. Ford-Fulkerson Method 1. Start with a void flow 2. Compute the residual graph for the given flow 3. If there is an augmenting path in this residual graph a) Increase the flow along it b) Go to step 2 4. The maximum flow has been reached!  The disadvantage of this method is that it does not specify how to look for the augmenting path in step 3  Any method can be used  Pick a random augmenting path  Use any search algorithms to compute the path: DFS, BFS  Be greedy: look for the fattest pipe each time! How?
  • 33. Ford-Fulkerson Method (2)  If the augmenting path is not picked smartly, then the worst case running time for the algorithm is O(E*|fmax|)  Why?  Each augmenting path has at most O(E) edges that will cause a change in the value of the flow along them at each step!  Maximum number of steps is fmax if a each step cf(p)=1  See the example on the next slides!  It is not good that the running time depends on fmax  What happens if the capacities of the edges are irrational number? => so is fmax
  • 34. Exemplu Ford – Fulkerson (1) 1000 B 1000 0/1000 B 0/1000 1 G 0/1 Gf A D A D 1000 C 1000 0/1000 C 0/1000 Residual Path: A-B-C-D; Cf = 1 1 1/1000 B 0/1000 B 1000 999 G 1/1 Gf A 1 D A D 999 0/1000 C 1/1000 1000 C 1 Residual Path : A-B-C-D; Cf = 1 1/1000 B 1/1000 1 B 999 1 Gf 999 G A 0/1 D A 1 D 999 1/1000 C 1/1000 999 C 1 1 Proiectarea Algoritmilor 2010 Residual Path : A-B-C-D; Cf = 1
  • 35. Exemplu Ford – Fulkerson (2) 2 2/1000 B 1/1000 B 999 1 998 G 1/1 Gf 1 A D A D 998 999 C 1/1000 C 2/1000 1 2 … Residual Path: A-C-B-D; Cf = 1 1000/1000 B 1000/1000 B 1000 1000 0/1 Gf A D A 1 D 1000/1000 C 1000/1000 1000 C 1000 Residual Path: Ø How many steps are needed to reach the maximum flow? Proiectarea Algoritmilor 2010
  • 36. Edmonds-Karp Algorithm  Is a variant of the Ford-Fulkerson algorithm that guarantees to have a running time that is independent of fmax  Always picks the augmenting path using BFS on Gf  Source vertex for BFS is s  You may stop when t is reached  This way, the length of the augmenting paths is increasing when running the algorithm  We always pick an augmenting path with an equal or greater length than the previous one
  • 37. Edmonds-Karp Algorithm (2) Edmonds–Karp(G, s, t) FOREACH (u,v) in E f(u,v) = f(v,u) = 0 // O(E) WHILE (1) // O(E*V) p = find-augmenting-path-using-bfs(G, f, s, t) // O(E) IF (p == null) BREAK cf(p) = min{cf(u,v) | (u,v) in p} // O(E) FOREACH (u,v) in p // O(E) f(u,v) = f(u,v) + cf(p) f(v,u) = -f(u,v) RETURN f Complexity: O(V*E2)
  • 38. Edmonds-Karp – Example 1000 B 1000 0/1000 B 0/1000 1 G 0/1 Gf A D A D 1000 C 1000 0/1000 C 0/1000 Residual Path: A-B-D; Cf = 1000 1000/1000 B 1000/1000 1000 B 1000 0/1 Gf 1 G A D A D 0/1000 C 1/1000 1000 C 1000 Residual Path: A-C-D; Cf = 1000 1000/1000 B 1000/1000 1000 B 1000 0/1 Gf A D 1 A D 1000/1000 C 1000/1000 1000 1000 C Proiectarea Algoritmilor 2010 Residual Path: Ø
  • 39. Application: Maximum Bipartite Matching  Bipartite graph: we can partition the graph into two sets of vertices L, R such as L U R = V and for all (u, v)E, uL, vR  Matching: a subset of edges, M, such that for all vV at most an edge in M is incident in v  Need to transform this problem into a maximum flow
  • 40. Application: The Escape Problem  http://webcourse.cs.technion.ac.il/234247/Spring2006/ho/ WCFiles/The%20Escape%20Problem.pdf
  • 41. Conclusions  Flow networks are met very often in real life  A lot of applications and interesting problems to be solved: maximum flow is only one of them  It is important to know the main concepts of flow networks: positive flow, net flow, cuts, augmenting networks, etc.  Ford-Fulkerson gives us a generic method to compute the maximum flow in a graph  Edmonds-Karp is a variant of FF that runs in O(V*E2)  There are other algorithms that work better  A lot of problems can be solved using maximum flow, but you need to be able to “transform” them into a flow problem!
  • 42. References  CLRS – Chapter 26  http://www.cs.princeton.edu/courses/archive/fall04/cos22 6/lectures/maxflow.4up.pdf  www.brics.dk/~sskyum/dSoegOpt/public_html/ek.pdf