[PDF] [PDF] notes by Gregg Musiker on the undirected-graph case - Math 4707

We define the adjacency matrix A(G) of a graph G, with V (G) = n, to be the n-by- n denote the entry in the ith row and jth column of the kth power of A(G), we



Previous PDF Next PDF





[PDF] Trace of Positive Integer Power of Adjacency Matrix - Research India

Keywords: Adjacency matrix, Complete Graph, Trace, Matrix multiplication, Matrix power INTRODUCTION Traces of powers of matrices arise in several fields of 



[PDF] powers of an adjacency matrix

MATLAB Project: The Adjacency Matrix of a Graph Name Purpose: To learn about graph and adjacency matrix, to see how the powers of the adjacency matrix 



[PDF] Powers of the Adjacency Matrix and the Walk - Semantic Scholar

and the Walk Matrix Andrew Duncan 4 Introduction The aim of this article is to identify and prove various relations between powers of adjacency matric:es of 



A Fast Algorithm to Calculate Powers of a Boolean Matrix for

If A is the adjacency matrix of a random graph G(n,p), the entries in its kth power gives the number of walks of length k between each pair of vertices [4] To find out 



[PDF] notes by Gregg Musiker on the undirected-graph case - Math 4707

We define the adjacency matrix A(G) of a graph G, with V (G) = n, to be the n-by- n denote the entry in the ith row and jth column of the kth power of A(G), we



[PDF] Matrices and Graphs - math - Ryerson University

Definition 3 Given a weighted graph G, the adjacency matrix is the matrix A = (aij) , where aij = w(vi,vj) For most purposes the adjacency matrix and incidence 



[PDF] Adjacency matrices - Ma/CS 6b

1 fév 2015 · matrix multiplications If is a power of 2: ◦ 2 = ,  



[PDF] Role of Adjacency Matrix & Adjacency List in Graph Theory - CORE

1 août 2012 · the adjacency matrix of a finite graph G on n vertices is the n × n matrix Consider the powers A, A2, A3 of the adjacency matrix A of a graph 



[PDF] Chapter 103 Counting walks in directed graphs - UCSD Math

1 mai 2016 · Raise matrix A to the mth power by multiplying m factors of A Take the entry The transition matrix M is the adjacency matrix of this graph (M n ) 

[PDF] power of board of directors

[PDF] power of ten

[PDF] power spectrum of discrete signal

[PDF] power tool abb knx

[PDF] power word activities

[PDF] power words for education

[PDF] powerful python pdf download

[PDF] powerful sentence starters

[PDF] powerpoint 14th amendment equal protection

[PDF] powerpoint 2013 exercises for practice

[PDF] powerpoint 2016 advanced tutorial pdf

[PDF] powerpoint 2016 notes

[PDF] powerpoint 2016 vocabulary

[PDF] powerpoint 2019 tutorial pdf

[PDF] powerpoint advanced pdf options

Matrices and Graphs

P. Danziger

1 Matrices and Graphs

Definition 1Given a digraphGwe can representG= ({v1,v2,...,vn},E)by a matrixA= (aij) whereaij=the number of edges joiningvitovj.Ais called the inidence matrixofG. If the edges ofG. Clearly if a digraph,G= (V,E), satisfies (vi,vj)?E?(vj,vi)?E(A=At) thenGis equivalent to an undirected graph. SoGis a graph (as opposed to a digraph) if and only if its incidence matrix is symmetric. (i.e. the matrix is equal to its transpose,A=AT). Alternatively, we can create a digraph from an undirected graph by replacing each edge{u,v}of the undirected graph by the pair of directed edges (u,v) and (v,u). Definition 2A weighted graphis a graph in which each edge has an associated weight or cost. In a weighted graph we usually denote that weight of an edgeebyw(e), or ife=uvwe can write w(u,v). If no explicit weight is given we assume that each edge has weight 1 and each non edge weight 0. Definition 3Given a weighted graphG, the adjacency matrixis the matrixA= (aij), where a ij=w(vi,vj). For most purposes the adjacency matrix and incidence matrix are equivalent. Note that ifGis not connected then the connected components ofGform blocks in the adjacency matrix, all other entries being zero. Theorem 4LetGbe a graph with connected componentsG1,...,Gk. Letnibe the number of vertices inGi, and letAibe the adjacency matrix ofGi, then the adjacency matrix ofGhas the form A

10...0

0A20 0Ak Theorem 5Given Two graphs,GandH, with adjacency matricesAandBrespectively,G≂=H if and only if there is a permutation of the row and columns ofAwhich givesB. Isomorphism is just a relabeling of the rows and columns of the adjacency matrix. 1

