Shortest Path Finding in Quantum Networks With Quasi-Linear Complexity

A fully-quantum network implies the creation of quantum entanglement between a given source node and some other destination node, with a number of quantum repeaters in between. This paper tackles the problem of quantum entanglement distribution by solving the routing problem over an infrastructure based on quantum repeaters and with a finite number of pairs of entangled qubits available in each link. The network model considers that link purification is available such that a nested purification protocol can be applied at each link to generate entangled qubits with higher fidelity than the original ones. A low-complexity multi-objective routing algorithm to find the shortest path between any two given nodes is proposed and assessed for random networks, using a fairly general path extension mechanism that can fit a large family of particular technological requirements. Different types of quantum protocols require different levels of fidelity for the entangled qubit pairs. For that reason, the proposed algorithm identifies the shortest path between two nodes that assures an end-to-end fidelity above a specified threshold. The minimum requirements for the end-to-end entanglement fidelity depend on the whole extension of the paths, and cannot be looked at as a local property of each link. Moreover, one needs to keep track not only of the shortest path, but also of longer paths holding more entangled qubits than the shorter paths in order to satisfy the fidelity criterion. Thus, standard single parameter shortest-path algorithms do not necessarily converge to the optimal solution. The problem of finding the best path in a network subject to multiple criteria (known as multi-objective routing) is, in general, an NP-hard problem due to the rapid growth of the number of stored paths. This work proposes a metric that identifies and discards paths that are objectively worse than others. By doing so, the time complexity of the proposed algorithm scales near-to-linearly with respect to the number of nodes in the network, showing that the shortest-path problem in quantum networks can be solved with a complexity very close to the one of the classical counterparts. That is analytically proved for the case where all the links of a path have the same fidelity (homogeneous model). The algorithm is also adapted to a particular type of path extension, where different links along a path can be purified to different degrees, asserting its flexibility and near-to-linearity even when heterogeneous fidelities along the sections of a path are considered.

ABSTRACT A fully-quantum network implies the creation of quantum entanglement between a given source node and some other destination node, with a number of quantum repeaters in between.This paper tackles the problem of quantum entanglement distribution by solving the routing problem over an infrastructure based on quantum repeaters and with a finite number of pairs of entangled qubits available in each link.The network model considers that link purification is available such that a nested purification protocol can be applied at each link to generate entangled qubits with higher fidelity than the original ones.A low-complexity multi-objective routing algorithm to find the shortest path between any two given nodes is proposed and assessed for random networks, using a fairly general path extension mechanism that can fit a large family of particular technological requirements.Different types of quantum protocols require different levels of fidelity for the entangled qubit pairs.For that reason, the proposed algorithm identifies the shortest path between two nodes that assures an end-to-end fidelity above a specified threshold.The minimum requirements for the end-to-end entanglement fidelity depend on the whole extension of the paths, and cannot be looked at as a local property of each link.Moreover, one needs to keep track not only of the shortest path, but also of longer paths holding more entangled qubits than the shorter paths in order to satisfy the fidelity criterion.Thus, standard single parameter shortest-path algorithms do not necessarily converge to the optimal solution.The problem of finding the best path in a network subject to multiple criteria (known as multi-objective routing) is, in general, an NP-hard problem due to the rapid growth of the number of stored paths.This work proposes a metric that identifies and discards paths that are objectively worse than others.By doing so, the time complexity of the proposed algorithm scales near-to-linearly with respect to the number of nodes in the network, showing that the shortest path problem in quantum networks can be solved with a complexity very close to the one of the classical counterparts.That is analytically proved for the case where all the links of a path have the same fidelity (homogeneous model).The algorithm is also adapted to a particular type of path extension, where different links along a path can be purified to different degrees, asserting its flexibility and near-to-linearity even when heterogeneous fidelities along the sections of a path are considered.
INDEX TERMS Quantum networks, quantum repeaters, path-finding algorithm, end-to-end fidelity, multiobjective routing.

I. INTRODUCTION
Q UANTUM technologies are presently undergoing a fast development, particularly in the areas of quantum computing, quantum secure communications, and also quantum sensing and metrology [1].There is a renewed interest in quantum computation [2], [3], the first quantum satellite was already sent to space [4], and quantum sensing is pushing the limits of our detection and measurement capabilities [5].
In order to take full advantage of these technologies the next natural step is to have a quantum network capable of distributing entanglement between any two quantum terminals, or even more demanding, between multiple parties at the same time, called multipartite entanglement, and sometimes seen as a form of quantum multicast [6].The work in [7] considers multipartite entanglement assuming no existence of quantum memories, while [8] assumes they exist at the nodes.Quantum networks should connect multiple quantum computers in order to scale up quantum computing.This distributed quantum computing could circumvent the limitation caused by the reduced number of qubits that a single quantum computer can currently handle, and become a practical manner of making quantum computers with a large number of qubits.Even so, one of the first applications of the future quantum networks will be to secure communication channels based on quantum key distribution (QKD) cryptographic systems [9], doing away with the need for the so-called trusted nodes that operate in the classical signal domain.The properties of quantum physics are opening doors to new computing and communication algorithms [10], [11] and the architecture of these future quantum networks (often dubbed Quantum Internet) is currently coalescing in the research community [12], [13] and can potentially play a crucial role in future 6 th generation networks, in tandem with classical processing in order to dramatically reduce the amount of classical data needed to be transferred to quantum central processing units [14].A number of applications that will require quantum networks have already been identified in [15], which also proposes methods to evaluate the performance of each one of those applications.
The traditional stack model, consisting of a physical layer, a link layer, a network layer, and a transport layer, remained a solid foundation for the impending work of specifying the protocols at all layers [16].A first contribution to defining a specific protocol for the quantum physical layer has been proposed in [17].An overview of the whole network stack required for a quantum internet, and including routing, is provided in [18].At the network layer, finding the shortest path between any two nodes of a network is a fundamental problem in both network theory and graph theory, and is at the core of several important applications, such as finding the shortest route between two locations, or efficiently routing information packets in communication networks.These objectives also hold in the context of quantum networks.
The details of how a quantum node should respond to incoming requests was analysed in [19].However, the routing problem is one of a different nature and has been approached in different ways.In [20], the authors have studied protocols for remote entanglement that maximize the rate at which entanglement is produced between the nodes in homogeneous quantum repeater chains.They show that long-distance entanglement is possible in quantum networks with quantum repeaters even when these perform imperfect swapping.In that work, remote entanglement operates in a different manner than the entanglement routing protocols that are the concern of the present paper, and which only focus on finding the optimal path, given some criteria.The remote entanglement protocols focus on deciding the order at which the swapping operations take place along a given path in order to maximise the entanglement rate.The problem of minimizing the entanglement time (and therefore maximizing the entanglement rate) is usually considered assuming that the number of network segments (i.e., the number of links) between the two end-nodes is a power of two [20], [21].In [22], the authors departed from that paradigm and proposed a swapping scheme for the cases when that does not hold true.In [23], [24] the authors take a theoretical approach to quantum networks based on the end-to-end capacity and investigate its interplay with routing.
Until very recently, previous works on routing in quantum networks only guarantee that the fidelity at each link in a path lies above a certain minimum.Assuring that a given end-toend fidelity is attained was only recently addressed in [25] and [26].In [26], the existence of purification at each link is also considered, and the goal is the one of maximizing the network throughput given memory constraints at the quantum repeaters and capacity constraints in the links.The model used in [26] considers that link purification is possible and solves the optimization problem by means of a polynomial time approximation scheme; nevertheless finding the exact solution would still be NP-hard.Our work rather solves a non-linear optimization problem, that can be solved in a exact form in linear time.Despite these advances, to the authors' best knowledge, there is no quantum routing algorithm that considers multi-objective optimization using nested purification protocols, which greatly increase the communication range [27].

