Edinburgh Research Explorer Non-backtracking PageRank

The PageRank algorithm, which has been “bringing order to the web” for more than twenty years, computes the steady state of a classical random walk plus teleporting. Here we consider a variation of PageRank that uses a non-backtracking random walk. To do this, we ﬁrst reformulate PageR-ank in terms of the associated line graph. A non-backtracking analog then emerges naturally. Comparing the resulting steady states, we ﬁnd that, even for undirected graphs, non-backtracking generally leads to a diﬀerent ranking of the nodes. We then focus on computational issues, deriving an explicit representation of the new algorithm that can exploit structure and sparsity in the underlying network. Finally, we assess eﬀectiveness and eﬃciency of this approach on some real-world networks.


Motivation
The notion of a walk around a graph is both natural and useful.The walker may follow any available edge, with nodes and edges being revisited at any stage.However, in some settings, walks that backtrack -leave a node and then return to it on the next step-are best avoided.The concept of restricting attention to non-backtracking walks has arisen, essentially independently, in a wide range of seemingly unrelated fields, including spectral graph theory [2,13,14], number theory [31], discrete mathematics [4,29], quantum chaos [27], random matrix theory [28], stochastic analysis [1], applied linear algebra [30] and computer science [25,33].Non-backtracking has more recently been considered in the context of matrix computation, where it has been shown to form the basis of effective algorithms in network science for community detection, centrality and alignment, [3,10,16,18,20,21,23,32].We note that non-backtracking walks have typically been studied on undirected networks, but the definition continues to make sense in the directed case.
For network science applications, non-backtracking can be imposed at very little extra cost and offers quantifiable benefits: centrality measures can avoid localization [3,10,20] and discover key influencers [21,32], and community detection algorithms perform optimally on the stochastic block model [18].In terms of classical random walks on a graph, it is also known that nonbacktracking enhances mixing [1].
Given that the PageRank algorithm [22] computes the steady state of a particular (teleporting) random walk, it is therefore natural to ask whether there is any scope for designing and analysing a non-backtracking analog.We emphasize that the PageRank philosophy has been extended well beyond the WWW into a diverse range of areas including bioinformatics, bibliometrics, business, chemistry, neuroscience, social media, and sports [9], where non-backtracking may be a natural requirement.In particular, PageRank-like measures have been extensively used in transport modelling; see, for example, [6,26].In this setting it is reasonable to assume that a vehicle will not immediately head back to the same road junction, train station or bus stop.
In this work, we therefore consider the following general questions: -What is an appropriate non-backtracking version of PageRank?-Can the imposition of non-backtracking lead to a different node ranking?-Is there an efficient way to implement such an algorithm?
At the core of our analysis is the Hashimoto matrix, which arises when we work on the dual graph, or line graph.It is interesting to note a connection with the space syntax approach in the analysis of road networks, where edges in a graph represent crossroads and nodes are the streets [7].This representation is the dual of the more intuitive setting where edges represent roads and nodes are intersections; however, in [26] the authors argue that "the dual graphs carry more information than the corresponding primal graph." The material is organized as follows.In Section 2 we describe background material on PageRank.Section 3 gives a transposition of standard PageRank to the dual space and verifies the equivalence of the two formulations.Section 4 defines and analyzes a new non-backtracking analog.In particular, we show that, even for undirected graphs, non-backtracking generally leads to a different ranking of the nodes.In Section 5 we derive a computable description of the new measure and show how to exploit the structure and sparsity of the Hashimoto matrix.In Section 6 we comment on some numerical experiments performed on road networks.Section 7 gives some conclusions.

