13-05-digraphs

download 13-05-digraphs

of 5

Transcript of 13-05-digraphs

  • 7/25/2019 13-05-digraphs

    1/5

    DigraphsDiscrete Math Section 13.5

    I. Intro to Digraphs

    We now turn our focus to directed graphs, or graphs where all edges have directions associated with them. Because we

    mathematicians are la!, we usuall! "ust call these digraphs.

    Digraph terminology:#etD$e a digraph. %hen&

    %he edges ofDare called arcs.

    %he verte' where an arc starts is called its initial point.

    %he verte' where an arc ends is called its terminal point.

    %he graph formed $! disregarding the directions on the edges ofDis called the underlying graphofD.

    Example 1

    (onsider the digraph shown here.

    a. )ive the initial and terminal points of each arc.

    arc initial point terminal point

    $. Draw the underl!ing graph.

    Example 2

    Draw the digraph with following specifications*

    arc initial point terminal point

    e1 v1 v+e+ v3 v+

    e3 v3 ve v v1e5 v+ ve- v v+e v3 v3

  • 7/25/2019 13-05-digraphs

    2/5

    II. Indegree and Outdegree

    We have the notion of degree for general graphs. When we have directed graphs, it is often useful to $rea/ up the degree

    $ased on whether arcs are coming into a node or out of a node. We define two new 0uantities*

    Definition

    #et v$e a verte' in directed graphD. %hen

    Define the indegree of vto $e the num$er of arcs whose terminal point is v. 2otation* indeg(v)

    Define the outdegree of vto $e the num$er of arcs whose initial point is v. 2otation* outdeg(v)

    Example 3

    (onsider the digraph shown. 4ind the indegree and outdegree of each verte'.

    ro!lem

    eturn to e'ample +. 4ind the indegree and outdegree for each verte' of the graph from 6'ample +.

    III. "al#s and $onnectedness in Digraphs

    We can also e'tend our definitions from the section on wal/s to digraphs. We $egin $! loo/ing at directed paths.

    Definition#etD$e a digraph. 7 directed pathinDis a se0uence of vertices and edges s.t. the terminal point of one arc is the initial

    point of the ne't.

    Definition

    #etD$e a digraph and let v, wV8D9. :f there e'ists a directed path from vto winD, then we sa! wis reacha!lefrom v.

    Example %

    (onsider the digraph shown to the right.

    a. 4ind three distinct directed paths from v1to v5.

    $. :s v1reacha$le from v; :s v1reacha$le from v5;

    c. :s v3reacha$le from v1;

  • 7/25/2019 13-05-digraphs

    3/5

    Definition

    #etD$e a digraph.

    :f ever! verte' ofDis reacha$le from an! other verte' inD, then we callDstrongly connected.

    :f the underl!ing graph ofDis connected, then we sa!Dis &ea#ly connected.

    2ote that we do not call a graph $oth strongl! connected and wea/l! connected. Strongl! connected

  • 7/25/2019 13-05-digraphs

    4/5

    Example

    =erform a depthfirst search on the graph shown $elow.

    . Orienta!le /raphs

    0uestion:Suppose we have a graph that represents a networ/ of streets in a town where vertices represent intersection and

    edges represent streets. (an we ma/e all the streets onewa! streets and still have a strongl! connected graph;

    %o answer this 0uestion, we consider the orientation of a graph.

    Definition

    #et G$e a graph. :f ever! edge in Gcan $e given a direction such that the result is a strongl! connected digraph, then Gis

    said to $e orienta!le.

    Definition

    Suppose Gis a connected graph. 7n edge of Gwhose removal results in a disconnected graph is called a !ridge.

    %hen we assert the following theorem*

    +heorem

    7 graph Gis orienta$le iff it is connected and has no $ridges.

    We have an algorithm for producing an orientation for an orienta$le graph*

    lgorithm for Orienting a /raph

    Input* orienta$le graph G

    Procedure*

    1. =erform a depthfirst search on G. C$tain a spanning tree T.

    +. 7ssign directions to the edges of Tas follows* 6ach edge is directed from vertices of lower to higher depthfirst

    num$er.3. 7ssign directions to all edges of Gthat are not in Tas follows* 6ach edge is directed from vertices of higher to lower

    depthfirst num$er.

    Output: an orientation for G

  • 7/25/2019 13-05-digraphs

    5/5