A. QUANTUM NETWORKS
This paper looks at the problem of finding the best path to connect two nodes (in the sense of establishing entanglement between qubits) in a quantum repeater network [28].These will be networks with quantum nodes, possibly interconnected with the help of quantum repeaters that are able to extend the entanglement of qubit pairs beyond one single section (also known as a hop or link).Tackling this problem involves looking at both the link layer and the network layer.The algorithm proposed in the present paper can be applied to any network topology (in contrast with works assuming lattice structures [29], [30]).To assess the proposed algorithm the paper assumes a random network, more specifically an Erdős-Rényi network, in which all links in the network are established with the same probability [31].
In classical networks, with the nodes connected by analogue or digital transmission links, the problem of finding the shortest path between any two nodes is efficiently solved by the well-known Dijkstra algorithm (and similar ones) in an exact manner [32].The concept of distance between the nodes is not necessarily the physical distance; it can be any other type of cost associated to the links (e.g., price, power loss, or bandwidth).In quantum networks the definition of a cost metric is still an unsettled matter, even so the socalled fidelity of a connection seems to be an unavoidable metric; it measures the quality of an entanglement, providing a measure of the correlation between the qubits of a link.The fidelity is a real number between 0 and 1 (naturally, only values above 0.5 are of any practical value).
The fidelity of a link can be increased by the so-called purification process if more than one pair of entangled qubits exist in that link.This amounts to "merging" two qubits into one with a higher fidelity level, and this process can be iteratively extended by successively merging further entangled pairs (alternatives to this purification process will be detailed later in the paper).Consequently, the highest attainable fidelity in a link is proportional to the number of qubit pairs available in that link.This number of qubits in a link is referred to in the literature as the number of resources in the link, and is of central importance to the problem dealt with in this work.As pointed out in [30], quantum routing protocols should depend on a metric that explicitly takes into account the required fidelities and the purification steps.
Although having a set of different paths connecting a source node and an end node may have a positive impact on the final entanglement of the qubits [33], the objective in this paper is to determine the unique shortest path between any two nodes that guarantees some minimum entanglement fidelity.Previous work suggested that, although not exact, Dijkstra's path finding algorithm could be used, in some cases, to find the best route in a quantum network [34].In some situations, as seen in [34], Dijkstra's algorithm finds the optimal path, however, finding the optimal route that connects two nodes in a quantum repeater network poses more challenges than its classical counterpart.
In [35] the authors considers links with purification and a minimum constraint on the end-to-end fidelity but it does not look at the problem as a multi-objective optimization problem and therefore the found paths are sub-optimal in respect to the bi-dimensional framing of the problem.
One may look at the network models as being an advance generation model (where entanglement pre-exists before routing takes place) and on-demand generation model (where entanglement is created after routing) [35], [36].In this work we deal with an advance generation model, where there is a decoupling between the physical layer and the network layer that makes the routing decision, based on the information it has about the link layer.Beyond the path selection problem, other problems in quantum networks also need to be addressed, such as the scheduling of different services over some previously selected end-to-end path [37].
Moreover, the operation of a link needs to be maintained by taking care of packet losses, which requires specific protocols such as [38] and quantum error correction [39].