Background
Let A = (a ij ) ∈ R n×n be the adjacency matrix of an unweighted, weakly connected, directed graph with n nodes and m directed edges.We further assume that there are no multiple edges linking nodes in the network.Under these assumptions, a ij = 1 if there is an edge from node i to node j, otherwise a ij = 0.A node that has no outgoing links is called a dangling node.We use the common approach of removing dangling nodes by modifying the adjacency matrix; all-zeros rows in A are replaced by all-ones rows [15].This corresponds to adding n edges from each dangling node to all the nodes in the network, itself included.
Let G = (V, E) be the graph obtained once these edges have been added to the original network in order to remove dangling nodes.In the remainder of the paper, we shall work on this network.Let W = A + χ1 T be its adjacency matrix, where χ is the indicator vector for the set containing the dangling nodes in the original digraph.Here, 1 ∈ R n denotes the vector of all ones, and we will sometimes write 1 n when its dimension may be in doubt.We let k be the number of dangling nodes in the original network, so the new graph G contains m := m + kn edges among n nodes.
Let d = (d i ) = W 1 be the vector of out-degrees for the nodes in the graph represented by W , i.e., let d i be the number of edges leaving node i in G.We will denote by D the diagonal matrix whose diagonal entries are D ii = d i for all i.Since all the nodes have positive out-degree, D is invertible.
We assume that the edges have been labelled in some arbitrary order {e} m e=1 .We also use the notation i → j to denote an edge from node i to node j and i → ⋆ to denote an edge that starts from node i.We then define the matrices L, R ∈ R m×n as follows: 1 if e has the form i → ⋆ 0 otherwise and In words L ei records whether edge e starts at node i, and R ej records whether edge e ends at node j.The matrices L and R will be referred to as the source matrix and target matrix, respectively.It is readily seen that W = L T R and D = L T L.Moreover, the matrix R T R is diagonal with the in-degree of the nodes as its diagonal entries.
Remark 1 If W = A and the original network contained no dangling nodes, then D would still be invertible, but R T R might not be invertible as the network may contain source nodes; that is, nodes with no incoming links.On the other hand, if the original graph contained at least one dangling node, so that W = A, then its removal would also remove any source node, thus making R T R invertible as well.
As discussed in the original work [22], the PageRank algorithm may be motivated from two different perspectives: (a) the long-term behavior of a web surfer who randomly follows outgoing links and occasionally teleports (jumps) to a random page, and (b) the outcome of an iterative voting procedure where a page votes for pages that it follows, with more important pages given more influence.
From the random surfer viewpoint, the PageRank vector x may be defined as the stationary distribution of a Markov chain that is constructed from a random walk on the graph plus teleporting: where T is row stochastic and x 1 = 1, [9].Here, W T D −1 is column-stochastic, α ∈ (0, 1), and v ≥ 0 is such that v 1 = 1.
The matrix F = 1v T is sometimes referred to as the teleportation matrix and v the teleportation distribution vector [9] or personalization vector [19].The scalar α is known as the teleportation parameter [5,9] or amplification factor [34].
Based on the voting procedure, we may equivalently define the PageRank vector as the normalized version, x = x/ x 1 , of the non-negative solution to the following linear system: To see that these two formulations of the PageRank problem are equivalent, starting from (1) we have and (2) follows by rearranging the terms and noting (1 T x) = 1.In our work, the random walk interpretation will be used as the basis for a non-backtracking extension.
In the following, for simplicity, we use the original uniform teleporting distribution vector v = 1 n 1, so that (1) rewrites as and (2) rewrites as Let us briefly recall here that if we let D A be the diagonal matrix whose diagonal entries are (D A ) ii = (A1) i and if we use the symbol † to denote the Moore-Penrose pseudo-inverse of a matrix [12], then the solution to the linear system is strictly related to the solution of the PageRank problem, i.e., to the solution of (5).Indeed, let us first recall that, since the matrix A T D † A ≥ 0 is columnsubstochastic, i.e., it is such that 1 T A T D † A ≤ 1 T , the problem of finding the non-negative solution to the linear system ( 6) is usually referred to as the pseudo-PageRank problem.Moreover, the following result holds.
Theorem 1 [8, Theorem 4.2] The PageRank vector x solution to (5) is obtained by normalizing the solution x to the pseudo-PageRank problem (6): This theorem shows that, in order to compute the PageRank vector x one can solve the pseudo-PageRank problem and then normalize the solution.Therefore, underlying every pseudo-PageRank system there is a true PageRank problem.
In the following section we show that PageRank can be reformulated in the dual space, where edges in G play the role of nodes in the new network.This reformulation then leads to a natural non-backtracking extension.

