1
Kenneth H. Rosen
Chapter 7
Graphs
Discrete Mathematics and It
s Applications
2
Definition 1. A simple graph G = (V, E) consi
sts of V, a nonempty set of vertices, and
E, a set of unordered pairs of distinct ele
ments of V called edges.
Simple Graph
3
A simple graph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
How many vertices? How many edges?
4
A simple graph
V = { Chicago, Denver, Detroit, Los Angeles,
New York, San Francisco, Washington }
SET OF VERTICES
E = { {San Francisco, Los Angeles}, {San Francisco, Denver},
{Los Angeles, Denver}, {Denver, Chicago},
{Chicago, Detroit}, {Detroit, New York},
{New York, Washington}, {Chicago, Washington},
{Chicago, New York} }
SET OF EDGES
5
A simple graph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
The network is made up of computers and telephone lines
between computers. There is at most 1 telephone line
between 2 computers in the network. Each line operates
in both directions. No computer has a telephone line to itself.
These are undirected edges,
each of which connects two distinct vertices, and
no two edges connect the same pair of vertices.
6
Definition 2. In a multigraph G = (V, E) tw
o or more edges may connect the same
pair of vertices.
A Non-Simple Graph
7
A Multigraph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
THERE CAN BE MULTIPLE TELEPHONE LINES
BETWEEN TWO COMPUTERS IN THE NETWORK.
8
Multiple Edges
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
Two edges are called multiple or parallel edges
if they connect the same two distinct vertices.
9
Definition 3. In a pseudograph G = (V, E) t
wo or more edges may connect the sa
me pair of vertices, and in addition, an
edge may connect a vertex to itself.
Another Non-Simple Graph
10
A Pseudograph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
THERE CAN BE TELEPHONE LINES IN THE NETWORK
FROM A COMPUTER TO ITSELF (for diagnostic use).
11
Loops
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
An edge is called a loop
if it connects a vertex to itself.
12
Undirected Graphs
pseudographs
simple graphs
multigraphs
13
Definition 4. In a directed graph G = (V, E)
the edges are ordered pairs of (not nec
essarily distinct) vertices.
A Directed Graph
14
A Directed Graph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
SOME TELEPHONE LINES IN THE NETWORK
MAY OPERATE IN ONLY ONE DIRECTION .
Those that operate in two directions are represented
by pairs of edges in opposite directions.
15
Definition 5. In a directed multigraph G = (V, E)
the edges are ordered pairs of (not necessari
ly distinct) vertices, and in addition there ma
y be multiple edges.
A Directed Multigraph
16
A Directed Multigraph
San Francisco
Denver
Los Angeles
New York
Chicago
Washington
Detroit
THERE MAY BE SEVERAL ONE-WAY LINES
IN THE SAME DIRECTION FROM ONE COMPUTER
TO ANOTHER IN THE NETWORK.
17
Types of Graphs
TYPE EDGES MULTIPLE EDGES LOOPS
ALLOWED? ALLOWED?
Simple graph Undirected NO NO
Multigraph Undirected YES NO
Pseudograph Undirected YES YES
Directed graph Directed NO YES
Directed multigraph Directed YES YES
18
Definition 1. Two vertices, u and v in an undirected gr
aph G are called adjacent (or neighbors) in G, if {u,
v} is an edge of G.
An edge e connecting u and v is called incident with v
ertices u and v, or is said to connect u and v. The v
ertices u and v are called endpoints of edge {u, v}.
Adjacent Vertices (Neighbors)
19
a
Degree of a vertex
Definition 1. The degree of a vertex in an undirecte
d graph is the number of edges incident with it, e
xcept that a loop at a vertex contributes twice to
the degree of that vertex.
b
g f e
c d
deg( d ) = 1
20
a
Degree of a vertex
Definition 1. The degree of a vertex in an undirecte
d graph is the number of edges incident with it, e
xcept that a loop at a vertex contributes twice to
the degree of that vertex.
b
g f e
c d
deg( e ) = 0
21
a
deg( b ) = 6
Degree of a vertex
Definition 1. The degree of a vertex in an undirecte
d graph is the number of edges incident with it, e
xcept that a loop at a vertex contributes twice to
the degree of that vertex.
b
g f e
c d
22
a
deg( b ) = 6
Degree of a vertex
Find the degree of all the other vertices.
deg( a ) deg( c ) deg( f ) deg( g )
b
g f e
c d
deg( d ) = 1
deg( e ) = 0
23
a
deg( b ) = 6
Degree of a vertex
Find the degree of all the other vertices.
deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4
b
g f e
c d
deg( d ) = 1
deg( e ) = 0
24
a
deg( b ) = 6
Degree of a vertex
Find the degree of all the other vertices.
deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4
TOTAL of degrees = 2 + 4 + 3 + 4 + 6 + 1 + 0 = 20
b
g f e
c d
deg( d ) = 1
deg( e ) = 0
25
a
deg( b ) = 6
Degree of a vertex
Find the degree of all the other vertices.
deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4
TOTAL of degrees = 2 + 4 + 3 + 4 + 6 + 1 + 0 = 20
TOTAL NUMBER OF EDGES = 10
b
g f e
c d
deg( d ) = 1
deg( e ) = 0
26
Theorem 1. Let G = (V, E) be an undirected
graph G with e edges. Then
 deg( v ) = 2 e