B. ROUTING IN QUANTUM NETWORKS
This paper presents an exact algorithm to find the shortest path to connect two nodes in a quantum repeater network that is random in the Erdős-Rényi sense, while attaining a given fidelity.Most importantly, it is shown that solving this problem exactly is not computationally much more expensive than solving the classical shortest path problem.The approach can be seen as an application of multi-objective routing [40], [41], and a predictable consequence of a general algebraic theory for routing [41], [42].Of practical importance is the fact that the presented solution can be combined with works such as [20], [43], [44], which apply sophisticated mathematical tools to perform decentralized routing.
The first step is to characterize the links by the number of entangled qubits (with the required fidelity) available in that connection.This can be seen as the maximum number of qubits that can be entangled between two quantum nodes (one of them may happen to be a quantum repeater) while attaining a certain fidelity after a purification process.What limits in practice the number of resources available in a link depends on the particular hardware implementation: for example, in a quantum repeater network based on nitrogenvacancy centers (NV-centers), both the amount and the quality of the entangled pairs will likely be related to the number and quality of its constituent quantum memories [45], while for an all-photonic implementation of a quantum network the limitation will likely come from the difficulty in generating entangled photon pairs in the first place.In general, the networks' characterization made in this paper is fully compatible with the quantum network stack model proposed in [17].One assumes here that the link layer would communicate to the network layer (which hoovers immediately above the link layer) information about the links' properties.The proposed algorithm, or a variation of it, can then be applied at the network layer to find the best path.
It is relevant to stress the fundamental distinction of the routing problem in classical and in a quantum network.In a classical network paradigm, after having found the best path (in some sense) between two nodes A and B, any connection from A to a third node C that is linked to B can be established by extending the previously found best-path between node A and B, unless a better path exists from A to C. This is not true in a quantum network due to a known feature of quantum repeaters based on entanglement swapping and requiring a purification phase: the number of entangled qubits in each link (in all the links constituting the path between a source-node and an end-node) needs to increase with the total distance of the overall end-to-end chain, i.e., it needs to grow with the number of hops, or the number of quantum repeaters in between) [45].The simple extension of a previously known best path may not be possible in a quantum network since the number of resources sustaining the entanglement of nodes A and B may not suffice to perform entanglement starting from node A and ending in a third node C, through node B. Any extension to a path involves having at least one more hop, and consequently a larger number of resources available in all links right from the departing node A, through node B, and up until node C. In short, extending the path, even by one single additional hop, impacts on the minimum requirements for all the other sections in the path or chain.As a consequence, some of the links become ineligible to be a member of that end-to-end path.
This paper sets the problem in the context of multi-criteria (or multi-objective) routing [40]; in particular, the proposed path-finding algorithm makes use of two parameters to efficiently find the shortest path between two nodes in a static quantum repeater network.This is in strike contrast with other similar problems such as the classical resourcesconstrained shortest path [46] and the Pareto shortest-path problem, both of which are, in general, NP-hard problems [47].In yet another related problem, one can similarly find an algorithm to solve the maximum rate problem in a quantum repeater networks that is also computationally hard, growing factorially with the network size in [48] (in detail: O(N 3 N !L ln L), from [48, corolary 3 and subsequent discussion], where N and L are the number of nodes and links in the network, respectively).In contrast, the herein proposed algorithm solves the shortest path in a quantum repeater network in polynomial time.As it shall be presented, this complexity reduction comes from some embedded mechanisms that discard some low-value paths.However, for a general Pareto shortest path problem there is no guarantee that it is possible to discard enough paths to reduce the complexity of the problem, and such mechanisms were also not taken into account in [48].Although the problem in the present paper is not exactly the one in [48], the proposed solution suggests that the maximum rate problem in a quantum repeater network might also be solvable in polynomial time.How to exactly write such an algorithm will depend on the specific quantum repeater protocol and implementation.
After this introductory section, section II presents a detailed statement of the problem, section III describes the proposed algorithm, section IV presents simulation results that allow one to verify the algorithm's complexity, section V shows that the algorithm can be particularised to specific quantum repeater strategies, and the conclusions are drawn in section VI.A formal proof of the algorithm's complexity is presented in appendix A.
Notation: In the paper, I a denotes a a × a identity matrix and ln(•) is the Napierian logarithm.

II. SYSTEM MODEL AND PROBLEM DEFINITION
Likewise a classical network, a quantum network consists of a set of nodes connected by links (sometimes also referred as sections or hops in a path).In graph theory they correspond to the vertices and the edges of a graph, respectively.A network comprising of V nodes and L links will be considered.A link e ij between node v i and node v j contains a finite number of entangled qubits, n ij , each one with fidelity f ij .Applying this characterization of the network in the context of the stack model of abstract layers proposed in [17], the links would inform the network layer of how many entangled qubit pairs it could entangle, and with which fidelity.The network layer would then find the best path to connect the two nodes.The algorithm here presented can be easily applied to any description of the links between nodes, such as the time required to generate entangled qubits, the probability of entanglement success, or other metrics describing the links.Note that in a practical setup some of the assumed symmetry of the problem may not exist: due to the stochastic nature of entanglement generation and link purification there may exist several entangled qubit pairs with different fidelities in that link.Even so, this system model still captures the essential aspects at stake in the path-finding problem.
In short, the problem is the one of finding the shortest path between nodes v i and v j such that each link holds the minimum resources to create an entangled qubit pair with a goal fidelity f target .In order to achieve this, the considered swapping and purification model imposes that the number of entangled qubit pairs necessary in each of the links must grow with the total end-to-end distance (i.e., the number of sections or hops traversed), as pointed out in [45].The reason for this requirement will be detailed in the next section.