Moving to the dual space
Let us consider the "line graph" associated with the network represented by W .We will us a calligraphic font to denote matrices associated with the line graph.In the line graph, nodes are edges in the original network G and there is a connection between two edges if the endpoint of the first is the source point of the second.Let W ∈ R m×m be the adjacency matrix of the line graph, i.e., the matrix whose entries are: where δ jk is the Kronecker delta.It is easily proved that W = RL T .Let us define the diagonal matrix D whose diagonal entries are the entries of the vector W1.This stores the "out-degree" of each edge in the network, i.e., the number of edges leading out of the current edge.Therefore, an edge i → j, has out-degree in the line graph coinciding with the number of edges leaving node j, i.e., the out-degree d j of node j.We are assuming that the network does not contain dangling nodes, so W1 > 0 and D is invertible.
Our immediate goal is to define a PageRank vector in the dual space, i.e., the edge space, as the solution of a linear system involving W that, once projected, will allow us to retrieve the PageRank vector x defined earlier in the primal space.This forms the basis of the non-backtracking version that we develop in Section 4.

Formulation of edge PageRank
We will define the transition matrix for edge PageRank in terms of the matrices W, D and an appropriately defined teleportation matrix F. The new transition matrix will then have the form: where we must specify the form of F. Some care is needed in the construction of F to ensure that the original PageRank vector can be recovered-the essential point is that jumping to an edge at random does not correspond to jumping to a node at random, when the graph is not regular.To proceed, we note that each edge in the original graph may be mapped to the node that it points to.Let N be the number of nodes in the network that have positive in-degree, i.e., the number of nodes in the network that are not source nodes.We then define our teleportation matrix as where π = R(R T R) † 1 is the vector that associates to each edge the inverse of the in-degree of its endpoint.Here the symbol † denotes the pseudo-inverse of the diagonal matrix R T R; indeed, as pointed out in Remark 1 if the network contains a source, i.e., a node with zero in-degree, then the matrix R T R is not invertible.It is worth stressing that, however, π > 0 even when the network contains a source, thanks to the premultiplication by R that is used to assign to each edge the inverse of the in-degree of its endpoint (that is thus positive, since there is at least the particular edge that points to it).Since π 1 = N , it holds that F1 = 1.Moreover, we know that D −1 W1 = 1.Therefore, the invariant measure x ≥ 0 such that x 1 = 1 satisfies After some algebraic manipulation, the above equation rewrites as These two expressions translate PageRank from the node space to its dual.We have not yet shown that these expressions are equivalent to the ones described in Section 2. In order to do so, we first need to describe how to project x back to the node space.This can be done by pre-multiplying the vector x by R T .The projected non-negative vector z := R T x can be easily seen to have unit 1-norm.
Our goal is now to show that z = x, thus deriving equivalence between the new formulations of PageRank and ( 4)-( 5).Let us first prove two preliminary results.