v  V
“The sum of the degrees over all the vertices equa
ls twice the number of edges.”
NOTE: This applies even if multiple edges and loops are pre
sent.
Handshaking Theorem
27
Definition 6. A subgraph of a graph
G = (V, E) is a graph H = (W, F) wher
e W  V and F  E.
Subgraph
28
C5 is a subgraph of K5
C5
K5
29
Definition 7. The union of 2 simple graphs G
1 = ( V1 , E1 ) and G2 = ( V2 , E2 ) is the simpl
e graph with vertex set V = V1  V2 and edg
e set E = E1  E2 . The union is denoted by
G1  G2 .
Union
30
W5 is the union of S5 and C5
C5
W5
S5
a
b
c
e
d
a
c
e
a
b
c
e
d
a
b
c
e
d
f
f
31
p. 443 # 1 a, 2 a.
p. 454 # 1-5, 12 adef, 19 abce, 44.
Homework
32
A simple graph G = (V, E) with n vertices
can be represented by its adjacency matrix,
A, where entry aij in row i and column j is
1 if { vi, vj } is an edge in G,
aij =
0 otherwise.
Adjacency Matrix
33
Finding the adjacency matrix
This graph has 6 vertices
a, b, c, d, e, f. We can
arrange them in that order.
d
W5
a
b
c
e
a
c
e
f
34
Finding the adjacency matrix
a b c d e f
d
a 0 1 0 0 1 1
b
c
d
e
f
FROM
TO
There are edges from a to b, from a to e, and from a to f
W5
a
b
c
e
a
c
e
f
35
Finding the adjacency matrix
a b c d e f
d
a 0 1 0 0 1 1
b 1 0 1 0 0 1
c
d
e
f
FROM
TO
There are edges from b to a, from b to c, and from b to f
W5
a
b
c
e
a
c
e
f
36
Finding the adjacency matrix
a b c d e f
d
a 0 1 0 0 1 1
b 1 0 1 0 0 1
c 0 1 0 1 0 1
d
e
f
FROM
TO
There are edges from c to b, from c to d, and from c to f
W5
a
b
c
e
a
c
e
f
37
Finding the adjacency matrix
a b c d e f
a 0 1 0 0 1 1
b 1 0 1 0 0 1
c 0 1 0 1 0 1
d
e
f
FROM
TO
COMPLETE THE ADJACENCY MATRIX . . .
d
W5
a
b
c
e
a
c
e
f
38
Finding the adjacency matrix
a b c d e f
d
a 0 1 0 0 1 1
b 1 0 1 0 0 1
c 0 1 0 1 0 1
d 0 0 1 0 1 1
e 1 0 0 1 0 1
f 1 1 1 1 1 0
FROM
TO
Notice that this matrix is symmetric. That is aij = aji Why?
W5
a
b
c
e
a
c
e
f
39
Definition 1. A path of length n from u to v in an
undirected graph is a sequence of edges
e1, e2, . . ., en of the graph such that
edge e1 has endpoints xo and x1 ,
edge e2 has endpoints x1 and x2 ,
. . .
and edge en has endpoints xn-1 and xn ,
where x0 = u and xn = v.
Path of Length n
40
One path from a to e
This path passes through ve
rtices f and d in that order.
d
W5
a
b
c
e
a
c
f
e
41
One path from a to a
This path passes through verti
ces f, d, e, in that order. It ha
s length 4.
It is a circuit because it begins
and ends at the same vertex.
It is called simple because it d
oes not contain the same edge
more than once.
d
W5
a
b
c
e
a
c
f
e
42
Definition 3. An undirected graph is called connect
ed if there is a path between every pair of distinc
t vertices of the graph.
IS THIS GRAPH CONNECTED?
Path of Length n
W5
a
b
c
e
a
c
e
f
43
Theorem 1. There is a simple path between ev
ery pair of distinct vertices of a connected u
ndirected graph.
Theorem 1
44
Theorem 2. Let G be a graph with adjacency m
atrix A with respect to the ordering v1
, v2 , . . . , vn . The number of different paths
of length r from vi to vj , where r is a posti
ve integer, equals the entry in row i and col
umn j of Ar.
NOTE: This applies with directed or undirected edges,
with multiple edges and loops allowed.
Paths of Length r
between Vertices