A. PURIFICATION AND SWAPPING STRATEGIES FOR PATH EXTENSIONS
We begin with a brief introduction to how quantum repeaters operate based on quantum purification and swapping.Let one consider two nodes, v i and v k , that are not directly connected but share a neighbor v j , as depicted in step 0 of Fig. 1 (a).The picture also depicts seven additional nodes for which this discussion can be extrapolated.The entanglement of qubits between v i and v k can be accomplished by means of entanglement swapping on the qubits contained in v j , half of which is connected to v i and the other half to v k (these qubits are highlighted by the orange dashed boxes at v j ).The entanglements between v i and v k that result from the swapping operations are represented in Fig. 1 (b) by dashed red lines.Unfortunately, swapping is a lossy operation [20] and the resulting fidelity of these new entangled qubit pairs is lower than the fidelities of the original entangled qubits in the links connecting v i to v j and v j to v k .Even so, this fidelity can be augmented by means of a procedure called purification, which combines multiple entangled qubits between the same two nodes in order to create one single entangled pair with higher fidelity.The mechanism is represented in steps 1 and 2 of Fig. 1 (a): the qubit pairs to be purified are represented within the blue dot-dashed boxes in step 1 of Fig. 1 (a), and the resulting qubit pairs are represented in step 2 by black lines.
The number of entangled qubits necessary for a purification process to recover the original fidelity of the entangled qubit pairs depends on the type of entanglement that is used at the physical layer.Another degree of freedom of the FIGURE 1. Two different quantum repeater strategies: (a) iterations between link purification phases and swapping phases, (b) full link purification applied first in the links, and then followed by swapping processes occurring at each repeater node.
purification process is the ordering in which the purification and swapping operations are applied [20].For that matter, there are two different strategies that can be applied, and which will now be shortly described.Fig. 1 (a) depicts the method that alternates between purification and swapping phases: for each round of swapping and purification, the distance between entangled qubits is doubled (in the sense of number of hops it bridges).
Step zero shows the original network, and the qubits inside the orange dashed box are the ones to undergo the swapping process, leading to the equivalent quantum links shown in step 1.Now nodes v i , v k , v m , v o , and v q are connected by eight lower fidelity qubit pairs, represented by red lines.The entangled qubits of lower fidelity inside the blue boxes can be purified in order to obtain four entangled qubits holding the original fidelities.This is an iterative process that cycles through the rules applied in the first three steps.The remaining represented steps (3 to 6) are analogue to what was described and apply the same rules.The iterations are repeated until quantum entanglement between the end-nodes is attained.In this description one considered that purifying two entangled qubits after a swap suffices to recover the original fidelity.In practice, how much purification is needed in step one will depend on the original fidelity and distance between the two nodes.
Fig. 1 (b) illustrates a different strategy in which purification is first applied to all the qubit pairs in the links (inside the blue boxes) such that the qubits are purified to the highest possible fidelity value, leading to the equivalent single-qubit links represented by dashed green lines in Step 1. Later, in step 2, the resulting qubit pairs undergo swapping operations at all intermediate nodes, eventually establishing the endto-end entanglement between v i and v q with the original fidelity (solid black line).The actual repeater protocols used in a practical systems will likely be a combination of the two aforementioned strategies, complemented by an error correction phase [27], [47].
Regardless of the applied strategy for purification and swapping, once a path that verifies the selection criteria is found, it will consist of a set of links which in general hold different number of resources.Some sections will only have the minimum number of resources but several may have a number above that threshold.Given the larger number of qubits available at those links, one could eventually purify those links to a higher degree.In the first model to be assessed by simulation, here dubbed homogeneous model, all links are purified to the same degree.To illustrate the concept, consider for example a case of a path consisting of four links, where the minimum number of resources is four.A link holding, for example, nine entangled qubits, would still only make use of four qubits in order to attain the desired minimum fidelity, rather than using all the nine pairs of qubits to get a higher fidelity.Under the homogeneous model several sections of a path will have resources underused.For a particular type of quantum repeaters, that waste can be eradicated, leading to the so called heterogeneous model, where the links can be purified to the maximum degree and compensate for some sections with a diminished number of resources.

