a proof involving graphs

Upload: shanksauce

Post on 04-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 A Proof Involving Graphs

    1/54

    A Proof Involving GraphsCCNY CSc 104 Dave Chisholm [email protected]

    1

  • 7/29/2019 A Proof Involving Graphs

    2/54

    2

    Consider a problem

    Let G = (V, E) be a loop free connected undirected graph

  • 7/29/2019 A Proof Involving Graphs

    3/54

    3

    Consider a problem

    Let G = (V, E) be a loop free connected undirected graph

    Let {a, b} be an edge in G

  • 7/29/2019 A Proof Involving Graphs

    4/54

    4

    Consider a problem

    Let G = (V, E) be a loop free connected undirected graph

    Let {a, b} be an edge in G

    Prove

    {a,b} is part of a cycle if and only if its removal does not

    disconnect G

  • 7/29/2019 A Proof Involving Graphs

    5/54

    5

    Consider a problem

    Let G = (V, E) be a loop free connected undirected graph

    Let {a, b} be an edge in G

    Prove

    {a,b} is part of a cycle if and only if its removal does not

    disconnect G

    Note we are not removing a and b from the set of vertices

    Just removing {a,b} from the set of edges

    (This is problem 11.1.9 from Pg. 519)

  • 7/29/2019 A Proof Involving Graphs

    6/54

    6

    First glance at the problem

    The first thing to notice is that this problem fits a template:

    PROVE {Something} IF AND ONLY IF {something else}

  • 7/29/2019 A Proof Involving Graphs

    7/54

    7

    First glance at the problem

    The first thing to notice is that this problem fits a template:

    PROVE {Something} IF AND ONLY IF {something else}

    Usually the easiest way to prove such a problem is to show

    that both:

    {Something} implies {something else}

    And also

  • 7/29/2019 A Proof Involving Graphs

    8/54

    8

    First glance at the problem

    The first thing to notice is that this problem fits a template:

    PROVE {Something} IF AND ONLY IF {something else}

    Usually the easiest way to prove such a problem is to show

    that both:

    {Something} implies {something else}

    And also

    {Something else} implies {something}

    Recall that ( ) is the same as (( ) ( ))

    This approach works for all such proofs, not just graphs!

  • 7/29/2019 A Proof Involving Graphs

    9/54

    9

    Review Why Does This Template Work?

    Recall that ( ) is the same as (( ) ( ))

    If you dont recall this, how could you check?

  • 7/29/2019 A Proof Involving Graphs

    10/54

    10

    Review Why Does This Template Work?

    Recall that ( ) is the same as (( ) ( ))

    A truth table, of course!

    Notice the truth values are the same for both statements

    A B AB BA (AB) (BA) A B

    T T T TT T

    T F F T F F

    F T T F F F

    F F T T T T

  • 7/29/2019 A Proof Involving Graphs

    11/54

    11

    So what do we need to show here?

    Lets just use our template and plug in

    Who can finish this?

    1.

    2.

  • 7/29/2019 A Proof Involving Graphs

    12/54

    12

    So what do we need to show here?

    Lets just use our template and plug in

    Who can finish this?

    1. , ,

    2.

  • 7/29/2019 A Proof Involving Graphs

    13/54

    13

    So what do we need to show here?

    Lets just use our template and plug in

    Who can finish this?

    1. , ,

    2. , ,

  • 7/29/2019 A Proof Involving Graphs

    14/54

    14

    Great!

    We can now just prove each of these implications one-at-a-time

    Two smaller problems are usually easier to solve than one large one!

    But each of these two statements are still tricky

    Lets review a few graph concepts

  • 7/29/2019 A Proof Involving Graphs

    15/54

    15

    Graph Concepts

    A graph is a collection of ?

  • 7/29/2019 A Proof Involving Graphs

    16/54

    16

    Graph Concepts

    A graph is a collection ofvertices and ?

  • 7/29/2019 A Proof Involving Graphs

    17/54

    17

    Graph Concepts

    A graph is a collection of vertices and edges

  • 7/29/2019 A Proof Involving Graphs

    18/54

    18

    Graph Concepts

    In a connectedgraph, ?

  • 7/29/2019 A Proof Involving Graphs

    19/54

    19

    Graph Concepts

    In a connected graph, every vertex can be reached from

    every other one

  • 7/29/2019 A Proof Involving Graphs

    20/54

    20

    Graph Concepts

    A loop is ?

  • 7/29/2019 A Proof Involving Graphs

    21/54

    21

    Graph Concepts

    A loop is an edge from one vertex to itself

    Often we ignore loops for simplicity

  • 7/29/2019 A Proof Involving Graphs

    22/54

    22

    Walks

    Consider the types of walks we can have

    Name

    May have

    repeated

    vertices

    May have

    repeated

    edges

    Must start and

    end on same

    vertex

    Open Walk Yes Yes No

    Closed Walk Yes Yes Yes

    Trail (Open) Yes No No

    Circuit (Closed) Yes No Yes

    Path (Open) No No No

    Cycle (Closed) No No Yes

    This is table 11.1 from page 516

  • 7/29/2019 A Proof Involving Graphs

    23/54

    23

    Walks

    Consider the types of walks we can have

    Note that any cycle is also a circuit which is also a closedwalk, but not visa versa

    Name

    May have

    repeated

    vertices

    May have

    repeated

    edges

    Must start and

    end on same

    vertex

    Open Walk Yes Yes No

    Closed Walk Yes Yes Yes

    Trail (Open) Yes No No

    Circuit (Closed) Yes No Yes

    Path (Open) No No No

    Cycle (Closed) No No Yes

    This is table 11.1 from page 516

  • 7/29/2019 A Proof Involving Graphs

    24/54

    24

    Walks

    Likewise for open walks...

    Any path is also a trail which is also an open walk But an open walk is not necessarily also a trail

    Name

    May have

    repeated

    vertices

    May have

    repeated

    edges

    Must start and

    end on same

    vertex

    Open Walk Yes Yes No

    Closed Walk Yes Yes Yes

    Trail (Open) Yes No No

    Circuit (Closed) Yes No Yes

    Path (Open) No No No

    Cycle (Closed) No No Yes

    This is table 11.1 from page 516

  • 7/29/2019 A Proof Involving Graphs

    25/54

    25

    More on Walks

    More interestingly, note that we can turn any less specific

    walk into a shorter, more specific walk

  • 7/29/2019 A Proof Involving Graphs

    26/54

    26

    More on Walks

    More interestingly, note that we can turn any less specific

    walk into a shorter, more specific walk

    Consider the following closed walk (starting from vertexa)

  • 7/29/2019 A Proof Involving Graphs

    27/54

    27

    Walks

    How can we turn this closed walk into a circuit?

  • 7/29/2019 A Proof Involving Graphs

    28/54

    28

    Walks

    How can we turn this closed walk into a circuit?

    Lets just remove this part!

  • 7/29/2019 A Proof Involving Graphs

    29/54

    29

    Walks

    How can we turn this circuit into a cycle?

  • 7/29/2019 A Proof Involving Graphs

    30/54

    30

    Walks

    How can we turn this circuit into a cycle?

    Lets just remove this part!

    All of this also applies to undirected graphs the pointed arrows were simply shown for

    clarity

  • 7/29/2019 A Proof Involving Graphs

    31/54

    31

    Walks

    We are left with a cycle

    More importantly, now we have enough understanding to tackle our proof

  • 7/29/2019 A Proof Involving Graphs

    32/54

    32

    Um, what were we proving again?

    Recall we need to show the two statements below are true

    .

    ,

    ,

    . , ,

    U h i i ?

  • 7/29/2019 A Proof Involving Graphs

    33/54

    33

    Um, what were we proving again?

    Recall we need to show the two statements below are true

    .

    ,

    ,

    . , ,

    Personally, I find the second statement more intuitive

    So lets start by showing that one

    P i f h i li i

  • 7/29/2019 A Proof Involving Graphs

    34/54

    34

    Proving one of the implications

    , ,

    Consider the graph below

    P i f th i li ti

  • 7/29/2019 A Proof Involving Graphs

    35/54

    35

    Proving one of the implications

    , ,

    For now, simply consider {a,b} as a way to get from a to b

    P i f th i li ti

  • 7/29/2019 A Proof Involving Graphs

    36/54

    36

    Proving one of the implications

    , ,

    For now, simply consider {a,b} as a way to get from a to b

    Note that if {a,b} is part of a cycle then

    P i f th i li ti

  • 7/29/2019 A Proof Involving Graphs

    37/54

    37

    Proving one of the implications

    , ,

    For now, simply consider {a,b} as a way to get from a to b

    Note that if {a,b} is part of a cycle then there must also be another way toget from a to b!

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    38/54

    38

    Proving one of the implications

    , ,

    For now, simply consider {a,b} as a way to get from a to b

    Note that if {a,b} is part of a cycle then there must also be another way toget from a to b!

    All of this also applies to a way to get from b to a

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    39/54

    39

    Proving one of the implications

    , ,

    How does this notion relate to our implication above?

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    40/54

    40

    Proving one of the implications

    , ,

    A connected graph must have at least one path between all vertices

    Some of these paths might include {a,b}

    Such as the one below from I to C

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    41/54

    41

    Proving one of the implications

    , ,

    If we remove {a,b}, this path from I to C no longer exists

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    42/54

    42

    Proving one of the implications

    , ,

    If we remove {a,b}, this path from I to C no longer exists

    But since it is part of a cycle, we can always get from a to b a different way

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    43/54

    43

    Proving one of the implications

    , ,

    If we remove {a,b}, this path from I to C no longer exists

    But since it is part of a cycle, we can always get from a to b a different way

    Meaning there will still be a path from I to C!

    We just replace {a,b} in the original path with the remainder of the cycle

    Proving one of the implications

  • 7/29/2019 A Proof Involving Graphs

    44/54

    44

    Proving one of the implications

    , ,

    Thus the implication above is true

    Since any two vertices connected via a path that uses {a,b}

    Are also connected via another path that uses the remainder of the cycle

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    45/54

    45

    Now for the other implication

    , ,

    If removing {a,b} does not disconnect graph, what do we know about

    the relationship(s) between a and b?

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    46/54

    46

    Now for the other implication

    , ,

    If removing {a,b} does not disconnect graph, what do we know about

    the relationship(s) between a and b?

    There must be a path from a to b that does not include {a, b}

    Otherwise, our graph would be disconnected after removing {a, b}

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    47/54

    47

    Now for the other implication

    , ,

    So consider:

    1. A path from a to b that does not include {a, b}

    2. {a, b}

    What can we do with these?

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    48/54

    48

    Now o t e ot e p cat o

    , ,

    So consider:

    1. A path from a to b that does not include {a, b}

    2. {a, b}

    What can we do with these?

    Walk from a to b using 1

    Then walk from b to a using 2

    What is this called?

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    49/54

    49

    p

    , ,

    So consider:

    1. A path from a to b that does not include {a, b}

    2. {a, b}

    What can we do with these?

    Walk from a to b using 1

    Then walk from b to a using 2

    What is this called?

    A closed walk!

    And what can we form if we have a closed walk?

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    50/54

    50

    p

    , ,

    So consider:

    1. A path from a to b that does not include {a, b}

    2. {a, b}

    What can we do with these?

    Walk from a to b using 1

    Then walk from b to a using 2

    What is this called?

    A closed walk!

    A cycle (using the methodology shown earlier)

    Now for the other implication

  • 7/29/2019 A Proof Involving Graphs

    51/54

    51

    p

    , ,

    Thus if removing {a,b} does not disconnect the graph, then there must

    be some cycle that includes {a,b}

    Weve now shown both implications are true, and thus our original

    equivalence statement (aka if and only if) is true.

    That was really long!

  • 7/29/2019 A Proof Involving Graphs

    52/54

    52

    y g

    That was a very long proof

    But only because I broke it out into very gradual slides :)

    What would I expect in a homework?

    Consider the following slide, which contains an informal write-up:

    A Shorter Write-up

  • 7/29/2019 A Proof Involving Graphs

    53/54

    53

    p

    To prove this equivalence, we must first show that

    [{a,b} is part of a cycle] -> [removal of {a,b} does not disconnect graph]

    Note that a cycle on a through {a,b} can be divided into two parts:

    - {a,b}

    - and a path from a to b that does not contain {a,b}

    So any path connecting two vertices x and y that includes {a,b} can be replaced by another path that instead

    uses the other path from a to b that does not contain {a,b}

    Thus removing {a,b} does not disconnect the graph

    We must also show that

    [removal of {a,b} does not disconnect graph] -> [{a,b} is part of a cycle]

    Note that if the graph is still connected after removing {a,b} then we know that

    - There must be a path from b to a that does not contain {a,b}

    If we take this path starting at b and ending at a, and then travel along {a,b} to return to b, we have formed a

    closed path. We can always form a cycle from a closed path by eliminating redundant edges.

    QED

    Another approach

  • 7/29/2019 A Proof Involving Graphs

    54/54

    54

    The textbook answer key showed ! ! instead of

    This is equivalent, but a bit terse and confusing

    Nevertheless Id accept it Shown below for reference

    (Yuck)