More Related Content

PPT
UNIT III discrete mathematice notes availiable
PPT
graph ASS (1).ppt
PDF
Cs6702 graph theory and applications 2 marks questions and answers
PPT
graphass1-23022111180722548-1ba6b00a.ppt
PPT
Graphs in data structures
PPTX
Graph ASS DBATU.pptx
PDF
Graphs.pdf
UNIT III discrete mathematice notes availiable
graph ASS (1).ppt
Cs6702 graph theory and applications 2 marks questions and answers
graphass1-23022111180722548-1ba6b00a.ppt
Graphs in data structures
Graph ASS DBATU.pptx
Graphs.pdf

Similar to graph.pptx (20)

PPT
Graph theory
PPTX
Unit 2: All
PPT
Data Structures-Non Linear DataStructures-Graphs
PPT
Graphs
PPTX
Tree introduction and Applications Lecture # 22.pptx
PPTX
1. Graph and Graph Terminologiesimp.pptx
PDF
Cs6702 GCC
PDF
Cs6702 2marks rejinpaul
PPTX
Data Structures and Agorithm: DS 21 Graph Theory.pptx
PPT
Graph theory concepts complex networks presents-rouhollah nabati
PPTX
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
PPTX
Elements of Graph Theory for IS.pptx
PPTX
Graph Representation, DFS and BFS Presentation.pptx
PDF
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
PPTX
Graph Theory
PPTX
GRAPH THEORY - Basic definition with examples
PPTX
Ppt of graph theory
PPT
Graph Introduction.ppt
PPTX
Graph therory
PPT
Lecture 5b graphs and hashing
Graph theory
Unit 2: All
Data Structures-Non Linear DataStructures-Graphs
Graphs
Tree introduction and Applications Lecture # 22.pptx
1. Graph and Graph Terminologiesimp.pptx
Cs6702 GCC
Cs6702 2marks rejinpaul
Data Structures and Agorithm: DS 21 Graph Theory.pptx
Graph theory concepts complex networks presents-rouhollah nabati
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Elements of Graph Theory for IS.pptx
Graph Representation, DFS and BFS Presentation.pptx
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
Graph Theory
GRAPH THEORY - Basic definition with examples
Ppt of graph theory
Graph Introduction.ppt
Graph therory
Lecture 5b graphs and hashing
Ad

Recently uploaded (20)

PDF
advance database management system book.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PDF
International_Financial_Reporting_Standa.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PPTX
Module on health assessment of CHN. pptx
PDF
Hazard Identification & Risk Assessment .pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
My India Quiz Book_20210205121199924.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
advance database management system book.pdf
Computer Architecture Input Output Memory.pptx
International_Financial_Reporting_Standa.pdf
What’s under the hood: Parsing standardized learning content for AI
Cambridge-Practice-Tests-for-IELTS-12.docx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
Module on health assessment of CHN. pptx
Hazard Identification & Risk Assessment .pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Journal of Dental Science - UDMY (2021).pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Uderstanding digital marketing and marketing stratergie for engaging the digi...
What if we spent less time fighting change, and more time building what’s rig...
AI-driven educational solutions for real-life interventions in the Philippine...
Unit 4 Computer Architecture Multicore Processor.pptx
My India Quiz Book_20210205121199924.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Ad