B. MINIMUM LINK RESOURCES WITH HOMOGENEOUS PURIFICATION
One considers an high-level model of a quantum internet such as the one in [49].A consequence of applying the two described strategies, or a combination of both, is that in the first generations of quantum repeaters the minimum number of resources, R, necessary in each link to connect two distant nodes, scales polynomially (with order α) with the distance d, [27], [45], [49], i.e., with a leading term of the form: ( Let one consider the goal of connecting nodes v i and v j , where a path p with a distance of d p hops is a possible candidate to sustain the entanglement between those two nodes.Furthermore, consider that one of the sections of path p is the link e lm , characterized by having n lm qubits.The link e lm can only be a section of a path connecting node i to j if n lm ≥ R(d p ) α .Without loss of generality, it is possible to simply consider α = 1 One starts by applying (1) to a particular link, which implies that n By simply redefining the resources in each link as ñij n which is equivalent to considering the case with the linear exponent α = 1.This relabeling is possible because the output of the minimum operator is invariant to the α exponent, i.e., min (a, b, c) = (min (a α , b α , c α )) 1/α .In fact, even if R(d) was not of the form (1), it would be possible to apply the inverse function of R(d) and convert it to the form of (2).While the number of entangled qubits might not be an integer number in those cases, one can still accommodate that, as it will be seen in section V. Without loss of generality in what respects finding the best path, it is assumed henceforth that the required number of resources in each link grows linearly with the distance between them, as given in expression (2).

III. ENTANGLEMENT PATH-FINDING ALGORITHM
The no-cloning theorem of quantum physics prohibits the cloning of unknown qubits, that is, when they are in a superposition state, before measurement and the consequent collapse of the state.For that reason no quantum repeater will ever be able to copy qubits.Furthermore, as just seen in section II, the number of minimum resources across all the sections of a quantum path scales with the number of hops.These limitations makes the well-known Dijkstra's algorithm unfit to optimally solve the shortest path problem, making entanglement routing more challenging.Such limitations become glaring even in a very simple network such as the one represented in Fig. 2. In this example, the aim is to connect the source node v s to the target (or destination) node v t .Although the shortest path between vertices v s and v t is p 2 , there are not enough entangled qubits pairs in each of the constituent links of p 2 to establish entanglement from v i to v t making use of the sub-path p 2 .This is because a minimum of three resources is required at all nodes once there are three hops in p 2 to connect v s to v t ).In contrast, albeit being a longer path, p 1 guarantees in all its sections the minimum number of resources to connect v s and v t with the desired fidelity, so that the swapping and purification path-extension technique can be applied.

A. PATH-METRICS' ALGEBRAIC PROPERTIES
According to the formal networking theory of cost metrics defined for paths on graphs, as described in [42], the path metric considered in this work is monotone but not isotone.
Monotonicity is the property of cost metrics that, when a path extension occurs, invariably either increases or decreases, never changing that behavior.Let us look at path p 1 for example; the distance between v s and v j is larger than the distance between v s and v i and the distance between v s and v k is also larger than the distance between v s and v i .If we consider a situation like the one found through p 2 , where the number of resources is insufficient to reach v t from v s , we can assign an infinite distance to the link between these two nodes, and the monotonicity is preserved, given that those two nodes will be treated as if they were disconnected.
On the other hand, isotonicity is a propriety related to the comparison of paths and its meaning will be next defined by means of the example at hand.As hinted in section II, the proposed algorithm has the following multi-objective goal: to find the shortest-path that holds sufficient resources for establishing an end-to-end entanglement.If this metric were isotone, it would mean that since path p 2 is better (in a distance sense) than p 1 to connect v s to v k , then the extended path p 2 would also be better than the extended path p 1 to connect v s to v t .However, as explained before, this is not the case.This has also been pointed out in [48] in relation to finding the path that maximizes the rate transfer in a quantum network, by using the non-classical algebra of [42].
Using the notation of [42], the concatenation of a path p 1 with p , where p by acts as an extension to path p 1 , is denoted as p 1 ⊕ p .Given the aforementioned properties of the path-finding problem, it is useful to define for any path p the following cost metric: Therefore, the problem of finding the shortest path between two nodes with sufficient number of resources, becomes Algorithm 1 Shortest Path Algorithm function SHORTESTPATH(source) A := the set of all admissible paths p i = {d(i), n i , v i } ordered as a priority queue data structure (initialized as {0, ∞, source}).The order is defined by an increasing d(k), with the smallest distance at the top of the priority queue.
B := the set that contains, for each node, a set B[v i ] containing a history of visited paths {d(i), n i } up to date and the paths to be next visited (initialized as B = ∅).
while A is not empty do Select path p u = {d(u), n u , v u } at the top of the priority queue and remove it from A.
if {d(i), the one of finding the path that minimizes the metric d(p).Indeed, this metric is non-isotononic, given that

B. THE PROPOSED ALGORITHM
The central proposition in this work is that in the case of quantum networks relying on swapping and purification, it is possible to solve the multi-objective routing problem while overcoming the non-isotonicity of the cost metric.Furthermore, we achieve this in near-to-linear computational complexity by keeping track of more paths than just the shortest path between nodes.To that end, each possible path p between two nodes v i and v j , is characterized by two parameters: i) the path distance, d p , which amounts to the number of hops (i.e., sections or links), and ii) the distance associated with the smallest number of entangled qubit found along all the links (or sections) of the path, denoted as n min p .Hence, a path p is characterized by the pair (d p ,n min p ).In this framework, a path is only discarded if it does not contain the minimum number of entangled qubit pairs to connect two vertices at distance d p , i.e., when n min p < R(d p ), or when there is unequivocally a worst path than p.In the latter case, there must exist a path p that is shorter and has a larger number of resources than p, i.e., d p < d p and n min p > n min p .The reason why it is possible to discard some paths is that the parameters characterizing each path are isotonic themselves when the other parameter is fixed -this is dubbed partial isotonicity.Let one focus on the distance metric and consider three paths p, p , p ; given any values for n min p ,n min p ,n min p , if d p ≥ d p then one will always have d p⊕p ≥ d p ⊕p , meaning that the parameter d p is an isotonic partial metric.Similarly, it is easy to check that this partial isotonicity also holds for the parameter n min p .Algorithm 1 solves the routing problem from a fixed source node to all the remaining nodes in the network.For a fixed network (i.e., a given topology and a given resources distribution among the links), the algorithm can be run once, before the network starts operating with successive entanglement requests taking place.
The algorithm starts at a source node and then visits all its neighbors.Then the paths are added to a priority queue (set A) that is ordered from the path with shortest distance (places at the top) to the one with the longest one (placed at the bottom).The path at the top of the priority queue is selected and its neighbors are visited.New paths from the source to the visited node are only added to the priority queue is there is no other path from the source to that same node holding an unequivocal better pair of (distance, number of resources).In order to perform this checking, one needs a data structure for each node v i , the B[v i ] sets, that keeps track of all paths from the source to v i that are not objectively worse than the new ones.The ones who are not, are removed from B[v i ].At that point the following binary case unfolds: i) if the current path offers no advantage over the others (i.e., if there is a path in B[v j ] that guarantees both a greater fidelity and a shorter distance), then the current path is immediately discarded and the remaining path with the smallest distance in the priority queue set A is now selected.This process repeats itself until there are no more paths to explore; ii) if this current path offers some advantage, then a set of new paths p l are added to the priority queue set A, corresponding to the extension of p to all its neighbors v l .A more general version of Algorithm 1 is depicted by the flowchart in Fig. 3, where, in addition to the described cost metric, each path also has a fidelity associated to it.This more general approach will be later explored in section V.

IV. SIMULATION RESULTS
The proposed routing algorithm was applied to random quantum repeater networks (of the Erdős-Rényi type) in order to initially assess the algorithm's complexity via computer simulation.Intuitively, the path exploration process should not lead to a complexity explosion given that, when the length of the paths grows, it is increasingly less likely that the minimum required number of entangled qubits exist across all the path such that the target fidelity can be met.For simplicity, one considers a network model with no degreedegree correlation (i.e., two directly connected nodes have independent degrees), and also no correlation between the degree of a node and the number of qubits in each link incident to that node.In this case, the computational complexity scales quasi-linearly with the number of nodes, V , with the following upper-bound, which is derived in section A of the appendix: where k 2 and n 2 respectively correspond to the second moment of the degree distribution (i.e., the distribution of the number of links connected to a node) and to the second moment of the distribution of the qubits across the links.The random networks considered are Erdős-Rényi networks [31], with its degree distribution following a Poisson law.In this network model, the probability that a node v i is connected to k other nodes is given by Also for simplicity, the number of qubits across the network's links are exponentially distributed, being p n ij the probability that n qubits exist in the link connecting node v i to node v j given by In such a network k 2 = k 2 + 1 and n 2 = n 2 .Furthermore, for an Erdős-Rényi network with constant link-to-node ratio, when the network size increases, its diameter (number of hops necessary to connect two given nodes) also increases.
This assumes that the network is operating in the so-called connected regime [31], [49].For the network to remain in the connected regime, it is necessary to increase the number of qubits in each edge when the number of nodes in the network increases.The distances in an Erdős-Rényi network in the connected regime increase roughly logarithmically with the number of nodes [31].This is accounted for by generating networks with n ∝ ln V .In general, the distance in an Erdős-Rényi network grows logarithmically with the network size, or even sub-logarithmically, as a consequence of the smallworld effect [31].Substituting in (8), one obtains a more detailed upper-bound: In fact, the results obtained via numerical simulation for the computation time (which serves as a proxy metric for the algorithm's complexity) exhibited a dependence with the network size, V , lower than (11).As it can be observed in Fig. 4, the computational time increases as O V ln 2 (V ) , which is below the upper-bound in (11).
The average execution time presented in Fig. 4 is computed based on the selection of a percentage P v of the nodes as sources nodes (1% in figures 4(a) and 4(b), and 10% in figures 4(c) and 4(d)).The variance, represented by the shadowed region, is computed using 100 networks for each value of V .

V. HETEROGENEOUS MODEL
The model considered so far can be called homogeneous, in the sense that all links have an equal number of resources, and thus the same fidelity.This section extends the system model to the case where the links concatenated along the full extension of a path between two nodes have heterogeneous fidelities, that is, the different sections along a path are purified to different levels of fidelity.For the analysis of this case, one will consider the second quantum repeater strategy described in section II-A (Fig. 1(b)), in which each link first purifies the qubits ensemble to a desired level and a series of swapping processes are performed across all the nodes of the path.A key difference of the heterogeneous model in respect to the homogeneous one is that some links with larger fidelity will be able to compensate for some links with reduced fidelity along a path.
Algorithm 1 can be modified to take into account both fidelities and path costs explicitly, and solve problems beyond the shortest-path problem, such as the one of finding the cheapest path to connect two nodes with some minimum end-to-end fidelity f target .The cost metric can be associated to different quantities, depending on which metric one wants to maximize (or minimize); in the proposed algorithm, the metric is the number of entangled qubits pairs available in the link.For another set of problems, related to the entanglement distribution rate (EDR), one alternative cost metric might be the time taken in the creation of a new quantum connection.

2.5× 10 5
Network Dimension (V) be harvested from the existing resources in that path, f max p , and ii) the cost, c p , of creating a path with fidelity f target in a certain path p.A path is only discarded if either there are not enough resources in the path, if f max p < f target , or there is a better path p that is "cheaper" and contains more resources, i.e., path p has c p < c p and f max p > f max p .Note that selecting the best combination of fidelity levels at the sections along a path imply solving an optimization problem to find the cheapest way of assuring the desirable end-to-end fidelity.Next, the heterogeneous model will be studied for the case of Werner states, which allow a sufficiently simple mathematical treatment of the concatenation of links via the swapping operation.This is due to the way that the resulting fidelity of the concatenation of two links can be computed.