Lemma 1 In the above notation, D
Lemma 2 In the above notation, Proof Left-multiplying by L T the relation in Lemma 1 and using W = L T R it follows that L T D −1 RD = W , thus the conclusion, since D is invertible.
Theorem 2 In the above notation, if a network does not contain a source node, then for all α ∈ (0, 1) we have Proof The result can be proved by using the facts that W T = LR T and W T = R T L, and appealing to Lemmas 1 and 2: where the first equality holds because ρ(W T D −1 ) = 1 > α, and thus Therefore, and hence the conclusion.
The following corollary is then immediate.
Corollary 1 When the network does not contain a source node, the edge PageRank vector in (7) projects to the original PageRank vector in (3); that is, where we have used the fact that N = n and thus π 1 = n.
We now describe in detail what happens when the network contains s = n − N ≥ 1 source nodes.We will show that the edge and node based systems are not equivalent.It is worth pointing out that we are tacitly assuming that the original network did not contain dangling nodes.If this was not the case, then the removal of the dangling nodes would have also removed the source nodes; see Remark 1.
The adjacency matrix of the network containing s source nodes, which we assume to be nodes 1, . . ., s without loss of generality, can be described as where S ∈ R s×N describes the edges leaving source nodes to target non-source nodes in the network and W is the adjacency matrix of the graph obtained by removing nodes 1, . . ., s and all the edges leaving them.Moreover, it holds that where the diagonal matrix D S is such that (D S ) ii = (S1) i is the out-degree of the ith source node, for i = 1, . . ., s and D is the diagonal matrix such that ( D) ii = ( W 1) i for i = 1, 2, . . ., N .The diagonal matrix R T R of in-degrees is no longer invertible, since nodes 1, . . ., s have no incoming links and thus zero in-degree.An easy computation shows that where β = (1−α) n .On the other hand, it is easily checked following a reasoning similar to the one outlined in the proof of Theorem 2 that if we use the matrix defined in the edge space and then project, we obtain: and therefore z = x and we cannot extend the statement in Theorem 2 by simply replacing (R T R) −1 with (R T R) † if the network contains at least one source node.
In order to overcome this minor issue, we use a slightly less intuitive approach and, instead of mapping each edge to its endpoint, we map it to its start point.With this convention, the matrix D = L T L of out-degrees is always invertible, even in the pathological case of a network containing one or more source nodes but no dangling nodes.Using as personalization vector which now has υ 1 = n, and projecting with L T instead of R T , Theorem 2 rewrites as follows.
Theorem 3 In the above notation, for all α ∈ (0, 1) we have Proof The result can be proved using the fact that W T = LR T , the fact that ρ(W T D −1 ) = 1 > α and Lemma 2: We then have the following general corollary.
Corollary 2 After the network has been preprocessed to eliminate dangling nodes (if any), the projected solution via L to PageRank in the edge space is equivalent to standard PageRank described in (5), i.e., L T x = x.
Proof A proof follows immediately from Theorem 3.