Matrices and Graphs P. Danziger

2 Storing Graphs

We wish to be able to store graphs in computer memory. Obviously the incidence matrix or adjacency matrix provide a useful way of holding a graph in an array. One disadvantage to using an

array is that it is wasteful, each edge information is stored twice, once asa[i][j] and once asa[j][i].

Further just to specify the adjacency matrix requiresO(n2) steps. There are two other (related) standard methods for storing graph in computer memory, adjacency lists and adjacency tables. We use a list rather than an array, for each vertex we list those vertices adjacent to it. Note that in practice this can be done either as a matrix or a list. If it is done as a matrix then the matrix has sizen×Δ and is called an adjacency table. In an adjacency listthe vertices adjacent to a cvertexiare stored as a list, usually the end of the list is indicated by a non valid value. Thus for eachi L(i,0) gives the adjacent vertex number, L(i,1), gives a pointer to the next list entry, or 0 for none.

Example 6

4? 1 3? 2? ((0 0 1 0

0 0 1 0

1 1 0 1

0 0 1 0)

))13 23

31 2 4

43
((3-1-1 3-1-1 1 2 4

3-1-1)

))iL(i,0)L(i,1)130 230
315
430
526
640

Adjacency MatrixAdjacency TableAdjacency List

The maximum number of edges in a simple graph isO(n2), a graph with relatively few edges, say o(n2), is called a sparse graph.

2.1 Matrices and Walks

Definition 7Given a walkv1e1...ek-1vkin a graphG, the lengthof the walk is the number of edges it contains (k-1). Problemgiven a positive integerk, a (directed) graphGand two verticesviandvjinG, find the number of walks fromvitovjof lengthk. Theorem 8IfGis a graph with adjacency matrixA, and verticesv1,...,vn, then for each positive integerktheijthentry ofAkis the number of walks of lengthkfromvitovj. 2

Matrices and Graphs P. Danziger

ProofLetGbe a graph with adjacency matrixA, and verticesv1,...,vn.

We proceed by induction onkto obtain the result.

Base CaseLetk= 1.A1=A.

a ij= the number of edges fromvitovj= the number of walks of length 1 fromvitovj.

Inductive StepAssume true fork.

Letbijbe theijthentry ofAk, and letaijbe theijthentry ofA. By the inductive hypothesisbijis the number of walks of lengthkfromvitovj. Consider theijthentry ofAk+1=AAk=ai1b1j+ai2b2j+...+ainb2n=?n m=1aimbmj.

Considerai1b1j

= number of walks of lengthkfromv1tovjtimes the number of walks of length 1 fromvitov1 = the number of walks of lengthk+ 1 fromvitovj, wherev1is the second vertex. This argument holds for eachm, i.e.aitbtj= number of walks fromvitovjin whichvmis the second vertex. So the sum is the number of all possible walks fromvitovj.?

There is a related method for finding the shortest path between any specified pair of points. Suppose

that the points have been orderedV={v1,v2,...,vn}, for each pairi,jfrom 1 tonlet W

0(i,j) =?

?The weight of the edgevivjifvivj?E

0 ifi=j

∞ifvivj??E and for eachkfrom 0 ton-1 define W k+1(i,j) = min(Wk(i,j), Wk(i,k) +Wk(k,j)) Theorem 9Wn(i,j)is the length of the shortest path fromvitovj. Proof:For a given value ofkletSk={v1,...vk}. We show thatWk(i,j) is the length of the shortest path fromvitovjusing only the vertices in the subsetSkby induction onk. Base CaseWhenk= 0,W0(i,j) is the weight of the edgevivj, if it exists. Inductive StepNow assume thatWk(i,j) is the length of the shortest path fromvitovjusing only the vertices inSk. ConsiderWk+1(i,j), if there is a shortervivj-path using the vertexvk+1as well, it will have length equal to the shortestvivk+1-path using only vertices fromSkplus the length of the shortest v k+1vj-path using only vertices fromSk, that isWk(i,k+ 1)+Wk(k+1,j). On the other hand, if there is no shorter path usingvk+1, the valueWk(i,j) will remain unchanged.

Now,Sn=V, so the result follows.?

This suggests an algorithm for building the shortest path list.

Initialization:

InitialiseW

Iteration:

for k = 1 ton for i = 1 ton for j = 1 ton W k(i,j) = min(Wk-1(i,j), Wk-1(i,k-1) +Wk-1(k-1,j))

This algorithm has running timeO(n3).

3quotesdbs_dbs6.pdfusesText_12