A. QUANTUM LINKS BASED ON WERNER STATES
To compute the cost c p of creating a link with a certain fidelity, or similarly, to compute the loss in fidelity after a swapping process, the details of the implementation do matter.Additionally, the type of entanglement between the qubits ought to be known.Hereafter one of the most studied types of entanglement considered for quantum networks is assumed: the Werner state [27].The state of two entangled qubits can be fully characterized by its density function [50].In the case of two qubits in a Werner state with fidelity f , the density function can be written as [27] where the following linear transformation is used (see appendix B): The γ parameter is a mere linear transformation of f and therefore they are interchangeable metrics to characterize the fidelity of a Werner state.However, as seen in Appendix B, this alternative characterization of the fidelity allows to compute the end-to-end fidelity in a path p as a simple simple multiplication of the γ ij in the links along the path (this technique is also used in [25]): One first needs to define the cost of creating an entangled qubit pair with fidelity f starting from a large number of entangled qubit pairs, each of which holding an initial fidelity, f in , that is low.It is important to highlight that f in = 1/2 is the lowest value that entangled qubits pairs can have so that they can still have a positive contribution to the purification process.
Fig. 5 illustrates the process of combining pairs of entangled qubits in a nested manner [27], starting with entangled qubits with a fidelity f in = 1/2 + δ, with δ 1, and progressing until the desired fidelity is reached.In the figure, the process starts with six entangled qubit pairs with fidelity f 1 > 0.5 (one purification fails because of this restriction), which are then combined two at a time in order to obtain two entangled qubits with fidelity f 2 > f 1 .In round 2 one starts with two entangled qubits with fidelity f 2 , which are combined to create an entangled qubit with fidelity f 3 > f 2 .For the case of Werner states, it is known that the resulting fidelity from combining two entangled qubits with fidelity f 1 is [27] and this succeeds with a probability of purification It can be shown that the average number of entangled qubits with fidelity f needed to create one entangled qubit with fidelity f 2 is 2/p p , on average.This information can be used to compute how many entangled qubits are necessary, on average, to create one entangled qubit with fidelity f , when starting with an initial fidelity f in across all the qubit pairs.When the fidelity is characterized by the γ parameter defined in (13) rather than by f , the mathematical treatment becomes simpler, as it shall be seen later.As an example, Fig. 6(a) shows that for extremely low values of δ (δ = 10 −8 , 10 −7 , 10 −6 and 10 −5 ) the average number of entangled qubits pairs, N ij , with initial fidelity γ in , that are necessary to create one purified entangled qubit pair with fidelity f scales according to the following approximation For δ = 10 −8 , one has η = 1.17288 ± 0.00056.Fig. 6(a) was generated by applying expressions ( 15)-( 16) recursively until the desired fidelity was reached, while keeping track of the average number of entangled qubits used in each round of purification.The black dashed line exemplifies the scaling law given in (17), with η = 1.17288.The gaps between the points are due to the assumption of an integer number of purification rounds in the nested purification protocol.Naturally, some fidelity values are obtained with a number of purification rounds that is not a power of two.In such cases the purification process needs to be taken beyond that minimum threshold.This can be put in place in a practical manner by means, for example, of three entangled qubits (or other number of qubits) in order to achieve those fidelities without using more qubits than the ones really needed.Note that this procedure would not change the overall scaling.For further simplicity, the number of qubits will be normalized to the number of entangled qubits necessary to obtain an entangled qubit with target fidelity γ target between adjacent nodes, with average so that for n ij = 1, a link e ij can generate one entangled qubit pair with the target fidelity, for n ij = 2 it can generate two entangled qubits with the target fidelity, and so on.Note that, in this context, n ij = 1.5 allows the creation of a single entangled qubit pair with the target fidelity, while the fidelity of the remaining entangled qubit pairs will not be improved.
The number of resources n ij is plotted as a function of ln γ ij / ln γ target in Fig. 6(b), showing that the scaling given by ( 18) is fairly accurate.From now on, n ij stands for the number of entangled qubits in a link, while n c ij is the cost (i.e., the number of resources that is required) of creating one entangled qubit with the desired fidelity.In this framework, a link can only be used for a particular connection if n c ij < n ij .In practice, a measure for the cost of creating a link with a certain fidelity will depend on the particular technology that is used.Nevertheless, the proposed framework is implementation independent, it captures the key scaling problem of this process, and is simple enough to be treated analytically.
The remaining of this section focuses on the computation of the end-to-end fidelity of a path and on how much purification is necessary at each link in order to obtain the end-toend target fidelity.For a Werner state, considering that each section has fidelity γ ij , the end-to-end fidelity is simply as shown in appendix B. At this point one needs to find the cheapest allocation of resources along path p provided that the target fidelity between the source and target nodes is achieved and that no more entangled qubits are used than the ones present in the link.Considering the relation between the number of resources in a link and the fidelity it can attain when purification is applied to that link, the cost of a path p is defined by the following minimization: ) subject to the constraints: i) n c ij < n ij due to the limited number of entangled qubits in each link; ii) ij∈p ln γ −η ij > ln γ target , since the end-to-end fidelity of the entangled qubit pairs has to match the target fidelity.Note that there are different ways of achieving a certain γ target by distributing the fidelities of the links along a path in different manners, which justifies the optimization in (20).This problem can be easily solved by using convex optimization to find the cheapest allocation of resources in each link that allows achieving the required fidelity between the source and the destination nodes through a certain path.Since it is now possible to characterize each path p by its maximum fidelity, f max p , and its cost c p , one can therefore use the algorithm proposed in section III.It can be easily checked that if all links are homogeneously purified to the same fidelity, the scaling of the homogeneous model (η = α) is recovered, meaning that the average number of entangled qubits necessary at each link, N ij , becomes the one defined by (1), equal in all links of a path.
In order to prove the adaptability of the proposed algorithm to different parameters, it was applied to an Erdős-Rényi network with the same features as the one in section IV.The results for complexity dependence on the network size are presented in Fig. 7. Once again one observes a near-to-linear time complexity, which in this case is O(V log 3 V ).The slight increase in the computational complexity in respect to the one in the homogeneous model was expected, since the number of qubits in each edge scales with V as n ∝ (ln V ) η and a convex optimization is made to find the best way of distributing the entangled qubits along the path.The average execution time presented in Fig. 7 is computed based on the selection of a percentage P v of the nodes as sources nodes (1% in figures 7(a) and 7(b), and 10% in the case of figures 7(c) and 7(d)), and the variance, represented by the delimited region, is computed using 300 networks for each value of V .The optimization of the combination of fidelities of each section (associated to a certain purification level) along a path was performed via a convex optimization solver.

