Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphs: An Introduction

Similar presentations


Presentation on theme: "Graphs: An Introduction"— Presentation transcript:

1 Graphs: An Introduction
Lecture 51 Section 11.1 Mon, Apr 24, 2006

2 Graphs Graphs are used to represent relations between objects.
Friendship between individuals. Computers connected on a network. Divisibility relation between integers. The relation may be quantifiable. Cities connected by highways (distance).

3 Vertices and Edges A graph is consists of a finite set of vertices and a finite set of edges. The vertices and are represented as dots, representing the objects. The edges and the lines connecting the vertices, representing the relations. If G is a graph, then V(G) is the set of vertices and E(G) is the set of edges.

4 Example The vertices are students.
The edges represent pairs of students who have a class together. John Joe Bill Jim Mike Tom

5 E(G) = {{v1, v2}, {v1, v3}, {v2, v4}, {v2, v5}}.
Example Let G be a graph with 5 vertices, labeled v1, v2, v3, v4, and v5. V(G) = {v1, v2, v3, v4, v5}. Each edge is represented as a set of two vertices. For example, E(G) = {{v1, v2}, {v1, v3}, {v2, v4}, {v2, v5}}.

6 Example The earlier example would be represented as G = (V(G), E(G)),
where V(G) = {Joe, John, Bill, Jim, Tom, Mike}, E(G) = {{Joe, John}, {Joe, Jim}, {Joe, Tom}, {John, Bill}, {John, Jim}}.

7 Loops and Parallel Edges
A loop is an edge with the same vertex for both endpoints. e = {v, v}. Two edges are parallel if they have the same pair of endpoints. e1 = {v1, v2}, e2 = {v1, v2}.

8 Special Graphs A simple graph is a graph with no loops or parallel edges. A complete graph is a simple graph that contains every possible edge.

9 Special Graphs If a complete graph has n vertices, then how many edges does it have? Can a complete graph have a noncomplete subgraph? Can a noncomplete graph has a complete subgraph?

10 Special Graphs A graph is bipartite if its vertices may be partitioned into two subsets V1 and V2 such that every edge in the graph has one endpoint in V1 and the other in V2. A graph is a complete bipartite graph is it contains all possible edges between vertices in V1 and V2.

11 Special Graphs If a complete bipartite graph has 5 vertices in one set and 8 vertices in the other set, then what how many edges does it have? If it has m vertices in one set and n vertices in the other set, then how many edges does it have?

12 Degree The degree of a vertex is the number of edges that are incident to the vertex. Loops are counted double. The total degree of a graph is the sum of the degrees of all its vertices. If a graph G has |E(G)| edges, then what is its total degree?

13 Directed Graphs A directed graph is like a graph, except that each edge has a direction from one endpoint to the other. A directed graph is also called a digraph. In a directed graph, each edge is represented by an ordered pair of vertices. e = (v1, v2).

14 The Divisibility Relation
In this example, a directed edge from v1 to v2 means that v1 divides v2. 12 6 4 2 3 1

15 Indegree and Outdegree
In a directed graph, The outdegree of a vertex is the number of edges that “originate” at that vertex. The indegree of a vertex is the number of edges that “terminate” at that vertex.

16 Indegree and Outdegree
Clearly, degree(v) = indegree(v) + outdegree(v) and total degree(G) = total indegree(G) + total outdegree(G).


Download ppt "Graphs: An Introduction"

Similar presentations


Ads by Google