The non-backtracking framework
In this Section we want to exploit the definition of PageRank in the dual space to describe a PageRank-like system in the non-backtracking framework.Recall that a walk is said to be backtracking if it contains at least one instance of i → j → i, where i, j are two nodes in the network connected by reciprocated edges.Let B ∈ R m×m be the matrix whose entries are This matrix has a 1 in position (i → j, k → ℓ) if the two edges are consecutive (i.e., if j = k) but they do not form a backtracking walk (i.e., if i = ℓ).We will refer to this matrix as the non-backtracking edge-matrix or the Hashimoto matrix [11].If we let • represent the Schur product, i.e., the entry-wise product, between two matrices, then the Hashimoto matrix can be described as B = W − W • W T .Even though this matrix is built after all dangling nodes have been removed from the network, it is still possible for it to have zero rows.This happens when some of the nodes have no outgoing links, apart from exactly one reciprocated edge.Let us assume that there is one node of this type in the network, node i, connected to node j through a reciprocated edge.
If the random walker reaches node i using the edge j → i, then it will not be able to leave this node without backtracking; therefore, the row corresponding to the edge j → i only contains zeros.We will refer to edges of this type as dangling edges.Thanks to Theorem 1 we do not need to correct for the presence of these edges in the Hashimoto matrix in order to compute the nonbacktracking version of PageRank in the edge space.Indeed, a rescaled solution to the pseudo-PageRank problem formulated with B will be the solution to the PageRank problem, where the zero rows in the matrix B have been replaced with the vector υ T = (LD −1 1) T .We note that this correction has the effect of allowing backtracking in this very special circumstance.
In the following we will assume that there are no dangling edges in the graph; the remainder of this section can be adapted to the case where such edges existed.
To finalize the description of the transition matrix that will allow us to compute the non-backtracking version of PageRank, we need to describe the teleportation matrix.Here we must make a choice: should we allow backtracking during a teleportation step?In this work we allow such behavior on the basis that the original PageRank philosophy is to make teleportation independent of the network topology.(Further, we note that teleportation in the original PageRank algorithm allows a step of the form i → i even when the graph has no loops, violating the classical definition of a walk.Hence, teleportation can be regarded as a separate process, independent of the underlying random walk.)We also note that backtracking due to teleportation will be an extremely low probability event in large networks, which are the ones of interest in this context.We therefore use We can now define for 0 < α < 1 the matrix P = αD −1 B + (1−α) n 1υ T , where now D is the diagonal matrix whose diagonal entries are the entries of the vector B1.Since we assume that there are no dangling edges, B1 > 0 and we have that P1 = 1; therefore, the PageRank vector in the dual space will be the unit 1-norm, non-negative vector ŷ that solves the following linear system In order to then derive a nodal measure, we need to project ŷ onto the node space; following Theorem 3, we use the matrix L T : This vector will be non-negative and will have unit 1-norm, since L1 = 1 and ŷ 1 = 1.Therefore, we can define the non-backtracking PageRank-like vector as follows.
Definition 1 Let B be the Hashimoto matrix of a directed graph with no dangling nodes or dangling edges.Let D be the diagonal matrix whose diagonal entries are the entries of the vector B1, and let L be the source matrix of the graph.For all 0 < α < 1 we define the non-backtracking PageRank-like vector as the non-negative, unit 1-norm vector y := L T ŷ, where ŷ ≥ 0 with ŷ 1 = 1 solves the the linear system (8), for υ = L(L T L) −1 1.
Before commenting on the features of this new measure, let us point out that the new PageRank problem ( 8) is equivalent to the eigenproblem n 1υ T and ŷ 1 = 1, in line with the equivalent formulations ( 5) and ( 4) for standard PageRank.
Definition 1 allows us to introduce the non-backtracking aspect in PageRank.As we will see below, there are situations in which the newly introduced measure and standard PageRank return vectors that are the same or induce the same ranking.However, in applications where backtracking is best avoided, the two measures may differ, as we shall see in Section 6.
Let us now briefly discuss the case where the two measures behave similarly.It has been proved in [17] that for an undirected graph with nodes all having at least degree two (so that there are no dangling edges), the steady state of P = D −1 W coincides with that of P = D −1 B, once the latter has been projected in the node space via L T : so standard PageRank and the new non-backtracking PageRank-like measures are the same in the absence of teleportation.In other words, in this case where every edge is reciprocated and no teleportation is allowed, this result tells us that the long-term frequency of visits to a particular node during a random walk does not change when non-backtracking is imposed-the nodes benefit from non-backtracking precisely in proportion to their original PageRank score.Intuitively, nodes given higher PageRank scores are accessible through many different traversals, and hence are less reliant on backtracking walks than nodes given lower PageRank scores.We now show that this result carries over to the case where we allow teleporting, for a special class of graphs.
Theorem 4 Let W be the adjacency matrix of an undirected k-regular graph, with k ≥ 2. For any α ∈ [0, 1], let us define the matrices n 11 T , where D is the diagonal matrix whose diagonal entries are the entries of the vector B1, and υ = LD −1 1.
Then, if we let P T ŷ = ŷ and P T x = x, with x 1 = ŷ 1 = 1, it holds that where L is the source matrix associated with W .
Before proving the result, let us recall that in the case of undirected networks every undirected edge is considered as a pair of directed edges when building the matrices W and B.
Proof When α = 1 the result follows from [17].If α = 0, then from the description of P and P it follows that x = (1−α)  n 1, and ŷ = (1−α) n υ.The conclusion then follows from the definition of υ and the fact that D = L T L.
Let us now consider the case of α ∈ (0, 1).The eigenproblems P T x = x and P T ŷ = ŷ can be reformulated as two linear systems: and where we have exploited the fact that W T = W .Let us work on these individually.Concerning the first, we know that, since the graph is k-regular with k ≥ 2, then W 1 = k1 and consequently D −1 = k −1 I. Therefore, it is easily checked that Concerning the second linear system, we have that B1 = (k − 1)1 and D −1 = (k − 1) −1 I, since for every edge one can proceed using all the k edges adjacent to it, except for its reciprocal.In addition, we also have that B T 1 = (k − 1)1 due to the fact that the graph is k-regular.From the description of D above and the fact that L1 = 1, we have that The conclusion then follows from the fact that each node is the source of exactly k edges, and thus L T ŷ = n −1 1 = x.
We now show with a small example that without the hypothesis of regularity the two steady states are no longer related in general when α ∈ (0, 1).For α = 0, 1 the conclusion still follows from an easy computation and from [17].Let us consider the graph represented in Figure 1, where we have represented With this ordering of nodes and vertices, the source matrix reads From the symmetries in the graph it follows that, when working on the nodes, the entries of the PageRank vector x = (x i ) are such that x 1 = x 3 and x 2 = x 4 ; exploiting those symmetries when working on the edges, it follows that the non-backtracking PageRank-like vector ŷ = (ŷ i ) will have ŷ1 = ŷ3 = ŷ6 = ŷ8 , ŷ2 = ŷ4 = ŷ5 = ŷ7 and ŷ9 = ŷ10 .Using these relationships, the linear systems of interest may be solved to give , .
The entries of y := L T ŷ are then .
It is easily verified that y 1 = x 1 and y 2 = x 2 if and only if α = 0, 1; hence the result in Theorem 4 does not hold for α ∈ (0, 1).We stress, however, that the ranking is preserved: nodes 1 and 3 rank first, while 2 and 4 rank second.
The next example shows that this is not a universal behavior of the newly introduced measure, as we will also see experimentally in Section 6.Let us consider the network with n nodes whose adjacency matrix is .
In Figure 2 we illustrate the case n = 6.It can be proved analytically that when there is no teleporting and α = 1, the standard PageRank vector x = (x i ) is such that This can be also be argued from first principles by considering the long-time frequency with which nodes are visited.After node 4 has been reached, a walk always continues with nodes 5, 6, . . ., n, which explains why x 4 = x 5 = • • • = x n .A visit to node 1 is equally likely to be followed by a visit to nodes 2 or 3. A visit to node 2 is equally likely to be followed by a visit to nodes 1 or 3. A visit to node 3 is equally likely to be followed by a visit to node 2 or (after passing through 4, 5, . . ., n) node 1. Hence x 1 = x 2 = x 3 , and this value exceeds the other frequencies.On the other hand, the new measure is such that Here, in the absence of backtracking the same argument explains why The key difference now is that a visit to nodes 1 or 3 can no longer be followed by a visit to node 2 if node 2 was used on the previous step.So, in the long term, although node 2 receives more visits than nodes 4, 5, . . ., n it loses out to nodes 1 and 3. Therefore the rankings derived from the two measures are different.The same conclusion holds when we take teleportation into account; in this situation similar arguments show that Before moving on to the numerical tests on real-world networks, we discuss in the next section how to implement the most expensive operation performed by an iterative solver when solving (8): matrix-vector multiplications involving B T .