VI. CONCLUSIONS
This paper provides an efficient algorithm that finds, for any given source node of a quantum network, a list of all nodes with which it can establish a quantum link with some required end-to-end fidelity, and the respective shortest path to reach that destination node.The proposed multi-objective routing algorithm can be applied to maximize or minimize any path property even if the overall metric is not isotonic, provided that the non-isotonic metric results from the combination of several metrics that are themselves isotonic.The routing problem of finding the shortest path from one source to any other node in the network is solved while considering an end-to-end fidelity constraint, which is an objective that only very recently has been taken into consideration [25], [26].Moreover, the role of purification in enabling a larger number of hops (and thus physical distances) is modeled and considered in the multi-objective path selection mechanism.
This work considers an homogeneous model, with all sections in a path purified to the same degree; and an heterogeneous model, where different sections take full advantage of the existing number of resources they hold, allowing for some sections with a higher fidelities to compensate for lower fidelities in other sections.The proposed algorithm finds the optimal solution in linear time (in respect to the number of nodes in the network).This linearity has been proved both analytically and numerically in the case of the homogeneous model, and for the heterogeneous model a numerical assessment exhibited that same linear growth.

A. FUTURE DIRECTIONS
Interesting questions can be raised regarding the computational complexity of the shortest and other optimal paths in quantum repeater networks: • Could the complexity of these problems depend on the specifics of their implementation?For instance, the algorithm could consider the time required to generate entanglements between end nodes and tackle the problem of finding the path that maximizes the entanglement creation rate.• Could the maximum rate problem be solved with nearto-linear time complexity?The complexity depends on how many paths can be found to be objectively worse than others so that they can be immediately discarded.
The present work is expected to provide a solid foundation to exactly solve more general routing problems encompassing a larger number of parameters, and also to be used in a decentralized routing framework.Nevertheless, the proposed routing solution can be improved and here one provides some future research directions that appear as a natural extension of the present work: • The characterization of the quantum repeater protocol assumed in this work is quite high-level and it could be fleshed out with more details dictated by the underlying technology (e.g., photonic wireless channels, optical fibers).For example, the link resources may be characterized by a probability density function.Moreover, the statistics of the swapping and purification protocols could be taken into account by means of the entanglement times (and therefore the associated rates), as well as the success probabilities of such operations.• The linear complexity of the proposed technique is only analytically proved for the case of the homogeneous model, while in the case of the heterogeneous model that is only conjectured via numerical results.An analytical proof for the latter would be important to derive.• Formulating the homogeneous and the heterogeneous scenarios as a canonical non-linear programming (NLP) could be helpful, so that efficient tools from NLP could be directly applied. .

