This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 6 mcsftl 2010/9/8 0:40 page 189 #195 Directed Graphs 6.1 Definitions So far, we have been working with graphs with undirected edges. A directed edge is an edge where the endpoints are distinguishedone is the head and one is the tail . In particular, a directed edge is specified as an ordered pair of vertices u , v and is denoted by .u;v/ or u ! v . In this case, u is the tail of the edge and v is the head . For example, see Figure 6.1 . A graph with directed edges is called a directed graph or digraph . Definition 6.1.1. A directed graph G D .V;E/ consists of a nonempty set of nodes V and a set of directed edges E . Each edge e of E is specified by an ordered pair of vertices u;v 2 V . A directed graph is simple if it has no loops (that is, edges of the form u ! u ) and no multiple edges. Since we will focus on the case of simple directed graphs in this chapter, we will generally omit the word simple when referring to them. Note that such a graph can contain an edge u ! v as well as the edge v ! u since these are different edges (for example, they have a different tail). Directed graphs arise in applications where the relationship represented by an edge is 1way or asymmetric. Examples include: a 1way street, one person likes another but the feeling is not necessarily reciprocated, a communication channel such as a cable modem that has more capacity for downloading than uploading, one entity is larger than another, and one job needs to be completed before another job can begin. Well see several such examples in this chapter and also in Chapter 7 . Most all of the definitions for undirected graphs from Chapter 5 carry over in a natural way for directed graphs. For example, two directed graphs G 1 D .V 1 ;E 1 / and G 2 D .V 2 ;E 2 / are isomorphic if there exists a bijection f W V 1 ! V 2 such that for every pair of vertices u;v 2 V 1 , u ! v 2 E 1 IFF f.u/ ! f.v/ 2 E 2 : u v e head tail Figure 6.1 A directed edge e D .u;v/ . u is the tail of e and v is the head of e . 190 mcsftl 2010/9/8 0:40 page 190 #196 Chapter 6 Directed Graphs a c b d Figure 6.2 A 4node directed graph with 6 edges. Directed graphs have adjacency matrices just like undirected graphs. In the case of a directed graph G D .V;E/ , the adjacency matrix A G D f a ij g is defined so that ( 1 if i ! j 2 E a ij D otherwise. The only difference is that the adjacency matrix for a directed graph is not neces sarily symmetric (that is, it may be that A T A G ). G 6.1.1 Degrees With directed graphs, the notion of degree splits into indegree and outdegree . For example, indegree .c/ D 2 and outdegree .c/ D 1 for the graph in Figure 6.2 . If a node has outdegree 0, it is called a sink ; if it has indegree 0, it is called a source ....
View Full
Document
 Fall '10
 TomLeighton,Dr.MartenvanDijk
 Computer Science

Click to edit the document details