85
Planar graph From Wikipedia, the free encyclopedia

Planar Graph 2

  • Upload
    man

  • View
    245

  • Download
    3

Embed Size (px)

DESCRIPTION

1. From Wikipedia, the free encyclopedia2. Lexicographical order

Citation preview

  • Planar graphFrom Wikipedia, the free encyclopedia

  • Contents

    1 Complete graph 11.1 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Geometry and topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.6 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    2 Connectivity (graph theory) 32.1 Connected graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Denitions of components, cuts and connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Mengers theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 Computational aspects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.6 Bounds on connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.7 Other properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.8 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.9 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    3 Cycle (graph theory) 83.1 Chordless cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Cycle space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Cycle detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.4 Covering graphs by cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.5 Graph classes dened by cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    4 Directed acyclic graph 114.1 Mathematical properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    4.1.1 Reachability, transitive closure, and transitive reduction . . . . . . . . . . . . . . . . . . . 124.1.2 Topological ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.1.3 Combinatorial enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.1.4 Related families of graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    i

  • ii CONTENTS

    4.2 Computational problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.2.1 Topological sorting and recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134.2.2 Construction from cyclic graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.2.3 Transitive closure and transitive reduction . . . . . . . . . . . . . . . . . . . . . . . . . . 144.2.4 Closure problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    4.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.3.1 Path algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.3.2 Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.3.3 Data processing networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.3.4 Causal structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.3.5 Genealogy and version history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.3.6 Data compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    4.4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.5 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    5 Directed graph 195.1 Basic terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.2 Indegree and outdegree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205.3 Degree sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.4 Digraph connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.5 Classes of digraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225.6 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235.7 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    6 Flow network 256.1 Denition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266.3 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.4 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286.6 Further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286.7 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    7 Graph (mathematics) 297.1 Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    7.1.1 Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307.1.2 Adjacency relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    7.2 Types of graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307.2.1 Distinction in terms of the main denition . . . . . . . . . . . . . . . . . . . . . . . . . . 307.2.2 Important graph classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    7.3 Properties of graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

  • CONTENTS iii

    7.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347.5 Important graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357.6 Operations on graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357.7 Generalizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367.8 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367.9 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377.10 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377.11 Further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.12 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    8 Graph embedding 398.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398.2 Combinatorial embedding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408.3 Computational complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408.4 Embeddings of graphs into higher-dimensional spaces . . . . . . . . . . . . . . . . . . . . . . . . 408.5 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    9 Graph isomorphism 429.1 Variations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429.3 Whitney theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439.4 Recognition of graph isomorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439.5 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449.6 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

    10 Orientation (graph theory) 4510.1 Oriented graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4510.2 Constrained orientations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4510.3 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4610.4 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

    11 Planar graph 4711.1 Kuratowskis and Wagners theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4711.2 Other planarity criteria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

    11.2.1 Eulers formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4911.2.2 Average degree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5011.2.3 Coin graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    11.3 Related families of graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.3.1 Maximal planar graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.3.2 Outerplanar graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.3.3 Halin graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

  • iv CONTENTS

    11.3.4 Other related families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5111.4 Enumeration of planar graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5211.5 Other facts and denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5211.6 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5311.7 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5311.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5411.9 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    12 Polytree 5812.1 Related structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.2 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.3 Sumners conjecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.5 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.6 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5912.7 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    13 Sumners conjecture 6113.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6113.2 Partial results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6113.3 Related conjectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6213.4 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6213.5 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6213.6 External links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

    14 Tournament (graph theory) 6414.1 Paths and cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6414.2 Transitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

    14.2.1 Equivalent conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6414.2.2 Ramsey theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6514.2.3 Paradoxical tournaments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6614.2.4 Condensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    14.3 Score sequences and score sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6614.4 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6714.5 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6714.6 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

    15 Tree (graph theory) 6915.1 Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

    15.1.1 Plane tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7015.2 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7015.3 Facts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7015.4 Enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

  • CONTENTS v

    15.4.1 Labeled trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7115.4.2 Unlabeled trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    15.5 Types of trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7215.6 See also . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7215.7 Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7215.8 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7315.9 Further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

    16 Universal graph 7416.1 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7416.2 Text and image sources, contributors, and licenses . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    16.2.1 Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7616.2.2 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7816.2.3 Content license . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

  • Chapter 1

    Complete graph

    In the mathematical eld of graph theory, a complete graph is a simple undirected graph in which every pair ofdistinct vertices is connected by a unique edge. A complete digraph is a directed graph in which every pair ofdistinct vertices is connected by a pair of unique edges (one in each direction).Graph theory itself is typically dated as beginning with Leonhard Euler's 1736 work on the Seven Bridges of Knigs-berg. However, drawings of complete graphs, with their vertices placed on the points of a regular polygon, appearedalready in the 13th century, in the work of Ramon Llull.[1] Such a drawing is sometimes referred to as a mysticrose.[2]

    1.1 PropertiesThe complete graph on n vertices is denoted by Kn. Some sources claim that the letter K in this notation stands for theGerman word komplett,[3] but the German name for a complete graph, vollstndiger Graph, does not contain the letterK, and other sources state that the notation honors the contributions of Kazimierz Kuratowski to graph theory.[4]

    Kn has n(n 1)/2 edges (a triangular number), and is a regular graph of degree n 1. All complete graphs aretheir own maximal cliques. They are maximally connected as the only vertex cut which disconnects the graph is thecomplete set of vertices. The complement graph of a complete graph is an empty graph.If the edges of a complete graph are each given an orientation, the resulting directed graph is called a tournament.The number of matchings of the complete graphs are given by the telephone numbers

    1, 1, 2, 4, 10, 26, 76, 232, 764, 2620, 9496, ... (sequence A000085 in OEIS).

    These numbers give the largest possible value of the Hosoya index for an n-vertex graph.[5] The number of perfectmatchings of the complete graph Kn (with n even) is given by the double factorial (n 1)!!.[6]

    The crossing numbers up to K27 are known, with K28 requiring either 7233 or 7234 crossings. Further values arecollected by the Rectilinear Crossing Number project.[7] Crossing numbers for K5 through K18 are

    1, 3, 9, 19, 36, 62, 102, 153, 229, 324, 447, 603, 798, 1029, ... (sequence A014540 in OEIS).

    1.2 Geometry and topologyA complete graph with n nodes represents the edges of an (n 1)-simplex. Geometrically K3 forms the edge set ofa triangle, K4 a tetrahedron, etc. The Csszr polyhedron, a nonconvex polyhedron with the topology of a torus, hasthe complete graph K7 as its skeleton. Every neighborly polytope in four or more dimensions also has a completeskeleton.K1 through K4 are all planar graphs. However, every planar drawing of a complete graph with ve or more verticesmust contain a crossing, and the nonplanar complete graph K5 plays a key role in the characterizations of planar

    1

  • 2 CHAPTER 1. COMPLETE GRAPH

    graphs: by Kuratowskis theorem, a graph is planar if and only if it contains neither K5 nor the complete bipartitegraph K, as a subdivision, and by Wagners theorem the same result holds for graph minors in place of subdivisions.As part of the Petersen family, K6 plays a similar role as one of the forbidden minors for linkless embedding.[8] Inother words, and as Conway and Gordon[9] proved, every embedding of K6 is intrinsically linked, with at least onepair of linked triangles. Conway and Gordon also showed that any embedding of K7 contains a knotted Hamiltoniancycle.

    1.3 ExamplesComplete graphs on n vertices, for n between 1 and 12, are shown below along with the numbers of edges:

    1.4 See also Complete bipartite graph Shield of the Trinity (traditional Christian symbol which is a tetrahedral graph)

    1.5 References[1] Knuth, Donald E. (2013), Two thousand years of combinatorics, in Wilson, Robin; Watkins, John J., Combinatorics:

    Ancient and Modern, Oxford University Press, pp. 737.

    [2] Mystic Rose, nrich.maths.org, retrieved 23 January 2012.

    [3] Gries, David; Schneider, Fred B. (1993), A Logical Approach to Discrete Math, Springer-Verlag, p. 436.

    [4] Pirnot, Thomas L. (2000), Mathematics All Around, Addison Wesley, p. 154, ISBN 9780201308150.

    [5] Tichy, Robert F.; Wagner, Stephan (2005), Extremal problems for topological indices in combinatorial chemistry (PDF),Journal of Computational Biology 12 (7): 10041013, doi:10.1089/cmb.2005.12.1004.

    [6] Callan, David (2009), A combinatorial survey of identities for the double factorial, arXiv:0906.1317.

    [7] Oswin Aichholzer. Rectilinear Crossing Number project.

    [8] Robertson, Neil; Seymour, P. D.; Thomas, Robin (1993), Linkless embeddings of graphs in 3-space, Bulletin of the Amer-ican Mathematical Society 28 (1): 8489, arXiv:math/9301216, doi:10.1090/S0273-0979-1993-00335-5, MR 1164063.

    [9] Conway, J. H.; CameronGordon (1983). Knots and Links in Spatial Graphs. J. Graph Th. 7 (4): 445453. doi:10.1002/jgt.3190070410.

    1.6 External links Weisstein, Eric W., Complete Graph, MathWorld.

  • Chapter 2

    Connectivity (graph theory)

    This graph becomes disconnected when the right-most node in the gray area on the left is removed

    In mathematics and computer science, connectivity is one of the basic concepts of graph theory: it asks for the

    3

  • 4 CHAPTER 2. CONNECTIVITY (GRAPH THEORY)

    This graph becomes disconnected when the dashed edge is removed.

    minimum number of elements (nodes or edges) that need to be removed to disconnect the remaining nodes fromeach other.[1] It is closely related to the theory of network ow problems. The connectivity of a graph is an importantmeasure of its robustness as a network.

    2.1 Connected graphA graph is connected when there is a path between every pair of vertices. In a connected graph, there are nounreachable vertices. A graph that is not connected is disconnected.A graph with just one vertex is connected. An edgeless graph with two or more vertices is disconnected.

    2.2 Denitions of components, cuts and connectivityIn an undirected graph G, two vertices u and v are called connected if G contains a path from u to v. Otherwise, theyare called disconnected. If the two vertices are additionally connected by a path of length 1, i.e. by a single edge, thevertices are called adjacent. A graph is said to be connected if every pair of vertices in the graph is connected.A connected component is a maximal connected subgraph of G. Each vertex belongs to exactly one connected com-ponent, as does each edge.A directed graph is called weakly connected if replacing all of its directed edges with undirected edges produces aconnected (undirected) graph. It is connected if it contains a directed path from u to v or a directed path from v to ufor every pair of vertices u, v. It is strongly connected or strong if it contains a directed path from u to v and a directedpath from v to u for every pair of vertices u, v. The strong components are the maximal strongly connected subgraphs.A cut, vertex cut, or separating set of a connected graph G is a set of vertices whose removal renders G disconnected.The connectivity or vertex connectivity (G) (where G is not a complete graph) is the size of a minimal vertex cut. Agraph is called k-connected or k-vertex-connected if its vertex connectivity is k or greater.More precisely, any graph G (complete or not) is said to be k-connected if it contains at least k+1 vertices, but does

  • 2.3. MENGERS THEOREM 5

    With vertex 0 this graph is disconnected, the rest of the graph is connected.

    not contain a set of k 1 vertices whose removal disconnects the graph; and (G) is dened as the largest k such thatG is k-connected. In particular, a complete graph with n vertices, denoted K, has no vertex cuts at all, but (Kn) =n 1. A vertex cut for two vertices u and v is a set of vertices whose removal from the graph disconnects u and v.The local connectivity (u, v) is the size of a smallest vertex cut separating u and v. Local connectivity is symmetricfor undirected graphs; that is, (u, v) = (v, u). Moreover, except for complete graphs, (G) equals the minimum of(u, v) over all nonadjacent pairs of vertices u, v.2-connectivity is also called biconnectivity and 3-connectivity is also called triconnectivity. A graph G which is con-nected but not 2-connected is sometimes called separable.Analogous concepts can be dened for edges. In the simple case in which cutting a single, specic edge woulddisconnect the graph, that edge is called a bridge. More generally, the edge cut of G is a group of edges whose totalremoval renders the graph disconnected. The edge-connectivity (G) is the size of a smallest edge cut, and the localedge-connectivity (u, v) of two vertices u, v is the size of a smallest edge cut disconnecting u from v. Again, localedge-connectivity is symmetric. A graph is called k-edge-connected if its edge connectivity is k or greater.

    2.3 Mengers theorem

    Main article: Mengers theorem

    One of the most important facts about connectivity in graphs is Mengers theorem, which characterizes the connec-tivity and edge-connectivity of a graph in terms of the number of independent paths between vertices.If u and v are vertices of a graph G, then a collection of paths between u and v is called independent if no two ofthem share a vertex (other than u and v themselves). Similarly, the collection is edge-independent if no two paths init share an edge. The number of mutually independent paths between u and v is written as (u, v), and the numberof mutually edge-independent paths between u and v is written as (u, v).Mengers theorem asserts that the local connectivity (u, v) equals (u, v) and the local edge-connectivity (u, v)equals (u, v) for every pair of vertices u and v.[2][3] This fact is actually a special case of the max-ow min-cuttheorem.

  • 6 CHAPTER 2. CONNECTIVITY (GRAPH THEORY)

    2.4 Computational aspectsThe problem of determining whether two vertices in a graph are connected can be solved eciently using a searchalgorithm, such as breadth-rst search. More generally, it is easy to determine computationally whether a graph isconnected (for example, by using a disjoint-set data structure), or to count the number of connected components. Asimple algorithm might be written in pseudo-code as follows:

    1. Begin at any arbitrary node of the graph, G

    2. Proceed from that node using either depth-rst or breadth-rst search, counting all nodes reached.

    3. Once the graph has been entirely traversed, if the number of nodes counted is equal to the number of nodes ofG, the graph is connected; otherwise it is disconnected.

    By Mengers theorem, for any two vertices u and v in a connected graph G, the numbers (u, v) and (u, v) can bedetermined eciently using the max-ow min-cut algorithm. The connectivity and edge-connectivity of G can thenbe computed as the minimum values of (u, v) and (u, v), respectively.In computational complexity theory, SL is the class of problems log-space reducible to the problem of determiningwhether two vertices in a graph are connected, which was proved to be equal to L by Omer Reingold in 2004.[4]Hence, undirected graph connectivity may be solved in O(log n) space.The problem of computing the probability that a Bernoulli random graph is connected is called network reliabilityand the problem of computing whether two given vertices are connected the ST-reliability problem. Both of theseare #P-hard.[5]

    2.5 Examples The vertex- and edge-connectivities of a disconnected graph are both 0. 1-connectedness is equivalent to connectedness. The complete graph on n vertices has edge-connectivity equal to n 1. Every other simple graph on n verticeshas strictly smaller edge-connectivity.

    In a tree, the local edge-connectivity between every pair of vertices is 1.

    2.6 Bounds on connectivity The vertex-connectivity of a graph is less than or equal to its edge-connectivity. That is, (G) (G). Both areless than or equal to the minimum degree of the graph, since deleting all neighbors of a vertex of minimumdegree will disconnect that vertex from the rest of the graph.[1]

    For a vertex-transitive graph of degree d, we have: 2(d + 1)/3 (G) (G) = d.[6]

    For a vertex-transitive graph of degree d 4, or for any (undirected) minimal Cayley graph of degree d, or forany symmetric graph of degree d, both kinds of connectivity are equal: (G) = (G) = d.[7]

    2.7 Other properties Connectedness is preserved by graph homomorphisms. If G is connected then its line graph L(G) is also connected. A graph G is 2-edge-connected if and only if it has an orientation that is strongly connected.

  • 2.8. SEE ALSO 7

    Balinskis theorem states that the polytopal graph (1-skeleton) of a k-dimensional convex polytope is a k-vertex-connected graph.[8] Steinitz's previous theorem that any 3-vertex-connected planar graph is a polytopal graph(Steinitz theorem) gives a partial converse.

    According to a theorem of G. A. Dirac, if a graph is k-connected for k 2, then for every set of k vertices inthe graph there is a cycle that passes through all the vertices in the set.[9][10] The converse is true when k = 2.

    2.8 See also Algebraic connectivity Cheeger constant (graph theory) Expander graph Graph property Scale-free network Small-world networks, Six degrees of separation, Small world phenomenon Strength of a graph (graph theory)

    2.9 References[1] Diestel, R., Graph Theory, Electronic Edition, 2005, p 12.

    [2] Gibbons, A. (1985). Algorithmic Graph Theory. Cambridge University Press.

    [3] Nagamochi, H., Ibaraki, T. (2008). Algorithmic Aspects of Graph Connectivity. Cambridge University Press.

    [4] Reingold, Omer (2008). Undirected connectivity in log-space. Journal of the ACM 55 (4): Article 17, 24 pages.doi:10.1145/1391289.1391291

    [5] Provan, J. Scott; Ball, Michael O. (1983), The complexity of counting cuts and of computing the probability that a graphis connected, SIAM Journal on Computing 12 (4): 777788, doi:10.1137/0212053, MR 721012.

    [6] Godsil, C.; Royle, G. (2001). Algebraic Graph Theory. Springer Verlag.

    [7] Babai, L. (1996). Automorphism groups, isomorphism, reconstruction. Technical Report TR-94-10. University of Chicago.Chapter 27 of The Handbook of Combinatorics.

    [8] Balinski, M. L. (1961). On the graph structure of convex polyhedra in n-space. Pacic Journal of Mathematics 11 (2):431434. doi:10.2140/pjm.1961.11.431.

    [9] Dirac, Gabriel Andrew (1960). In abstrakten Graphen vorhandene vollstndige 4-Graphen und ihre Unterteilungen.Mathematische Nachrichten 22: 6185. doi:10.1002/mana.19600220107. MR 0121311.

    [10] Flandrin, Evelyne; Li, Hao; Marczyk, Antoni; Woniak, Mariusz (2007). A generalization of Diracs theorem on cyclesthrough k vertices in k-connected graphs. Discrete Mathematics 307 (78): 878884. doi:10.1016/j.disc.2005.11.052.MR 2297171.

  • Chapter 3

    Cycle (graph theory)

    A graph with edges colored to illustrate path H-A-B, closed path or walk with a repeated vertex B-D-E-F-D-C-B and a cycle withno repeated edge or vertex H-D-G-H

    In graph theory, there are several dierent types of object called cycles; a closed walk and a simple cycle.A closed walk consists of a sequence of vertices starting and ending at the same vertex, with each two consecutivevertices in the sequence adjacent to each other in the graph. In a directed graph, each edge must be traversed bythe walk consistently with its direction: the edge must be oriented from the earlier of two consecutive vertices to thelater of the two vertices in the sequence. The choice of starting vertex is not important: traversing the same cyclicsequence of edges from dierent starting vertices produces the same closed walk.A simple cyclemay be dened either as a closed walk with no repetitions of vertices and edges allowed, other than therepetition of the starting and ending vertex, or as the set of edges in such a walk. The two denitions are equivalentin directed graphs, where simple cycles are also called directed cycles: the cyclic sequence of vertices and edges

    8

  • 3.1. CHORDLESS CYCLES 9

    in a walk is completely determined by the set of edges that it uses. In undirected graphs the set of edges of a cyclecan be traversed by a walk in either of two directions, giving two possible directed cycles for every undirected cycle.(For closed walks more generally, in directed or undirected graphs, the multiset of edges does not unambiguouslydetermine the vertex ordering.) A circuit can be a closed walk allowing repetitions of vertices but not edges; however,the term is also sometimes used to describe a simple cycle, so explicit denition is recommended when it is used.[1]

    3.1 Chordless cyclesA chordless cycle in a graph, also called a hole or an induced cycle, is a cycle such that no two vertices of the cycleare connected by an edge that does not itself belong to the cycle. An antihole is the complement of a graph hole.Chordless cycles may be used to characterize perfect graphs: by the strong perfect graph theorem, a graph is perfectif and only if none of its holes or antiholes have an odd number of vertices that is greater than three. A chordal graph,a special type of perfect graph, has no holes of any size greater than three.The girth of a graph is the length of its shortest cycle; this cycle is necessarily chordless. Cages are dened as thesmallest regular graphs with given combinations of degree and girth.A peripheral cycle is a cycle in a graph with the property that every two edges not on the cycle can be connected by apath whose interior vertices avoid the cycle. In a graph that is not formed by adding one edge to a cycle, a peripheralcycle must be an induced cycle.

    3.2 Cycle spaceThe term cycle may also refer to an element of the cycle space of a graph. This consists of the edge sets that have aneven degree at every vertex; it forms a vector space over the two-element nite eld. Using methods from algebraictopology, it may be generalized to vector spaces or modules over other rings such as the integers, real numbers, etc.By Veblens theorem, every element of the cycle space may be formed by combining simple cycles; a cycle basis ofthe graph is a set of simple cycles that forms a basis of the cycle space.[2][3]

    3.3 Cycle detectionThe existence of a cycle in directed and undirected graphs can be determined by whether depth-rst search (DFS)nds an edge that points to an ancestor of the current vertex (it contains a back edge).[4] In an undirected graph,nding any already visited vertex will indicate a back edge. All the back edges which DFS skips over are part ofcycles.[5] In the case of undirected graphs, only O(n) time is required to nd a cycle in an n-vertex graph, since atmost n 1 edges can be tree edges.Many topological sorting algorithms will detect cycles too, since those are obstacles for topological order to exist.Also, if a directed graph has been divided into strongly connected components, cycles only exist within the compo-nents and not between them, since cycles are strongly connected.[5]

    For directed graphs, Rocha-Thatte Algorithm[6] is a distributed cycle detection algorithm. Distributed cycle detectionalgorithms are useful for processing large-scale graphs using a distributed graph processing system on a computercluster (or supercomputer).Applications of cycle detection include the use of wait-for graphs to detect deadlocks in concurrent systems.[7]

    3.4 Covering graphs by cyclesIn his 1736 paper on the Seven Bridges of Knigsberg, widely considered to be the birth of graph theory, LeonhardEuler proved that, for a nite undirected graph to have a closed walk that visits each edge exactly once, it is necessaryand sucient that it be connected and have even degree at each vertex. The corresponding characterization for theexistence of a closed walk visiting each edge exactly once in a directed graph is that the graph be strongly connectedand have equal numbers of incoming and outgoing edges at each vertex. In either case, the resulting walk is known asan Euler cycle or Euler tour. If a nite undirected graph has even degree at each of its vertices, regardless of whether

  • 10 CHAPTER 3. CYCLE (GRAPH THEORY)

    it is connected, then it is possible to nd a set of simple cycles that together cover each edge exactly once: this isVeblens theorem. [8]When a connected graph does not meet the conditions of Eulers theorem, a closed walk ofminimum length covering each edge at least once can nevertheless be found in polynomial time by solving the routeinspection problem.The problem of nding a single simple cycle that covers each vertex exactly once, rather than covering the edges, ismuch harder. Such a cycle is known as a Hamiltonian cycle, and determining whether it exists is NP-complete.[9]Much research has been published concerning classes of graphs that can be guaranteed to contain Hamiltonian cycles;one example is Ores theorem that a Hamiltonian cycle can always be found in a graph for which every non-adjacentpair of vertices have degrees summing to at least the total number of vertices in the graph.[10]

    The cycle double cover states that, for every bridgeless graph, there exists a multiset of simple cycles that covers eachedge of the graph exactly twice. Proving that this is true (or nding a counterexample) remains an open problem.[11]

    3.5 Graph classes dened by cyclesSeveral important classes of graphs can be dened by or characterized by their cycles. These include:

    Bipartite graph, a graph without odd cycles. Cactus graph, a graph in which every nontrivial biconnected component is a cycle Cycle graph, a graph that consists of a single cycle. Chordal graph, a graph with no induced cycles of length greater than three Directed acyclic graph, a directed graph with no cycles Perfect graph, a graph with no induced cycles or their complements of odd length greater than three Pseudoforest, a graph in which each connected component has at most one cycle Strongly connected graph, a directed graph in which every edge is part of a cycle Triangle-free graph, a graph without three-vertex cycles

    3.6 References[1] Balakrishnan, V.K. (2005). Schaums outline of theory and problems of graph theory ([Nachdr.]. ed.). McGraw-Hill. ISBN

    978-0070054899.[2] Gross, Jonathan L.; Yellen, Jay (2005), 4.6 Graphs and Vector Spaces, Graph Theory and Its Applications (2nd ed.),

    CRC Press, pp. 197207, ISBN 9781584885054.[3] Diestel, Reinhard (2012), 1.9 Some linear algebra, Graph Theory, Graduate Texts in Mathematics 173, Springer, pp.

    2328.[4] Tucker, Alan (2006). Chapter 2: Covering Circuits and Graph Colorings. Applied Combinatorics (5th ed.). Hoboken:

    John Wiley & sons. p. 49. ISBN 978-0-471-73507-6.[5] Sedgewick, Robert (1983), Graph algorithms, Algorithms, Addison-Wesley, ISBN 0-201-06672-6[6] Rocha, Rodrigo Caetano; Thatte, Bhalchandra (2015), Distributed cycle detection in large-scale sparse graphs[7] Silberschatz, Abraham; Peter Galvin; Greg Gagne (2003). Operating System Concepts. John Wiley & Sons, INC. p. 260.

    ISBN 0-471-25060-0.[8] Veblen, Oswald (1912), An Application of Modular Equations in Analysis Situs, Annals of Mathematics, Second Series

    14 (1): 8694, JSTOR 1967604.[9] Richard M. Karp (1972), Reducibility Among Combinatorial Problems (PDF), in R. E. Miller and J. W. Thatcher,

    Complexity of Computer Computations, New York: Plenum, pp. 85103.[10] Ore, . (1960), Note on Hamilton circuits, American Mathematical Monthly 67 (1): 55, JSTOR 2308928.[11] Jaeger, F. (1985), A survey of the cycle double cover conjecture, Annals of Discrete Mathematics 27 Cycles in Graphs,

    North-Holland Mathematics Studies 27, pp. 112, doi:10.1016/S0304-0208(08)72993-1..

  • Chapter 4

    Directed acyclic graph

    7

    11

    8

    10

    29

    5

    3

    An example of a directed acyclic graph

    In mathematics and computer science, a directed acyclic graph (DAG i/d/), is a directed graph with no directedcycles. That is, it is formed by a collection of vertices and directed edges, each edge connecting one vertex to another,such that there is no way to start at some vertex v and follow a sequence of edges that eventually loops back to vagain.[1][2][3]

    DAGs may be used to model many dierent kinds of information. The reachability relation in a DAG forms a partialorder, and any nite partial order may be represented by a DAG using reachability. A collection of tasks that mustbe ordered into a sequence, subject to constraints that certain tasks must be performed earlier than others, may berepresented as a DAG with a vertex for each task and an edge for each constraint; algorithms for topological orderingmay be used to generate a valid sequence. Additionally, DAGs may be used as a space-ecient representation ofa collection of sequences with overlapping subsequences. DAGs are also used to represent systems of events orpotential events and the causal relationships between them. DAGs may also be used to model processes in which dataows in a consistent direction through a network of processors, or states of a repository in a version-control system.

    11

  • 12 CHAPTER 4. DIRECTED ACYCLIC GRAPH

    The corresponding concept for undirected graphs is a forest, an undirected graph without cycles. Choosing an orien-tation for a forest produces a special kind of directed acyclic graph called a polytree. However there are many otherkinds of directed acyclic graph that are not formed by orienting the edges of an undirected acyclic graph. Moreover,every undirected graph has an acyclic orientation, an assignment of a direction for its edges that makes it into a di-rected acyclic graph. For these reasons it would be more accurate to call directed acyclic graphs acyclic directedgraphs or acyclic digraphs.

    4.1 Mathematical properties

    4.1.1 Reachability, transitive closure, and transitive reduction

    {x,y,z}

    {y,z}{x,z}{x,y}

    {y} {z}{x}

    A Hasse diagram representing the partial order among the subsets of a three-element set.

    Each directed acyclic graph gives rise to a partial order on its vertices, where u v exactly when there exists adirected path from u to v in the DAG.[4] However, many dierent DAGs may give rise to this same reachabilityrelation:[5] for example, the DAG with two edges a b and b c has the same reachability as the graph with threeedges a b, b c, and a c. If G is a DAG, its transitive reduction is the graph with the fewest edges thatrepresents the same reachability as G, and its transitive closure is the graph with the most edges that represents thesame reachability. The transitive reduction and transitive closure are both uniquely dened for DAGs; in contrast,for a directed graph that is not acyclic, there can be more than one minimal subgraph with the same reachabilityrelation.[6]

    The transitive closure ofG has an edge u v for every related pair u v of distinct elements in the reachability relationof G, and may therefore be thought of as a direct translation of the reachability relation into graph-theoretic terms:every partially ordered set may be translated into a DAG in this way. If a DAGG represents a partial order , then thetransitive reduction of G is a subgraph of G with an edge u v for every pair in the covering relation of ; transitivereductions are useful in visualizing the partial orders they represent, because they have fewer edges than other graphsrepresenting the same orders and therefore lead to simpler graph drawings. A Hasse diagram of a partial order is a

  • 4.2. COMPUTATIONAL PROBLEMS 13

    drawing of the transitive reduction in which the orientation of each edge is shown by placing the starting vertex ofthe edge in a lower position than its ending vertex.[7]

    4.1.2 Topological orderingEvery directed acyclic graph has a topological ordering, an ordering of the vertices such that the starting endpoint ofevery edge occurs earlier in the ordering than the ending endpoint of the edge. In general, this ordering is not unique;a DAG has a unique topological ordering if and only if it has a directed path containing all the vertices, in which casethe ordering is the same as the order in which the vertices appear in the path.[8] The family of topological orderingsof a DAG is the same as the family of linear extensions of the reachability relation for the DAG,[9] so any two graphsrepresenting the same partial order have the same set of topological orders.

    4.1.3 Combinatorial enumerationThe graph enumeration problem of counting directed acyclic graphs was studied by Robinson (1973).[10] The numberof DAGs on n labeled nodes, for n = 0, 1, 2, 3, , (allowing these numbers to appear in any order in a topologicalordering of the DAG) is

    1, 1, 3, 25, 543, 29281, 3781503, (sequence A003024 in OEIS).

    These numbers may be computed by the recurrence relation

    an =Pn

    k=1(1)k1nk

    2k(nk)ank: [10]

    EricW.Weisstein conjectured,[11] andMcKay et al. (2004) proved,[12] that the same numbers count the (0,1) matricesin which all eigenvalues are positive real numbers. The proof is bijective: a matrix A is an adjacency matrix of a DAGif and only if A + I is a (0,1) matrix with all eigenvalues positive, where I denotes the identity matrix. Because aDAG cannot have self-loops, its adjacency matrix must have a zero diagonal, so adding I preserves the property thatall matrix coecients are 0 or 1.

    4.1.4 Related families of graphsA polytree is a directed graph formed by orienting the edges of a free tree.[13] Every polytree is a DAG. In particular,this is true of the arborescences formed by directing all edges outwards from the root of a tree. A multitree (alsocalled a strongly unambiguous graph or a mangrove) is a directed graph in which there is at most one directed path(in either direction) between any two nodes; equivalently, it is a DAG in which, for every node v, the set of nodesreachable from v forms a tree.[14]

    4.2 Computational problems

    4.2.1 Topological sorting and recognitionMain article: Topological sorting

    Topological sorting is the algorithmic problem of nding topological orderings; it can be solved in linear time.[15]Kahns algorithm for topological sorting builds the vertex ordering directly, by maintaining a list of vertices that haveno edges connecting them to vertices that have not already been listed, and repeatedly adding one such vertex to theend of the list that is being built.[16] Alternatively, a topological ordering may be constructed by reversing a postordernumbering of a depth-rst search graph traversal.[15]

    It is also possible to check whether a given directed graph is a DAG in linear time, either by attempting to nd atopological ordering and then testing for each edge whether the resulting ordering is valid[17] or alternatively, for sometopological sorting algorithms, by verifying that the algorithm successfully orders all the vertices without meeting anerror condition.[16]

  • 14 CHAPTER 4. DIRECTED ACYCLIC GRAPH

    4.2.2 Construction from cyclic graphs

    Any undirected graph may be made into a DAG by choosing a total order for its vertices and orienting every edgefrom the earlier endpoint in the order to the later endpoint. However, dierent total orders may lead to the sameacyclic orientation. The number of acyclic orientations is equal to |(1)|, where is the chromatic polynomial of thegiven graph.[18]

    Any directed graph may be made into a DAG by removing a feedback vertex set or a feedback arc set. However, thesmallest such set is NP-hard to nd.[19] An arbitrary directed graph may also be transformed into a DAG, called itscondensation, by contracting each of its strongly connected components into a single supervertex.[20] When the graphis already acyclic, its smallest feedback vertex sets and feedback arc sets are empty, and its condensation is the graphitself.

    4.2.3 Transitive closure and transitive reduction

    The transitive closure of a given DAG, with n vertices andm edges, may be constructed in time O(mn) by using eitherbreadth-rst search or depth-rst search to test reachability from each vertex.[21] Alternatively, it can be solved in timeO(n) where < 2.373 is the exponent for fast matrix multiplication algorithms; this is a theoretical improvementover the O(mn) bound for dense graphs.[22]

    In all of these transitive closure algorithms, it is possible to distinguish pairs of vertices that are reachable by at leastone path of length two or more from pairs that can only be connected by a length-one path. The transitive reductionconsists of the edges that form length-one paths that are the only paths connecting their endpoints. Therefore, thetransitive reduction can be constructed in the same asymptotic time bounds as the transitive closure.[23]

    4.2.4 Closure problem

    Main article: Closure problem

    The closure problem takes as input a directed acyclic graph with weights on its vertices and seeks the minimum (ormaximum) weight of a closure, a set of vertices with no outgoing edges. (The problemmay be formulated for directedgraphs without the assumption of acyclicity, but with no greater generality, because in this case it is equivalent to thesame problem on the condensation of the graph.) It may be solved in polynomial time using a reduction to themaximum ow problem.[24]

    4.3 Applications

    4.3.1 Path algorithms

    Some algorithms become simpler when used on DAGs instead of general graphs, based on the principle of topologicalordering. For example, it is possible to nd shortest paths and longest paths from a given starting vertex in DAGs inlinear time by processing the vertices in a topological order, and calculating the path length for each vertex to be theminimum or maximum length obtained via any of its incoming edges.[25] In contrast, for arbitrary graphs the shortestpath may require slower algorithms such as Dijkstras algorithm or the BellmanFord algorithm,[26] and longest pathsin arbitrary graphs are NP-hard to nd.[27]

    4.3.2 Scheduling

    DAG representations of partial orderings have many applications in scheduling problems for systems of tasks withordering constraints.[28] For instance, a DAGmay be used to describe the dependencies between cells of a spreadsheet:if one cell is computed by a formula involving the value of a second cell, draw a DAG edge from the second cellto the rst one. If the input values to the spreadsheet change, all of the remaining values of the spreadsheet may berecomputed with a single evaluation per cell, by topologically ordering the cells and re-evaluating each cell in thisorder.[29] Similar problems of task ordering arise in makeles for program compilation,[29] instruction scheduling

  • 4.3. APPLICATIONS 15

    for low-level computer program optimization,[30] and PERT scheduling for management of large human projects.[31]Dependency graphs without circular dependencies form directed acyclic graphs.

    4.3.3 Data processing networksA directed graph may be used to represent a network of processing elements; in this formulation, data enters aprocessing element through its incoming edges and leaves the element through its outgoing edges. Examples of thisinclude the following:

    In electronic circuit design, a combinational logic circuit is an acyclic system of logic gates that computes afunction of an input, where the input and output of the function are represented as individual bits.[32]

    Dataow programming languages describe systems of values that are related to each other by a directed acyclicgraph. When one value changes, its successors are recalculated; each value is evaluated as a function of itspredecessors in the DAG.[33]

    In compilers, straight line code (that is, sequences of statements without loops or conditional branches) may berepresented by a DAG describing the inputs and outputs of each of the arithmetic operations performed withinthe code; this representation allows the compiler to perform common subexpression elimination eciently.[34]

    In most spreadsheet systems, the dependency graph that connects one cell to another if the rst cell stores aformula that uses the value in the second cell must be a directed acyclic graph. Cycles of dependencies aredisallowed because they cause the cells involved in the cycle to not have a well-dened value. Additionally,requiring the dependencies to be acyclic allows a topological sort to be used to schedule the recalculations ofcell values when the spreadsheet is changed.[29]

    4.3.4 Causal structuresGraphs that have vertices representing events, and edges representing causal relations between events, are oftenacyclic[35] arranging the vertices in linear order of time, all arrows point in the same direction as time, from parentto child (due to causality aecting the future, not the past), and thus have no loops.For instance, a Bayesian network represents a system of probabilistic events as nodes in a directed acyclic graph, inwhich the likelihood of an event may be calculated from the likelihoods of its predecessors in the DAG.[36] In thiscontext, the moral graph of a DAG is the undirected graph created by adding an (undirected) edge between all parentsof the same node (sometimes called marrying), and then replacing all directed edges by undirected edges.[37]

    Another type of graph with a similar causal structure is an inuence diagram, the nodes of which represent eitherdecisions to be made or unknown information, and the edges of which represent causal inuences from one node toanother.[38] In epidemiology, for instance, these diagrams are often used to estimate the expected value of dierentchoices for intervention.[39][40] The role ofDAGs in these applications is to convert causal assumptions into conditionalindependencies constraints, which can be read from the DAG using Pearls d-separation[41] and tested in the data.

    4.3.5 Genealogy and version historyFamily trees may also be seen as directed acyclic graphs, with a vertex for each family member and an edge for eachparent-child relationship.[42] Despite the name, these graphs are not necessarily trees because of the possibility ofmarriages between distant relatives (so a child has a common ancestor on both the mothers and fathers side) causingpedigree collapse. (The graphs of matrilineal descent (mother relationships between women) and patrilineal descent(father relationships between men) are trees within this graph.) Because no one can become their own ancestor,these graphs are acyclic.For the same reason, the version history of a distributed revision control system generally has the structure of adirected acyclic graph, in which there is a vertex for each revision and an edge connecting pairs of revisions that weredirectly derived from each other; these are not trees in general due to merges.[43]

    In many randomized algorithms in computational geometry, the algorithm maintains a history DAG representing theversion history of a geometric structure over the course of a sequence of changes to the structure. For instance ina randomized incremental algorithm for Delaunay triangulation, the triangulation changes by replacing one triangle

  • 16 CHAPTER 4. DIRECTED ACYCLIC GRAPH

    by three smaller triangles when each point is added, and by ip operations that replace pairs of triangles by adierent pair of triangles. The history DAG for this algorithm has a vertex for each triangle constructed as part ofthe algorithm, and edges from each triangle to the two or three other triangles that replace it. Tracing a path throughthis DAG representing the sequence of triangles that contain an individual point allows point location queries to beanswered eciently.[44]

    4.3.6 Data compressionAnother type of application of directed acyclic graphs arises in the concise representation of a set of sequences aspaths in a graph. For example, the directed acyclic word graph is a data structure in computer science formed by adirected acyclic graph with a single source and with edges labeled by letters or symbols; the paths from the source tothe sinks in this graph represent a set of strings, such as English words.[45] Any set of sequences can be representedas paths in a tree, by forming a tree node for every prex of a sequence and making the parent of one of these nodesrepresent the sequence with one fewer element; the tree formed in this way for a set of strings is called a trie. Adirected acyclic word graph saves space over a trie by allowing paths to diverge and rejoin, so that a set of words withthe same possible suxes can be represented by a single tree node.The same idea of using a DAG to represent a family of paths occurs in the binary decision diagram,[46][47] a DAG-based data structure for representing binary functions. In a binary decision diagram, each non-sink vertex is labeledby the name of a binary variable, and each sink and each edge is labeled by a 0 or 1. The function value for anytruth assignment to the variables is the value at the sink found by following a path, starting from the single sourcevertex, that at each non-sink vertex follows the outgoing edge labeled with the value of that vertexs variable. Just asdirected acyclic word graphs can be viewed as a compressed form of tries, binary decision diagrams can be viewedas compressed forms of decision trees that save space by allowing paths to rejoin when they agree on the results ofall remaining decisions.

    4.4 References[1] Christodes, Nicos (1975), Graph theory: an algorithmic approach, Academic Press, pp. 170174.

    [2] Thulasiraman, K.; Swamy, M. N. S. (1992), 5.7 Acyclic Directed Graphs, Graphs: Theory and Algorithms, John Wileyand Son, p. 118, ISBN 978-0-471-51356-8.

    [3] Bang-Jensen, Jrgen (2008), 2.1 Acyclic Digraphs,Digraphs: Theory, Algorithms and Applications, SpringerMonographsin Mathematics (2nd ed.), Springer-Verlag, pp. 3234, ISBN 978-1-84800-997-4.

    [4] Kozen, Dexter (1992), The Design and Analysis of Algorithms, Monographs in Computer Science, Springer, p. 9, ISBN978-0-387-97687-7.

    [5] Banerjee, Utpal (1993), Exercise 2(c)", Loop Transformations for Restructuring Compilers: The Foundations, Springer, p.19, ISBN 978-0-7923-9318-4.

    [6] Bang-Jensen, Jrgen; Gutin, Gregory Z. (2008), 2.3 Transitive Digraphs, Transitive Closures and Reductions, Digraphs:Theory, Algorithms and Applications, Springer Monographs in Mathematics, Springer, pp. 3639, ISBN 978-1-84800-998-1.

    [7] Jungnickel, Dieter (2012), Graphs, Networks and Algorithms, Algorithms and Computation in Mathematics 5, Springer,pp. 9293, ISBN 978-3-642-32278-5.

    [8] Sedgewick, Robert; Wayne, Kevin (2011), 4,2,25 Unique topological ordering, Algorithms (4th ed.), Addison-Wesley,pp. 598599, ISBN 978-0-13-276256-4.

    [9] Bender, Edward A.; Williamson, S. Gill (2005), Example 26 (Linear extensions topological sorts)", A Short Course inDiscrete Mathematics, Dover Books on Computer Science, Courier Dover Publications, p. 142, ISBN 978-0-486-43946-4.

    [10] Robinson, R. W. (1973), Counting labeled acyclic digraphs, in Harary, F., New Directions in the Theory of Graphs,Academic Press, pp. 239273. See also Harary, Frank; Palmer, Edgar M. (1973), Graphical Enumeration, AcademicPress, p. 19, ISBN 0-12-324245-2.

    [11] Weisstein, Eric W., Weissteins Conjecture, MathWorld.

    [12] McKay, B. D.; Royle, G. F.; Wanless, I. M.; Oggier, F. E.; Sloane, N. J. A.; Wilf, H. (2004), Acyclic digraphs andeigenvalues of (0,1)-matrices, Journal of Integer Sequences 7, Article 04.3.3.

  • 4.4. REFERENCES 17

    [13] Rebane, George; Pearl, Judea (1987), The recovery of causal poly-trees from statistical data, in Proc. 3rd Annual Con-ference on Uncertainty in Articial Intelligence (UAI 1987), Seattle, WA, USA, July 1987 (PDF), pp. 222228.

    [14] Furnas, GeorgeW.; Zacks, Je (1994), Multitrees: enriching and reusing hierarchical structure, Proc. SIGCHI conferenceon Human Factors in Computing Systems (CHI '94), pp. 330336, doi:10.1145/191666.191778.

    [15] Cormen, Thomas H.; Leiserson, Charles E., Rivest, Ronald L., Stein, Cliord (2001) [1990]. Introduction to Algorithms(2nd ed.). MIT Press and McGraw-Hill. ISBN 0-262-03293-7. Section 22.4, Topological sort, pp. 549552.

    [16] Jungnickel (2012), pp. 5051.

    [17] For depth-rst search based topological sorting algorithm, this validity check can be interleaved with the topological sortingalgorithm itself; see e.g. Skiena, Steven S. (2009), The Algorithm Design Manual, Springer, pp. 179181, ISBN 978-1-84800-070-4.

    [18] Stanley, Richard P. (1973), Acyclic orientations of graphs, Discrete Mathematics 5 (2): 171178, doi:10.1016/0012-365X(73)90108-8.

    [19] Garey, Michael R.; Johnson, David S. (1979), Computers and Intractability: A Guide to the Theory of NP-Completeness,W. H. Freeman, ISBN 0-7167-1045-5, Problems GT7 and GT8, pp. 191192.

    [20] Harary, Frank; Norman, Robert Z.; Cartwright, Dorwin (1965), Structural Models: An Introduction to the Theory of Di-rected Graphs, John Wiley & Sons, p. 63.

    [21] Skiena (2009), p. 495.

    [22] Skiena (2009), p. 496.

    [23] Bang-Jensen & Gutin (2008), p. 38.

    [24] Picard, Jean-Claude (1976), Maximal closure of a graph and applications to combinatorial problems,Management Science22 (11): 12681272, doi:10.1287/mnsc.22.11.1268, MR 0403596.

    [25] Cormen et al. 2001, Section 24.2, Single-source shortest paths in directed acyclic graphs, pp. 592595.

    [26] Cormen et al. 2001, Sections 24.1, The BellmanFord algorithm, pp. 588592, and 24.3, Dijkstras algorithm, pp. 595601.

    [27] Cormen et al. 2001, p. 966.

    [28] Skiena (2009), p. 469.

    [29] Gross, Jonathan L.; Yellen, Jay; Zhang, Ping (2013), Handbook of Graph Theory (2nd ed.), CRC Press, p. 1181, ISBN978-1-4398-8018-0.

    [30] Srikant, Y. N.; Shankar, Priti (2007), The Compiler Design Handbook: Optimizations and Machine Code Generation, (2nded.), CRC Press, pp. 1939, ISBN 978-1-4200-4383-9.

    [31] Wang, John X. (2002),What Every Engineer Should Know About Decision Making Under Uncertainty, CRC Press, p. 160,ISBN 978-0-8247-4373-4.

    [32] Sapatnekar, Sachin (2004), Timing, Springer, p. 133, ISBN 978-1-4020-7671-8.

    [33] Dennis, Jack B. (1974), First version of a data ow procedure language, Programming Symposium, Lecture Notes inComputer Science 19, pp. 362376, doi:10.1007/3-540-06859-7_145.

    [34] Touati, Sid; de Dinechin, Benoit (2014), Advanced Backend Optimization, John Wiley & Sons, p. 123, ISBN 978-1-118-64894-0.

    [35] Gopnik, Alison; Schulz, Laura (2007), Causal Learning, Oxford University Press, p. 4, ISBN 978-0-19-803928-0.

    [36] Shmulevich, Ilya; Dougherty, Edward R. (2010), Probabilistic Boolean Networks: The Modeling and Control of Gene Reg-ulatory Networks, Society for Industrial and Applied Mathematics, p. 58, ISBN 978-0-89871-692-4.

    [37] Cowell, Robert G.; Dawid, A. Philip; Lauritzen, Steen L.; Spiegelhalter, David J. (1999), 3.2.1 Moralization, Proba-bilistic Networks and Expert Systems, Springer, pp. 3133, ISBN 0-387-98767-3.

    [38] Dorf, Richard C. (1998), The Technology Management Handbook, CRC Press, p. 9-7, ISBN 978-0-8493-8577-3.

    [39] Boslaugh, Sarah (2008), Encyclopedia of Epidemiology, Volume 1, SAGE, p. 255, ISBN 978-1-4129-2816-8.

  • 18 CHAPTER 4. DIRECTED ACYCLIC GRAPH

    [40] Pearl, Judea (1995). Causal diagrams for empirical research. Biometrika 82 (4): 669709. doi:10.1093/biomet/82.4.669.

    [41] Bayesian network.

    [42] Kirkpatrick, Bonnie B. (April 2011), Haplotypes versus genotypes on pedigrees, Algorithms for Molecular Biology 6 (10),doi:10.1186/1748-7188-6-10, PMC 3102622, PMID 21504603.

    [43] Bartlang, Udo (2010), Architecture and Methods for Flexible Content Management in Peer-to-Peer Systems, Springer, p. 59,ISBN 978-3-8348-9645-2.

    [44] Pach, Jnos; Sharir, Micha, Combinatorial Geometry and Its Algorithmic Applications: The Alcal Lectures, Mathematicalsurveys and monographs 152, American Mathematical Society, pp. 9394, ISBN 978-0-8218-7533-9.

    [45] Crochemore, Maxime; Vrin, Renaud (1997), Direct construction of compact directed acyclic word graphs, Combina-torial Pattern Matching, Lecture Notes in Computer Science, Springer, pp. 116129, doi:10.1007/3-540-63220-4_55.

    [46] Lee, C. Y. (1959), Representation of switching circuits by binary-decision programs, Bell Systems Technical Journal 38:985999, doi:10.1002/j.1538-7305.1959.tb01585.x.

    [47] Akers, Sheldon B. (1978), Binary decision diagrams, IEEETransactions on ComputersC27 (6): 509516, doi:10.1109/TC.1978.1675141.

    4.5 External links Weisstein, Eric W., Acyclic Digraph, MathWorld.

  • Chapter 5

    Directed graph

    A directed graph.

    In mathematics, and more specically in graph theory, a directed graph (or digraph) is a graph, or set of nodesconnected by edges, where the edges have a direction associated with them. In formal terms, a digraph is a pairG = (V;A) (sometimes G = (V;E) ) of:[1]

    a set V, whose elements are called vertices or nodes, a set A of ordered pairs of vertices, called arcs, directed edges, or arrows (and sometimes simply edges with

    19

  • 20 CHAPTER 5. DIRECTED GRAPH

    abcd

    1 2 3 41-1 1

    1-1

    -1-1

    1

    00 0

    000 0 0

    a b

    cd

    1234

    Directed graph with corresponding incidence matrix.

    the corresponding set named E instead of A).

    It diers from an ordinary or undirected graph, in that the latter is dened in terms of unordered pairs of vertices,which are usually called edges.A digraph is called simple if it has no loops, and no multiple arcs (arcs with same starting and ending nodes). Adirected multigraph, in which the arcs constitute a multiset, rather than a set, of ordered pairs of vertices may haveloops (that is, self-loops with same starting and ending node) and multiple arcs. Some, but not all, texts allow adigraph, without the qualication simple, to have self loops, multiple arcs, or both.

    5.1 Basic terminologyAn arc e = (x; y) is considered to be directed from x to y ; y is called the head and x is called the tail of the arc; yis said to be a direct successor of x , and x is said to be a direct predecessor of y . If a path made up of one or moresuccessive arcs leads from x to y , then y is said to be a successor of x , and x is said to be a predecessor of y . Thearc (y; x) is called the arc (x; y) inverted.An orientation of a simple undirected graph is obtained by assigning a direction to each edge. Any directed graphconstructed this way is called an oriented graph. A directed graph is an oriented simple graph if and only if it hasneither self-loops nor 2-cycles.[2]

    A weighted digraph is a digraph with weights assigned to its arcs, similar to a weighted graph. In the context of graphtheory a digraph with weighted edges is called a network.The adjacency matrix of a digraph (with loops and multiple arcs) is the integer-valued matrix with rows and columnscorresponding to the nodes, where a nondiagonal entry aij is the number of arcs from node i to node j, and thediagonal entry aii is the number of loops at node i. The adjacency matrix of a digraph is unique up to identicalpermutation of rows and columns.Another matrix representation for a digraph is its incidence matrix.See direction for more denitions.

    5.2 Indegree and outdegreeFor a node, the number of head endpoints adjacent to a node is called the indegree of the node and the number of tailendpoints adjacent to a node is its outdegree (called "branching factor" in trees).

  • 5.3. DEGREE SEQUENCE 21

    A digraph with vertices labeled (indegree, outdegree)

    Let G = (V, E) and v V, then the indegree is denoted deg(v) and the outdegree as deg+(v): A vertex withdeg(v) = 0 is called a source, as it is the origin of each of its incident edges. Similarly, a vertex with deg+(v) = 0is called a sink.The degree sum formula states that, for a directed graph,

    Xv2V

    deg+(v) =Xv2V

    deg(v) = jEj :

    If, for every node v V, we have deg+(v) = deg(v) , the graph is called a balanced digraph.[3]

    5.3 Degree sequenceThe degree sequence of a directed graph is the list of its indegree and outdegree pairs; for the above example we havedegree sequence ((2,0),(2,2),(0,2),(1,1)). The degree sequence is a directed graph invariant so isomorphic directedgraphs have the same degree sequence. However, the degree sequence does not, in general, uniquely identify a graph;in some cases, non-isomorphic graphs have the same degree sequence.The digraph realization problem is the problem of nding a digraph with the degree sequence being a given sequenceof positive integer pairs. (Trailing pairs of zeros may be ignored since they are trivially realized by adding an appro-priate number of isolated vertices to the digraph.) A sequence which is the degree sequence of some digraph, i.e.for which the digraph realization problem has a solution, is called a digraphic or digraphical sequence. This problemcan either be solved by the KleitmanWang algorithm or by the FulkersonChenAnstee theorem.

    5.4 Digraph connectivityMain article: Connectivity (graph theory)

    A digraph G is calledweakly connected (or just connected[4]) if the undirected underlying graph obtained by replacingall directed edges of G with undirected edges is a connected graph. A digraph is strongly connected or strong if it

  • 22 CHAPTER 5. DIRECTED GRAPH

    contains a directed path from u to v and a directed path from v to u for every pair of vertices u,v. The strong componentsare the maximal strongly connected subgraphs.

    5.5 Classes of digraphs

    A directed graphG is called symmetric if, for every arc that belongs toG, the corresponding reversed arc also belongsto G. A symmetric, loopless directed graph is equivalent to an undirected graph with the edges replaced by pairs ofinverse arcs; thus the number of edges is equal to the number of arcs halved.

    7

    11 8

    5 3

    102 9

    A simple acyclic directed graph

    An acyclic directed graph, acyclic digraph, or directed acyclic graph is a directed graph with no directed cycles.Special cases of acyclic directed graphs include multitrees (graphs in which no two directed paths from a singlestarting node meet back at the same ending node), oriented trees or polytrees (digraphs formed by orienting the edgesof undirected acyclic graphs), and rooted trees (oriented trees in which all edges of the underlying undirected treeare directed away from the roots).A tournament is an oriented graph obtained by choosing a direction for each edge in an undirected complete graph.In the theory of Lie groups, a quiver Q is a directed graph serving as the domain of, and thus characterizing the shapeof, a representation V dened as a functor, specically an object of the functor category FinVctKF(Q) where F(Q) isthe free category on Q consisting of paths in Q and FinVctK is the category of nite-dimensional vector spaces overa eld K. Representations of a quiver label its vertices with vector spaces and its edges (and hence paths) compatiblywith linear transformations between them, and transform via natural transformations.

  • 5.6. SEE ALSO 23

    1 2

    3 4A tournament on 4 vertices

    5.6 See also Coates graph Flow chart Rooted graph Flow graph (mathematics) Mason graph Oriented graph Preorder Quiver Signal-ow graph Transpose graph Vertical constraint graph

  • 24 CHAPTER 5. DIRECTED GRAPH

    5.7 Notes[1] Bang-Jensen & Gutin (2000). Diestel (2005), Section 1.10. Bondy & Murty (1976), Section 10.

    [2] Diestel (2005), Section 1.10.

    [3] Satyanarayana, Bhavanari; Prasad, Kuncham Syam, Discrete Mathematics and Graph Theory, PHI Learning Pvt. Ltd., p.460, ISBN 978-81-203-3842-5; Brualdi, Richard A. (2006), Combinatorial matrix classes, Encyclopedia of mathematicsand its applications 108, Cambridge University Press, p. 51, ISBN 978-0-521-86565-4.

    [4] Bang-Jensen & Gutin (2000) p. 19 in the 2007 edition; p. 20 in the 2nd edition (2009).

    5.8 References Bang-Jensen, Jrgen; Gutin, Gregory (2000), Digraphs: Theory, Algorithms and Applications, Springer, ISBN1-85233-268-9(the corrected 1st edition of 2007 is now freely available on the authors site; the 2nd edition appeared in 2009ISBN 1-84800-997-6).

    Bondy, John Adrian; Murty, U. S. R. (1976), Graph Theory with Applications, North-Holland, ISBN 0-444-19451-7.

    Diestel, Reinhard (2005), Graph Theory (3rd ed.), Springer, ISBN 3-540-26182-6 (the electronic 3rd editionis freely available on authors site).

    Harary, Frank; Norman, Robert Z.; Cartwright, Dorwin (1965), Structural Models: An Introduction to theTheory of Directed Graphs, New York: Wiley.

    Number of directed graphs (or digraphs) with n nodes.

  • Chapter 6

    Flow network

    In graph theory, a ow network (also known as a transportation network) is a directed graph where each edge hasa capacity and each edge receives a ow. The amount of ow on an edge cannot exceed the capacity of the edge.Often in operations research, a directed graph is called a network. The vertices are called nodes and the edges arecalled arcs. A ow must satisfy the restriction that the amount of ow into a node equals the amount of ow out of it,unless it is a source, which has only outgoing ow, or sink, which has only incoming ow. A network can be used tomodel trac in a road system, circulation with demands, uids in pipes, currents in an electrical circuit, or anythingsimilar in which something travels through a network of nodes.

    6.1 DenitionLet G = (V;E) be a nite directed graph in which every edge (u; v) 2 E has a non-negative, real-valued capacityc(u; v) . If (u; v) 62 E , we assume that c(u; v) = 0 . We distinguish two vertices: a source s and a sink t . A owin a ow network is a real function f : V V ! R with the following three properties for all nodes u and v :

    i.e. Flow conservation implies: P(u;v)2E f(u; v) =P(v;z)2E f(v; z) , for each vertex v 2 V n fs; tgNotice that f(u; v) is the net ow from u to v . If the graph represents a physical network, and if there is a realow of, for example, 4 units from u to v , and a real ow of 3 units from v to u , we have f(u; v) = 1 andf(v; u) = 1 .Basically we can say that ow for a physical network is ow leaving at s = P(s;v)2E f(s; v)The residual capacity of an edge is cf (u; v) = c(u; v) f(u; v) . This denes a residual network denotedGf (V;Ef ) , giving the amount of available capacity. See that there can be a path from u to v in the residualnetwork, even though there is no path from u to v in the original network. Since ows in opposite directions cancelout, decreasing the ow from v to u is the same as increasing the ow from u to v . An augmenting path is apath (u1; u2; : : : ; uk) in the residual network, where u1 = s , uk = t , and cf (ui; ui+1) > 0 . A network is atmaximum ow if and only if there is no augmenting path in the residual network Gf .So Gf is constructed using graph G as follows:1. Vertices of Gf = V2. Edges of Gf = Ef dened as-For each edge (x; y) 2 E(i). If f(x; y) < c(x; y); make Forward edge (x; y) 2 Ef with capacity cf = c(x; y) f(x; y) . (ii). Iff(x; y) > 0; make Backward edge (y; x) 2 Ef with capacity cf = f(x; y) .This concept is used in FordFulkerson algorithm which computes the maximum ow in a ow network.Sometimes one needs to model a network with more than one source, a supersource is introduced to the graph.[1]This consists of a vertex connected to each of the sources with edges of innite capacity, so as to act as a globalsource. A similar construct for sinks is called a supersink.[2]

    25

  • 26 CHAPTER 6. FLOW NETWORK

    6.2 Example

    A ow network showing ow and capacity

    To the right you see a ow network with source labeled s , sink t , and four additional nodes. The ow and capacityis denoted f/c . Notice how the network upholds skew symmetry, capacity constraints and ow conservation. Thetotal amount of ow from s to t is 5, which can be easily seen from the fact that the total outgoing ow from s is 5,which is also the incoming ow to t . We know that no ow appears or disappears in any of the other nodes.

    Residual network for the above ow network, showing residual capacities.

    Below you see the residual network for the given ow. Notice how there is positive residual capacity on some edgeswhere the original capacity is zero, for example for the edge (d; c) . This ow is not a maximum ow. There isavailable capacity along the paths (s; a; c; t) , (s; a; b; d; t) and (s; a; b; d; c; t) , which are then the augmenting paths.The residual capacity of the rst path is min(c(s; a) f(s; a); c(a; c) f(a; c); c(c; t) f(c; t)) = min(5 3; 32; 2 1) = min(2; 1; 1) = 1 . Notice that as long as there exists some path with a positive residual capacity, theow will not be maximum. The residual capacity for some path is the minimum residual capacity of all edges in thatpath.

  • 6.3. APPLICATIONS 27

    6.3 ApplicationsSee also: Pipe network analysis

    Picture a series of water pipes, tting into a network. Each pipe is of a certain diameter, so it can only maintain aow of a certain amount of water. Anywhere that pipes meet, the total amount of water coming into that junctionmust be equal to the amount going out, otherwise we would quickly run out of water, or we would have a buildup ofwater. We have a water inlet, which is the source, and an outlet, the sink. A ow would then be one possible way forwater to get from source to sink so that the total amount of water coming out of the outlet is consistent. Intuitively,the total ow of a network is the rate at which water comes out of the outlet.Flows can pertain to people or material over transportation networks, or to electricity over electrical distributionsystems. For any such physical network, the ow coming into any intermediate node needs to equal the ow goingout of that node. This conservation constraint was formalized as Kirchhos current law.Flow networks also nd applications in ecology: ow networks arise naturally when considering the ow of nutrientsand energy between dierent organizations in a food web. The mathematical problems associated with such networksare quite dierent from those that arise in networks of uid or trac ow. The eld of ecosystem network analysis,developed by Robert Ulanowicz and others, involves using concepts from information theory and thermodynamics tostudy the evolution of these networks over time.The simplest and most common problem using ow networks is to nd what is called the maximum ow, whichprovides the largest possible total ow from the source to the sink in a given graph. There are many other problemswhich can be solved using max ow algorithms, if they are appropriately modeled as ow networks, such as bipartitematching, the assignment problem and the transportation problem. Maximum ow problems can be solved ecientlywith the relabel-to-front algorithm. The max-ow min-cut theorem states that nding a maximal network ow isequivalent to nding a cut of minimum capacity that separates the source and the sink. Where a cut is the divisionof vertices such that the source is in one division and the sink is in another.In a multi-commodity ow problem, you have multiple sources and sinks, and various commodities which are toow from a given source to a given sink. This could be for example various goods that are produced at variousfactories, and are to be delivered to various given customers through the same transportation network.In a minimum cost ow problem, each edge u; v has a given cost k(u; v) , and the cost of sending the ow f(u; v)across the edge is f(u; v) k(u; v) . The objective is to send a given amount of ow from the source to the sink, atthe lowest possible price.In a circulation problem, you have a lower bound l(u; v) on the edges, in addition to the upper bound c(u; v) . Eachedge also has a cost. Often, ow conservation holds for all nodes in a circulation problem, and there is a connectionfrom the sink back to the source. In this way, you can dictate the total ow with l(t; s) and c(t; s) . The ow circulatesthrough the network, hence the name of the problem.In a network with gains or generalized network each edge has a gain, a real number (not zero) such that, if theedge has gain g, and an amount x ows into the edge at its tail, then an amount gx ows out at the head.In a source localization problem, an algorithm tries to identify the most likely source node of information diusionthrough a partially observed network. This can be done in linear time for trees and cubic time for arbitrary net-works and has applications ranging from tracking mobile phone users to identifying the originating village of diseaseoutbreaks.[3]

    6.4 See also Braess paradox Centrality Constructal theory FordFulkerson algorithm Dinics algorithm Flow (computer networking)

  • 28 CHAPTER 6. FLOW NETWORK

    Flow graph Max-ow min-cut theorem Oriented matroid Shortest path problem

    6.5 References[1] Black, Paul E. Supersource. Dictionary of Algorithms and Data Structures. NIST.

    [2] Black, Paul E. Supersink. Dictionary of Algorithms and Data Structures. NIST.

    [3] http://www.pedropinto.org.s3.amazonaws.com/publications/locating_source_diffusion_networks.pdf

    6.6 Further reading George T. Heineman, Gary Pollice, and Stanley Selkow (2008). Chapter 8:Network Flow Algorithms. Al-

    gorithms in a Nutshell. Oreilly Media. pp. 226250. ISBN 978-0-596-51624-6. Ravindra K. Ahuja, Thomas L. Magnanti, and James B. Orlin (1993). Network Flows: Theory, Algorithms and

    Applications. Prentice Hall. ISBN 0-13-617549-X. Bollobs, Bla (1979). Graph Theory: An Introductory Course. Heidelberg: Springer-Verlag. ISBN 3-540-90399-2.

    Chartrand, Gary & Oellermann, Ortrud R. (1993). Applied and Algorithmic Graph Theory. New York:McGraw-Hill. ISBN 0-07-557101-3.

    Even, Shimon (1979). Graph Algorithms. Rockville, Maryland: Computer Science Press. ISBN 0-914894-21-8.

    Gibbons, Alan (1985). Algorithmic Graph Theory. Cambridge: Cambridge University Press. ISBN 0-521-28881-9.

    ThomasH. Cormen, Charles E. Leiserson, Ronald L. Rivest, andCliord Stein (2001) [1990]. 26. Introductionto Algorithms (2nd ed.). MIT Press and McGraw-Hill. pp. 696697. ISBN 0-262-03293-7.

    6.7 External links Maximum Flow Problem Maximum Flow Real graph instances dead link] Software, papers, test graphs, etc. dead link][Software and papers for network ow problems Lemon C++ library with several maximum ow and minimum cost circulation algorithms QuickGraph, graph data structures and algorithms for .Net

  • Chapter 7

    Graph (mathematics)

    This article is about sets of vertices connected by edges. For graphs of mathematical functions, see Graph of afunction. For other uses, see Graph (disambiguation).In mathematics, and more specically in graph theory, a graph is a representation of a set of objects where some

    123

    546

    A drawing of a labeled graph on 6 vertices and 7 edges.

    pairs of objects are connected by links. The interconnected objects are represented by mathematical abstractionscalled vertices, and the links that connect some pairs of vertices are called edges.[1] Typically, a graph is depicted indiagrammatic form as a set of dots for the vertices, joined by lines or curves for the edges. Graphs are one of theobjects of study in discrete mathematics.The edges may be directed or undirected. For example, if the vertices represent people at a party, and there is anedge between two people if they shake hands, then this is an undirected graph, because if person A shook hands withperson B, then person B also shook hands with person A. In contrast, if there is an edge from person A to person Bwhen person A knows of person B, then this graph is directed, because knowledge of someone is not necessarily asymmetric relation (that is, one person knowing another person does not necessarily imply the reverse; for example,many fans may know of a celebrity, but the celebrity is unlikely to know of all their fans). This latter type of graphis called a directed graph and the edges are called directed edges or arcs.

    29

  • 30 CHAPTER 7. GRAPH (MATHEMATICS)

    Vertices are also called nodes or points, and edges are also called arcs or lines. Graphs are the basic subject studiedby graph theory. The word graph was rst used in this sense by J.J. Sylvester in 1878.[2][3]

    7.1 DenitionsDenitions in graph theory vary. The following are some of the more basic ways of dening graphs and relatedmathematical structures.

    7.1.1 Graph

    In the most common sense of the term,[4] a graph is an ordered pair G = (V, E) comprising a set V of vertices ornodes together with a set E of edges or links, which are 2-element subsets of V (i.e., an edge is related with twovertices, and the relation is represented as an unordered pair of the vertices with respect to the particular edge). Toavoid ambiguity, this type of graph may be described precisely as undirected and simple.Other senses of graph stem from dierent conceptions of the edge set. In one more generalized notion,[5] E is a settogether with a relation of incidence that associates with each edge two vertices. In another generalized notion, E isa multiset of unordered pairs of (not necessarily distinct) vertices. Many authors call this type of object a multigraphor pseudograph.All of these variants and others are described more fully below.The vertices belonging to an edge are called the ends, endpoints, or end vertices of the edge. A vertex may exist ina graph and not belong to an edge.V and E are usually taken to be nite, and many of the well-known results are not true (or are rather dierent) forinnite graphs because many of the arguments fail in the innite case. Moreover, V is often assumed to be non-empty, but E is allowed to be the empty set. The order of a graph is jV j (the number of vertices). A graphs sizeis jEj , the number of edges. The degree of a vertex is the number of edges that connect to it, where an edge thatconnects to the vertex at both ends (a loop) is counted twice.For an edge {u, v}, graph theorists usually use the somewhat shorter notation uv.

    7.1.2 Adjacency relation

    The edges E of an undirected graph G induce a symmetric binary relation ~ on V that is called the adjacency relationof G. Specically, for each edge {u, v} the vertices u and v are said to be adjacent to one another, which is denotedu ~ v.

    7.2 Types of graphs

    7.2.1 Distinction in terms of the main denition

    As stated above, in dierent contexts it may be useful to rene the term graph with dierent degrees of generality.Whenever it is necessary to draw a strict distinction, the following terms are used. Most commonly, in modern textsin graph theory, unless stated otherwise, graph means undirected simple nite graph (see the denitions below).

    A directed graph.

  • 7.2. TYPES OF GRAPHS 31

    A simple undirected graph with three vertices and three edges. Each vertex has degree two, so this is also a regulargraph.

    Undirected graph

    An undirected graph is one in which edges have no orientation. The edge (a, b) is identical to the edge (b, a), i.e., theyare not ordered pairs, but sets {u, v} (or 2-multisets) of vertices. The maximum number of edges in an undirectedgraph without a self-loop is n(n - 1)/2.

    Directed graph

    Main article: Directed graph

    A directed graph or digraph is an ordered pair D = (V, A) with

    V a set whose elements are called vertices or nodes, and A a set of ordered pairs of vertices, called arcs, directed edges, or arrows.

    An arc a = (x, y) is considered to be directed from x to y; y is called the head and x is called the tail of the arc; y issaid to be a direct successor of x, and x is said to be a direct predecessor of y. If a path leads from x to y, then y issaid to be a successor of x and reachable from x, and x is said to be a predecessor of y. The arc (y, x) is called thearc (x, y) inverted.A directed graph D is called symmetric if, for every arc in D, the corresponding inverted arc also belongs to D. Asymmetric loopless directed graph D = (V, A) is equivalent to a simple undirected graph G = (V, E), where the pairsof inverse arcs in A correspond 1-to-1 with the edges in E; thus the edges in G number |E | = |A|/2, or half the numberof arcs in D.An oriented graph is a directed graph in which at most one of (x, y) and (y, x) may be arcs.

    Mixed graph

    Main article: Mixed graph

    A mixed graph G is a graph in which some edges may be directed and some may be undirected. It is written as anordered triple G = (V, E, A) with V, E, and A dened as above. Directe