On the computation of B T v
The Hashimoto matrix B built from a directed network may be very large, especially if the original graph was large to begin with and contained several dangling nodes.Indeed, to remove such nodes one needs to add n edges to the network for each dangling node.While performing this correction to the graph in the node space corresponds to a low rank modification of the adjacency matrix A, it corresponds to adding n rows and columns to the non-backtracking edge-matrix for each of the dangling nodes originally present in the digraph.
In the following we describe how to label the edges in the network in order to highlight the structure and sparsity of B and exploit such features in the computations.The notation adopted will be as follows: n is the total number of nodes in the digraph; -k is the number of dangling nodes; -m is the number of edges before the correction of the dangling nodes, i.e., the number of edges in the graph associated with A; -K ≤ m is the number of edges in the graph represented by A that point to the dangling nodes.
We will assume that the non-dangling nodes are labelled as {1, 2, . . ., n − k} and the remaining k nodes {n − k + 1, . . ., n} are the dangling nodes.Let us further assume that the m − K edges that do not point to the dangling nodes in the graph are labelled as {1, 2, . . ., m − K} so that the remaining K edges { m − K + 1, . . ., m} are those pointing to the dangling nodes.With this labelling, the matrix A will have the following structure: where A 11 ∈ R (n−k)×(n−k) is the adjacency matrix of the graph obtained by removing the dangling nodes and the edges pointing to them and A 12 ∈ R (n−k)×k describes the edges pointing to the dangling nodes from the non-dangling nodes in the network.We then have that the source and target matrices of A, that we will denote by L(A) and R(A), respectively, have the following structure: After the correction of the dangling nodes, the adjacency matrix associated with the new graph G will be W = A + χ1 T with χ = n i=n−k+1 e i , where e i ∈ R n is the ith vector of the standard basis of R n .The source and target matrices associated with W are With this ordering of the nodes and edges, the edge matrix W = RL T has the form and thus the matrix B T involved in the computations is where the matrices S 1 , S 2 , S 4 , which effect the removal of W • W T from W = B + W • W T , have the form We note that S 1 and S 4 are square and symmetric, whilst S 2 is rectangular, in general.All three matrices contain at most one element equal to one in each row.We show below that, because they are highly structured, we do not need to explicitly form the matrices S 2 and S 4 in order to compute their action on a vector.
Let us describe the matrices S 2 ∈ R K×k(n−k) and S 4 ∈ R k 2 ×k 2 in more detail.From the structure of (L 2 ⊗ 1 T k ) and (1 T n−k ⊗ R 2 ) it can be deduced that the ones in the matrix S 2 are found in position (e, (i − 1)k + j), where e ∈ { m − K + 1, . . ., m} is the label of the edge i → n − k + j that points from a certain node i ∈ {1, 2, . . ., n − k} to a dangling node (n − k + j) for j ∈ {1, 2, . . ., k}.Similarly, the matrix ) has a one in position ((i − 1)k + j, (j − 1)k + i) for all i, j = 1, 2, . . ., k.Therefore, pre-multiplying a vector by these matrices corresponds to accessing certain entries of the vector.
In order to compute the non-backtracking PageRank vector, we can either solve a sparse linear system or use the power method to obtain the nontrivial eigenvector associated with the eigenvalue 1.In either case, we need to implement a matrix-vector product involving B T and a rescaled vector v := D † v.The rescaling can be performed at each iteration once the column sums of B T have been computed.Recall that we do not need to remove zero rows from B, equivalently, columns from B T as it is well known that the solution to the pseudo-PageRank problem (solve while retaining the zero columns in B T ) only differ from the solution to the PageRank problem (solve after "correcting" the zero columns) by a positive multiplicative constant; see Theorem 1.Let v = D † v = [q T , r T , s T , t T ] T ≥ 0 be a non-zero vector with q ∈ R m−K , r ∈ R K , s ∈ R k(n−k) , and t ∈ R k 2 .Then, at each step, we compute where ( s) i = k j=1 s (i−1)k+j and ( t) i = k j=1 t (i−1)k+k .