graph.pptx

  • 1. 1 Kenneth H. Rosen Chapter 7 Graphs Discrete Mathematics and It s Applications
  • 2. 2 Definition 1. A simple graph G = (V, E) consi sts of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct ele ments of V called edges. Simple Graph
  • 3. 3 A simple graph San Francisco Denver Los Angeles New York Chicago Washington Detroit How many vertices? How many edges?
  • 4. 4 A simple graph V = { Chicago, Denver, Detroit, Los Angeles, New York, San Francisco, Washington } SET OF VERTICES E = { {San Francisco, Los Angeles}, {San Francisco, Denver}, {Los Angeles, Denver}, {Denver, Chicago}, {Chicago, Detroit}, {Detroit, New York}, {New York, Washington}, {Chicago, Washington}, {Chicago, New York} } SET OF EDGES
  • 5. 5 A simple graph San Francisco Denver Los Angeles New York Chicago Washington Detroit The network is made up of computers and telephone lines between computers. There is at most 1 telephone line between 2 computers in the network. Each line operates in both directions. No computer has a telephone line to itself. These are undirected edges, each of which connects two distinct vertices, and no two edges connect the same pair of vertices.
  • 6. 6 Definition 2. In a multigraph G = (V, E) tw o or more edges may connect the same pair of vertices. A Non-Simple Graph
  • 7. 7 A Multigraph San Francisco Denver Los Angeles New York Chicago Washington Detroit THERE CAN BE MULTIPLE TELEPHONE LINES BETWEEN TWO COMPUTERS IN THE NETWORK.
  • 8. 8 Multiple Edges San Francisco Denver Los Angeles New York Chicago Washington Detroit Two edges are called multiple or parallel edges if they connect the same two distinct vertices.
  • 9. 9 Definition 3. In a pseudograph G = (V, E) t wo or more edges may connect the sa me pair of vertices, and in addition, an edge may connect a vertex to itself. Another Non-Simple Graph
  • 10. 10 A Pseudograph San Francisco Denver Los Angeles New York Chicago Washington Detroit THERE CAN BE TELEPHONE LINES IN THE NETWORK FROM A COMPUTER TO ITSELF (for diagnostic use).
  • 11. 11 Loops San Francisco Denver Los Angeles New York Chicago Washington Detroit An edge is called a loop if it connects a vertex to itself.
  • 13. 13 Definition 4. In a directed graph G = (V, E) the edges are ordered pairs of (not nec essarily distinct) vertices. A Directed Graph
  • 14. 14 A Directed Graph San Francisco Denver Los Angeles New York Chicago Washington Detroit SOME TELEPHONE LINES IN THE NETWORK MAY OPERATE IN ONLY ONE DIRECTION . Those that operate in two directions are represented by pairs of edges in opposite directions.
  • 15. 15 Definition 5. In a directed multigraph G = (V, E) the edges are ordered pairs of (not necessari ly distinct) vertices, and in addition there ma y be multiple edges. A Directed Multigraph
  • 16. 16 A Directed Multigraph San Francisco Denver Los Angeles New York Chicago Washington Detroit THERE MAY BE SEVERAL ONE-WAY LINES IN THE SAME DIRECTION FROM ONE COMPUTER TO ANOTHER IN THE NETWORK.
  • 17. 17 Types of Graphs TYPE EDGES MULTIPLE EDGES LOOPS ALLOWED? ALLOWED? Simple graph Undirected NO NO Multigraph Undirected YES NO Pseudograph Undirected YES YES Directed graph Directed NO YES Directed multigraph Directed YES YES
  • 18. 18 Definition 1. Two vertices, u and v in an undirected gr aph G are called adjacent (or neighbors) in G, if {u, v} is an edge of G. An edge e connecting u and v is called incident with v ertices u and v, or is said to connect u and v. The v ertices u and v are called endpoints of edge {u, v}. Adjacent Vertices (Neighbors)
  • 19. 19 a Degree of a vertex Definition 1. The degree of a vertex in an undirecte d graph is the number of edges incident with it, e xcept that a loop at a vertex contributes twice to the degree of that vertex. b g f e c d deg( d ) = 1
  • 20. 20 a Degree of a vertex Definition 1. The degree of a vertex in an undirecte d graph is the number of edges incident with it, e xcept that a loop at a vertex contributes twice to the degree of that vertex. b g f e c d deg( e ) = 0
  • 21. 21 a deg( b ) = 6 Degree of a vertex Definition 1. The degree of a vertex in an undirecte d graph is the number of edges incident with it, e xcept that a loop at a vertex contributes twice to the degree of that vertex. b g f e c d
  • 22. 22 a deg( b ) = 6 Degree of a vertex Find the degree of all the other vertices. deg( a ) deg( c ) deg( f ) deg( g ) b g f e c d deg( d ) = 1 deg( e ) = 0
  • 23. 23 a deg( b ) = 6 Degree of a vertex Find the degree of all the other vertices. deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4 b g f e c d deg( d ) = 1 deg( e ) = 0
  • 24. 24 a deg( b ) = 6 Degree of a vertex Find the degree of all the other vertices. deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4 TOTAL of degrees = 2 + 4 + 3 + 4 + 6 + 1 + 0 = 20 b g f e c d deg( d ) = 1 deg( e ) = 0
  • 25. 25 a deg( b ) = 6 Degree of a vertex Find the degree of all the other vertices. deg( a ) = 2 deg( c ) = 4 deg( f ) = 3 deg( g ) = 4 TOTAL of degrees = 2 + 4 + 3 + 4 + 6 + 1 + 0 = 20 TOTAL NUMBER OF EDGES = 10 b g f e c d deg( d ) = 1 deg( e ) = 0
  • 26. 26 Theorem 1. Let G = (V, E) be an undirected graph G with e edges. Then  deg( v ) = 2 e v  V “The sum of the degrees over all the vertices equa ls twice the number of edges.” NOTE: This applies even if multiple edges and loops are pre sent. Handshaking Theorem
  • 27. 27 Definition 6. A subgraph of a graph G = (V, E) is a graph H = (W, F) wher e W  V and F  E. Subgraph
  • 28. 28 C5 is a subgraph of K5 C5 K5
  • 29. 29 Definition 7. The union of 2 simple graphs G 1 = ( V1 , E1 ) and G2 = ( V2 , E2 ) is the simpl e graph with vertex set V = V1  V2 and edg e set E = E1  E2 . The union is denoted by G1  G2 . Union
  • 30. 30 W5 is the union of S5 and C5 C5 W5 S5 a b c e d a c e a b c e d a b c e d f f
  • 31. 31 p. 443 # 1 a, 2 a. p. 454 # 1-5, 12 adef, 19 abce, 44. Homework
  • 32. 32 A simple graph G = (V, E) with n vertices can be represented by its adjacency matrix, A, where entry aij in row i and column j is 1 if { vi, vj } is an edge in G, aij = 0 otherwise. Adjacency Matrix
  • 33. 33 Finding the adjacency matrix This graph has 6 vertices a, b, c, d, e, f. We can arrange them in that order. d W5 a b c e a c e f
  • 34. 34 Finding the adjacency matrix a b c d e f d a 0 1 0 0 1 1 b c d e f FROM TO There are edges from a to b, from a to e, and from a to f W5 a b c e a c e f
  • 35. 35 Finding the adjacency matrix a b c d e f d a 0 1 0 0 1 1 b 1 0 1 0 0 1 c d e f FROM TO There are edges from b to a, from b to c, and from b to f W5 a b c e a c e f
  • 36. 36 Finding the adjacency matrix a b c d e f d a 0 1 0 0 1 1 b 1 0 1 0 0 1 c 0 1 0 1 0 1 d e f FROM TO There are edges from c to b, from c to d, and from c to f W5 a b c e a c e f
  • 37. 37 Finding the adjacency matrix a b c d e f a 0 1 0 0 1 1 b 1 0 1 0 0 1 c 0 1 0 1 0 1 d e f FROM TO COMPLETE THE ADJACENCY MATRIX . . . d W5 a b c e a c e f
  • 38. 38 Finding the adjacency matrix a b c d e f d a 0 1 0 0 1 1 b 1 0 1 0 0 1 c 0 1 0 1 0 1 d 0 0 1 0 1 1 e 1 0 0 1 0 1 f 1 1 1 1 1 0 FROM TO Notice that this matrix is symmetric. That is aij = aji Why? W5 a b c e a c e f
  • 39. 39 Definition 1. A path of length n from u to v in an undirected graph is a sequence of edges e1, e2, . . ., en of the graph such that edge e1 has endpoints xo and x1 , edge e2 has endpoints x1 and x2 , . . . and edge en has endpoints xn-1 and xn , where x0 = u and xn = v. Path of Length n
  • 40. 40 One path from a to e This path passes through ve rtices f and d in that order. d W5 a b c e a c f e
  • 41. 41 One path from a to a This path passes through verti ces f, d, e, in that order. It ha s length 4. It is a circuit because it begins and ends at the same vertex. It is called simple because it d oes not contain the same edge more than once. d W5 a b c e a c f e
  • 42. 42 Definition 3. An undirected graph is called connect ed if there is a path between every pair of distinc t vertices of the graph. IS THIS GRAPH CONNECTED? Path of Length n W5 a b c e a c e f
  • 43. 43 Theorem 1. There is a simple path between ev ery pair of distinct vertices of a connected u ndirected graph. Theorem 1
  • 44. 44 Theorem 2. Let G be a graph with adjacency m atrix A with respect to the ordering v1 , v2 , . . . , vn . The number of different paths of length r from vi to vj , where r is a posti ve integer, equals the entry in row i and col umn j of Ar. NOTE: This applies with directed or undirected edges, with multiple edges and loops allowed. Paths of Length r between Vertices