Lecture-35 Teacher
Lecture-35 Teacher
Graphs
Chapter Summary
Introduction to Graphs
Graph Taxonomy
Graph Models
Graphs
Definition:
– A graph G = (V, E) consists of a nonempty set V of vertices (or nodes) and a set E
of edges.
– Each edge has either one or two vertices associated with it, called its endpoints.
– An edge is said to connect its endpoints.
a b
Example: This is a graph with four vertices and five edges.
d c
Remarks:
– The graphs we study here are unrelated to graphs of functions studied in Chapter 2.
– We have a lot of freedom when we draw a picture of a graph. All that matters is the connections
made by the edges, not the particular geometry depicted. For example, the lengths of edges,
whether edges cross, how vertices are depicted, and so on, do not matter
– A graph with an infinite vertex set is called an infinite graph. A graph with a finite vertex set is
called a finite graph. We (following the text) restrict our attention to finite graphs.
Some Terminology
a b
c
Remark: There is no standard terminology for graph theory. So, it is crucial that you
understand the terminology being used whenever you read material about graphs.
Directed Graphs
Definition:
– An directed graph (or digraph) G = (V, E) consists of a nonempty set V of
vertices (or nodes) and a set E of directed edges (or arcs).
– Each edge is associated with an ordered pair of vertices.
– The directed edge associated with the ordered pair (u,v) is said to start at u
and end at v.
Remark:
– Graphs where the end points of an edge are not ordered are said to
be undirected graphs.
Some Terminology
a b
c
Some Terminology
a b
c
Graph Models: Computer
Networks
We illustrate this process using graph models of different types of
computer networks.
In all these graph models,
– the vertices represent data centers and
– the edges represent communication links.
– all communications links work in both directions.
Simple graph
Graph Models: Computer
Networks
• To model a computer network where
we care about the number of links
between data centers, we use a
multigraph.
Call Graphs
• Graphs can be used to model telephone calls made in a network,
such as a long distance telephone network.
Graph Models: Information Networks
In a citation network:
– Research papers in a particular discipline are represented by
vertices.
– When a paper cites a second paper as a reference, there is an
edge from the vertex representing this paper to the vertex
representing the second paper.
Graph Models: Software Design Applications
Round-Robin Tournaments ,
– Such tournaments can be modeled using directed graphs
where each team is represented by a vertex.
– Note that (a, b) is an edge if team a beats team b.
Graph Models: Tournaments
Single-Elimination Tournaments,
– A tournament where each contestant is eliminated after one
loss is called a single-elimination tournament.
Query???
1 2 3 4.... xy ( x y ) ?
1
x 1 x ? x 1
?
x
x ( | x ) ? xy ( x y ) ?
1
1 2 3 4.... ?
1 1 1 1 1......... ?
x 1
x
?