APPENDIX A COMPLEXITY ANALYSIS
Let L and V be, respectively, the number of links and the number of nodes in a graph.Let also k and n be, respectively, the average number of links connected to a node and the average number of entangled qubits with the required fidelity in the links of the network.n max i denotes the number of resources of the link with more entangled qubit connected to node i.One must note that i) node v i will never be connected to the source node through a path with a length d larger than n max i .Moreover, ii) for a node v i at distance d we can have at most d paths passing trough it.This is because the only surviving paths that connect to it will be ones holding a maximum number of resources n min < d, and only one for each value of n min p = 1, 2, • • • , d.Therefore, the observations i) and ii) lead to the following upper bound on the maximum number of paths going trough a node (i.e., pairs of the form {distance, resources}): where the equality comes from the sum formula of the arithmetic progression.One other, perhaps more obvious, observation is the maximum number of entangled qubits in a link connected to node v i is always smaller than the total number of entangled qubits connected to v i where a ij is the adjacency matrix [31] (with a ij = 0 if there is no connection between i and j, and a ij = 1 otherwise).
Albeit not a tight bound, this is sufficient to show that the complexity of the algorithm scales near-to-linearly with the size of the network.The total number of paths added to the priority queue is then where the first term is the leading one.Applying the Cauchy-Schwarz inequality and the fact that where the degree on node v i equals to k i = j a ij = j a 2 ij .The leading term in (23), by using the inequality (24), can be upper bounded as By considering that there is no correlation between the number of entangled qubits in a link and the degree of the nodes connected by that link, a simpler expression can be derived.Given that the two discrete distributed random variables k i (the degree of a node v i ) and n ij (the resources from node v i to node v j ) are independent, the expected value of the right-hand side of ( 25) is where we used the fact that a i,j = k i (the mean of the values of the incident matrix).Therefore, the number of surviving paths is of the order: In order to estimate the time efficiency of the algorithm one also needs to incorporate the time spent adding and removing an element from a binary min-heap.It is known that for a binary min-heap with M elements, it takes a time O(ln M ).Since the maximum number of elements in the set A is the maximum number of paths, P , the total time of all priority value updates is Since the binary min-heaps at each node are always smaller than the binary heap A, by using ( 27) and ( 28), the running time can be upper bounded by where the last term is the time necessary to initialize the set B. For networks in the connected regime one can simply consider Let us consider two entangled qubits pairs, connecting nodes v 1 and v 2 and nodes v 2 and v 3 , all in Werner states form [27]. Node v 2 will contain two qubits, one at each end of the link: one qubit denoted as 2a, entangled with the qubit in node v 1 , and qubit 2b, entangled with the qubit in node v 3 , as exemplified in Fig. 8.This system can be described by the following state: By performing a Bell measurement on the two qubits at node v 2 , depending on the result of the Bell measurement, one of the following four different states can be obtained with probability 1/4: where φ ± and ψ ± are the states forming the Bell basis [50].These four states can be converted to the form of expression (12) using local operations and classical communication, with γ = γ 12 γ 23 .Note that this corresponds to an entangled state between the qubits in nodes v 1 and v 3 .From this elementary swapping operation it is straightforward to extrapolate the general rule of a quantum repeater chain p with any number of links.One considers a quantum repeater chain where all entangled qubits are in a Werner state with fidelity f ij = (3γ ij + 1)/4.By performing a Bell measurement on intermediate nodes and performing local operations and classic communication, the final state will be a Werner state with fidelity f p = (3γ p + 1)/4, where γ p is given by (19).

FIGURE 2 .
FIGURE 2.Example of a small network for which a classical shortest path algorithms cannot find the shortest path between the source node vs and and target node vt.
end if end while end function p t := path p u ⊕ v t n pt := min (n u , n ut ) n ut := available resources in the link v u − v t .

FIGURE 3 .
FIGURE 3. Flowchart for the proposed algorithm.

FIGURE 4 .
FIGURE 4. Average execution time of Algorithm 1 as a function of the size of the network, V , fitted to the expression time = a × V ln(V ) 2 , with α = 1, and for different pairs of average degree k and a fraction of sampled nodes Pv.The fitting constant a is given on the plots.

FIGURE 5 .
FIGURE 5. Example of a nested purification protocol.

FIGURE 7 .
FIGURE 7. Average execution time of Algorithm 1 and the corresponding variance per number of vertices V applied to the heterogeneous model, fitted to the expression time = a × V ln(V )3 , for different pairs of average degree k and fraction of sampled nodes Pv.In all simulations n = β ln V α , with α = η.The fitting constant a is given on the plots.

SARA
SANTOS obtained her BSc degree from Instituto Superior Técnico, University of Lisbon, Portugal in 2019 and her MSc degree in Physics at École Polytechnique Fédérale de Lausanne (EPFL), Switzerland in 2022, where she is currently a doctoral assistant at the Laboratory of Theoretical Physics of Nanosystems (LTPN).She was a Calouste Gulbenkian scholar at Instituto de Telecomunicações, Lisbon, Portugal, in 2018/2019.FRANCISCO A. MONTEIRO (M'07) is Assistant Professor in the Dep. of Information Science and Technology at Iscte -University Institute of Lisbon, and a researcher at Instituto de Telecomunicações, Lisbon, Portugal.He holds a PhD from the University of Cambridge, UK, and the Licenciatura and MSc degrees in Electrical and Computer Engineering from IST, University of Lisbon, where he also became a Teaching Assistant.He held visiting research positions at the Universities of Toronto (Canada), Lancaster (UK), Oulu (Finland), and Pompeu Fabra (Barcelona, Spain).He has won two best paper prizes awards at IEEE conferences (2004 and 2007), a Young Engineer Prize (3rd place) from the Portuguese Engineers Institution (Ordem dos Engenheiros) in 2002, and for two years in a row was a recipient of Exemplary Reviewer Awards from the IEEE Wireless Communications Letters (in 2014 and in 2015).He coedited the book "MIMO Processing for 4G and Beyond: Fundamentals and Evolution", published by CRC Press in 2014.In 2016 he was the Lead Guest Editor of a special issue on Network Coding of the EURASIP Journal on Advances in Signal Processing.He was a general chair of ISWCS 2018 -The 15th International Symposium on Wireless Communication Systems, an IEEE major conference in wireless communications.BRUNO C. COUTINHO obtained his PhD in Physics from Northeastern University, USA, in 2016, and both his BSc.and MSc. in Physics, from the University of Aveiro, Portugal, in 2009 and 2011, respectively.Since 2017 he is with the Physics of Information and Quantum Technologies Group, at Instituto de Telecomunicações, initially as a postdoc and later as a Research Fellow.YASSER OMAR studied Physics at Instituto Superior Técnico (IST), University of Lisbon, Portugal, and obtained his PhD in Physics at the University of Oxford, UK.Currently, he is associate professor at IST.He is also the founder and leader of the Physics of Information and Quantum Technologies Group, at CeFEMA-IST and PQI -Portuguese Quantum Institute, and director of the Doctoral Program in the Physics and Mathematics of Information, at IST.