Graphs Lect4

download Graphs Lect4

of 28

Transcript of Graphs Lect4

  • 8/14/2019 Graphs Lect4

    1/28

    Graph

    Nitin Upadhyay

    March 01, 2006

    Bits-Pilani Goa campus

  • 8/14/2019 Graphs Lect4

    2/28

    Discussion

    Counting Path Example

    ConnectednessCut Vertices and Cut Edges

    General Graphs

    Planar Graphs Planar Embedding

    Plane Graph Regions

    Plane Graph Degree

  • 8/14/2019 Graphs Lect4

    3/28

    Counting Paths and Adjacency Matrices

    Let A be the adjacency matrix of graph G.

    The number of paths of length kfrom vi to vj

    is equal to (Ak)i,j. (The notation (M)i,j denotes

    mi,j where [mi,j] = M.)

  • 8/14/2019 Graphs Lect4

    4/28

    Counting Paths Example

    How many paths of length 4 are there from 1

    to 5 in the graph?

    1 2

    3

    4 5

    e1

    e2e3

    e4

    e5e6

  • 8/14/2019 Graphs Lect4

    5/28

    Adjacency Matrix

    1 2

    3

    4 5

    e1

    e2e3

    e4

    e5

    e6

    The number

    of paths of length4 from a to dis the

    (1, 5)th entry ofA4.

    Since

    0 1 0 1 0

    1 0 1 0 10 1 0 1 1

    1 0 1 0 0

    0 1 1 0 0

    3

    9 3 11 1 6

    3 15 7 11 8

    11 7 15 3 8

    1 11 3 9 6

    6 8 8 6 8

    The (1, 5)th entry ofA4

    is 6, indicating that thereare six different paths of

    length 4 between 1 and

    5.

    1:{1-4-1-2-5}

    2:{1-2-1-2-5}

    3:{1-4-3-2-5}

    4:{1-2-5-2-5}

    5:{1-2-3-2-5}

    6:{1-2-5-3-5}

  • 8/14/2019 Graphs Lect4

    6/28

    Counting Paths Example

    How many paths of length 4 are

    there from a to d in the right

    graph? The adjacency matrix of the

    graph is

    Hence, the number

    of paths of length

    4 from a to d is the

    (1, 4)th entry ofA4.

    Since

    There are 8 paths of length

    4 from a to d.

    a b

    cd

    =

    0110

    1001

    1001

    0110

    A

    =

    8008

    0880

    0880

    8008

    4A

  • 8/14/2019 Graphs Lect4

    7/28

    Connectedness

    An undirected graph isconnectediff there is a pathbetween every pair ofdistinct vertices in the graph.

    E.g., Graph G1 is connected,since for every pair ofdistinct vertices, there is apath between them.

    However, G2 is notconnected. E.g., no path inG2 between vertices a and c.

    a b c

    d fe

    a b c

    d fe

  • 8/14/2019 Graphs Lect4

    8/28

    Connectedness

    Theorem: There is a simple path between

    every pair of distinct vertices of a connectedundirected graph.

    Connected component: A graph that is notconnected is the union of two or more

    connected subgraphs, each pair of which hasno vertex in common. These disjointconnected subgraphs are called theconnected components of the graph.

  • 8/14/2019 Graphs Lect4

    9/28

    Connected Component Example

    The graph His the

    union of three disjoint

    connected subgraph

    H1, H2, and H3. These

    three subgraphs are the

    connectedcomponents

    ofH.

    a

    c

    d

    f

    e

    b gh

    H1

    H2

    H3

    H

  • 8/14/2019 Graphs Lect4

    10/28

    Cut Vertices and Cut Edges

    A cut vertexorcut edge

    separates 1 connected

    component into 2 ifremoved.

    E.g., The cut vertices ofG

    are b, c, and e, since

    removing one of these

    vertices (and its adjacentedges) disconnects the

    graph. The cut edges are

    [a, b] and [c, e].

    a

    c

    g

    b he

    d f

  • 8/14/2019 Graphs Lect4

    11/28

    Directed Connectedness

    A directed graph is strongly connectediff

    there is a directed path from any vertex toany other vertex in the graph.

    It is weakly connectediff the underlying

    undirectedgraph (i.e., with edge directionsremoved) is connected.

  • 8/14/2019 Graphs Lect4

    12/28

    Directed Connectedness Example

    Are the directed graphs G and H strongly

    connected or weakly connected?

    a b

    c

    de

    a b

    c

    de

    G H

  • 8/14/2019 Graphs Lect4

    13/28

    Directed Connectedness Example

    G is strongly connectedsince there is a directed

    path between any twovertices. Hence, G is alsoweakly connected. His notstrongly connected since, forinstance, theres nodirected path from a to b. H

    is however weaklyconnected since there is apath between any twovertices with all directionsremoved.

    ab

    c

    de

    ab

    c

    de

    G H

  • 8/14/2019 Graphs Lect4

    14/28

    General Graphs

    Generally graphs drawn on a piece of paper

    permit edges to intersect at points other thanvertices.

    These points of intersection are called

    crossovers.

    And the intersecting edges are said to crossover each other.

  • 8/14/2019 Graphs Lect4

    15/28

    Example Crossovers

    Here this graph exhibits three crossovers:

    {b, e} crosses over {a, d} and {a, c}. {b, d} crosses over {a, c}

  • 8/14/2019 Graphs Lect4

    16/28

    Planar Graphs

    A Graph G is said to be planar if it can be

    drawn on a plane without any crossovers.

    A graph is non planar if there is no way to

    convert it into planar.

  • 8/14/2019 Graphs Lect4

    17/28

    Example conversion

    Non planar to planar

    c c

  • 8/14/2019 Graphs Lect4

    18/28

    Planar embedding

    Graphs can be represented such that no two

    edges of the graph intersect except possiblyat a vertex to which they both incident.

    A drawing of a geometric representation of a

    graph on any surface such that no edges

    intersect is called embedding. An graph G is planar if there exists a graph

    isomorphic to G that is embedded in a plane.

  • 8/14/2019 Graphs Lect4

    19/28

    Plane Graph Regions

    A plane graph G can be thought of as dividing

    the plane into regions orfaces.

    The regions are the connected portions of the

    plane remaining after all the curves and pointsof the plane corresponding, respectively, to

    edges and vertices of G have been deleted.

  • 8/14/2019 Graphs Lect4

    20/28

    Plane Graph Regions

    A plane graph partitions the plane into

    regions of G.

    There is exactly one region whose area is

    infinite, known as exteriororinfinite region.

    Every other region is an interior region.

  • 8/14/2019 Graphs Lect4

    21/28

    Plane Graph Regions

    The boundary of a region is the subgraph

    formed by the vertices and edgesencompassing that region.

    If the boundary of the exterior region of a

    plane graph is a cycle, that cycle is knownas the maximal cycle of the graph.

  • 8/14/2019 Graphs Lect4

    22/28

    Plane Graph Regions

    The degree of a region is the number of

    edges in a (closed) walk encloses it. A bridge belongs to the boundary of only

    one region, thus it contributes to the size of

    the boundary twice.

    The sum of the degrees of all the regions in aplane graph is twice the size if the graph.

  • 8/14/2019 Graphs Lect4

    23/28

    Region Example

    Graph has six interior regions and one exterior

    regions.a

    eb c

    d

    f

    g

    h

    i

    j

    Interior regions- 1:{a-b-c-a} 3:{a-c-d-e-a} 5:{g-h-j-g} 6:{g-h-i-f-g}

    2:{b-c-d-b} 4:{j-h-i-j}

    Exterior region- 1:{a-b-d-e-f-i-j-g-f-e-a}

  • 8/14/2019 Graphs Lect4

    24/28

    Degree example

    In the graph there exists four interior regions

    of degree 3 and two interior regions ofdegree 4.The degree of exterior region is 10.

    a

    eb c

    d

    f

    g

    h

    i

    j

  • 8/14/2019 Graphs Lect4

    25/28

    Degree example

    The sum of the degrees (of the regions) is

    30, and the graph has 15 edges.

    a

    eb c

    d

    f

    g

    h

    i

    j

  • 8/14/2019 Graphs Lect4

    26/28

    Example 1

    Find out the interior and exterior regions,

    degree of each region and total degree of theplanar graph G.

    a b c d

    h g f e

    Interior regions:

    1:{a-b-g-h-a} 2:{b-c-f-g-b}

    3:{c-d-e-f-c} degree: {4}

    Exterior region

    1: {a-b-c-d-e-f-g-h-a}

    Degree: {8}

    Total degree: 8 + (4 * 3) = 20

    Number of edges: 20/2 = 10

  • 8/14/2019 Graphs Lect4

    27/28

    Example 2

    Find out the interior and exterior regions,

    degree of each region and total degree of theplanar graph G.Interior regions:

    1:{b-d-c-b} 2:{e-f-g-e}

    degree: {3}

    Exterior region

    1: {a-b-c-d-e-f-g-e-d-b-a}

    Degree: {10}

    Total degree: 10 + (2 * 3) = 16c

    b

    a

    d e

    f

    g

  • 8/14/2019 Graphs Lect4

    28/28

    Questions Questions ?