Numerical experiments
We now present numerical results to compare the performance of non-backtracking PageRank in Definition 1 with standard PageRank.We perform our tests on four road networks corresponding to the cities of Birmingham (UK), Philadelphia (USA), Austin (USA), and the Federal State of Hesse (Germany).The data is available in [24].Here, the edges represent roads and nodes represent road intersections (primal graph).We computed both the new measure and standard PageRank as the solution of a linear system; see equations ( 5) and (8).For both problems we used the MATLAB implementation of the linear solver GMRES without restart and we gave as input a function handle that describes the matrix multiplication B T (D −1 v) and W T (D −1 v) for vectors v of appropriate size.Both these functions were implemented exploiting the structure of the matrices B (see Section 5) and W = A + χ1 T .We used the default setting of 10 −6 for the tolerance in the stopping criterion and allowed for a maximum of 100 iterations.We select α = 0.75 for the teleporting parameter.Properties of the networks used in the tests are summarized in Table 1, where we report the number of nodes, n, the number of dangling nodes, k, the number of source nodes, s = n − N , the number, m, of edges in the network represented by A, and the number, K, of edges pointing to the dangling nodes.Moreover, we report the number, M , of dangling edges in the network and the fraction of edges in the graph that have a reciprocal: m .So, for example, the value δ = 0.19 for the Federal State of Hesse indicates that 81% of the road connections are one-way only.All experiments were performed using MATLAB Version 9.4.0.813654 (R2018a) on an HP EliteDesk running Scientific Linux 7.5 (Nitrogen), a 3.2 GHz Intel Core i7 processor, and 4 GB of RAM.
In Figure 3 we scatter plot the new measure (NBT PR edge), projected as in (9), against standard PageRank (PR node).The measures show a strong overall linear correlation; the Pearson's correlation coefficients are ρ = 0.94 for the Federal State of Hesse, ρ = 0.90 for both Austin and Philadelphia, and ρ = 0.81 for Birmingham.However, it is readily seen that the two measures do not completely agree on the rankings.Indeed, the intersection of the sets containing the IDs of the top ten ranked nodes according to the two measures for Birmingham, the Federal State of Hesse, Austin and Philadelphia contain 8, 3, 5 and 6 elements, respectively.It is beyond the scope of this paper to determine which measure is returning the most meaningful results, since there is no ground truth for comparison.However, it may be argued that the nonbacktracking version of the measure is the best fit for road networks since, as we mentioned in the introduction, the concept of non-backtracking walks is consistent with the typical behavior of a driver or a pedestrian traversing a city.It is notable that for all four scatter plots the low-ranked nodes are assigned the same score by non-backtracking PageRank, whilst they are being assigned different values by the classic version of the algorithm.A further analysis of the data showed that the nodes falling in this class are exactly M + s and correspond to the s source nodes and the M reciprocated leaves (i.e., nodes that have only one incoming link that is the reciprocal of their only outgoing edge) in the original graph associated with A.
We now turn to computation time and the number of iterations required to achieve convergence of GMRES.Table 2 shows the results.We see that standard PageRank requires slightly fewer iterations than its non-backtracking counterpart.However, the total computation time for non-backtracking PageRank, including pre-processing time to build the matrices L 1 , R 1 , S 1 , L 2 and R 2 , is significantly smaller than for standard PageRank.We attribute this surprising result to the fact that the sparsity and structure of the matrix B can be exploited by the iterative solver.Finally, in Figure 4 we display the evolution of the computation time required to achieve convergence of GMRES for the two algorithms as we let the teleportation parameter α vary, as well as the evolution of the Pearson's correlation coefficient between the two vectors for the city of Birmingham.Here we let α = 0.1, 0.25, 0.3, 0.5, 0.75, 0.85, 0.99.Table 3 reports the number of iterations required to achieve convergence.Similar results were obtained for the other networks and are therefore omitted.We see from the upper plot of Figure 4 that the newly introduced measure is computed more quickly than the measure we are comparing with, while Table 3 shows that the number of iterations required by GMRES to achieve convergence is comparable.Note that when α = 0.99, in both cases GMRES iterated the maximum allowed number of times without achieving convergence.This follows from the fact  that both systems become ill-conditioned as α → 1.The lower plot of Figure 4 shows that the correlation between the two measures decreases as the value of α increases.This may be explained by the fact that reducing the frequency of teleporting emphasizes the difference between the two underlying types of walk.In summary, for the networks studied here, using the ideas from Sections 4 and 5 we can incorporate non-backtracking into PageRank in order to obtain a distinct node ranking at reduced computational cost.

Conclusions
In this work we showed how to extend the definition of the PageRank algorithm to a non-backtracking framework by using the dual representation of a network and the Hashimoto matrix.We proved that the elimination of backtracking has no effect on the results in the case of undirected, regular networks, but also showed by example that non-backtracking can affect the ranking for the generic case of non-regular networks.We described explicitly how to exploit structure and sparsity in order to compute the new PageRank measure and showed through numerical experiments using real world transport networks and a GMRES solver that the computational cost is not increased.Future work will focus on (i) further tests on networks from a range of application fields, (ii) development of customized iterative methods for the structured linear systems that arise, (iii) non-backtracking personalized PageRank via a nonuniform teleportation distribution vector.

Fig. 1
Fig. 1 Small example of undirected network for which L T ŷ = x

Fig. 2
Fig. 2 Small example of network for which the rankings induced by x and y are different for all α ∈ (0, 1].

Table 1
Description of the dataset

Table 2
(8)ings (in seconds) and number of GMRES iterations to compute the PageRank ranking vector defined at(5)and its non-backtracking version(8).

Table 3
Number of iterations required to achieve convergence of GMRES.