lect20

lect20 - Graphs. A graph consists of vertices connected by...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Definition. A graph G =( V , E ) is an ordered pair of two sets V and E , where V is the (nonempty) set of vertices and E is the set of edges, each edge connects one vertex to the other (may be the same). E ={{ a , b }| a , b V }. Graphs. A graph consists of vertices connected by edges. 1 2 3 4 5 A graph having more then one edge between any two edges is called multigraph.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Sometimes, the edges of a graph have direction or orientation . Such directed edges are shown as arrows and the graph is then called a directed graph , or, a digraph . For directed graphs edges are ordered pairs, E ={( a , b )| a , b V }. 1) The results of a tournament of 6 teams can be represented as a digraph: vertices are teams and arrows represent the outcomes of the games. 1 is a a winner. 1 2 3 4 5 6 Examples
Background image of page 2
3 2) The dependency graph for computer programs. S 1 : a:=0 S 2 : b:=1 S 3 : c:=a+1 S 4 : d:=b+1 S 5 : e:=d+1 S 6 : e:=c+d S 1 S 2 S 3 S 6 S 4 S 5 3) The flow graph (flow of control) of the computer program (a digraph).
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Definition. Two vertices u and v in an undirected graph G=( V , E ) are called adjacent if e ={ u , v } E Edge e is called incident with the vertices u and v , or u and v are endpoints of e . Definition. The number of times a vertex u is used as an endpoint of an edge is called the degree of u , deg ( u ). A self-loop contributes twice to the degree of the vertex.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

lect20 - Graphs. A graph consists of vertices connected by...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online