# A Dynamic-Routing Algorithm Based on a Virtual Quantum Key Distribution Network
## 1 Introduction  
Quantum key distribution (QKD) is an encryption technology based on quantum communication, the purpose of which is to ensure that neither party has to worry about eavesdropping or tampering when exchanging keys [1, 2, 3]. It includes the QKD network architecture, quantum key pool (QKP), and quantum key relays to form a complete and secure quantum communication-based cryptosystem [4, 5, 6, 7]. Quantum algorithms are exponentially faster than other algorithms because they can exploit properties such as quantum superposition and quantum entanglement to achieve parallel computation and information processing on some specific issues, thereby achieving exponential acceleration. However, there are still challenges to be addressed in this area to improve security and efficiency further. To this end, researchers have proposed various QKD routing algorithms for establishing reliable information transmission and efficient network topologies [8]. In domestic and international research, in 2014, [PERSON] [9] proposed a QKD routing algorithm based on quality of service and experimentally validated it using software-defined networking (SDN) technology. In the same year, a novel QKD routing algorithm based on graph theory was proposed in the literature [10], which achieved fast routing via the construction of a topology graph, aiming to reduce communication delays and improve the network performance. In addition, the authors of reference [11] investigated an approach based on hierarchical routing algorithms to optimize packet transmission paths and reduce communication delays and critical resource consumption by improving routing algorithms. In 2016, the authors of reference [12] proposed a routing scheme combining a hybrid distance vector and shortest path algorithms to find feasible paths faster by optimizing the network topology and path selection. However, the literature needs to adequately discuss the possible delays between network nodes, which may affect the actual operation of the network. Furthermore, in 2020, the authors of reference [13] proposed an improved QKD routing algorithm that employs reinforcement learning ideas and applies them to routing decisions to improve the security and performance of the system. However, the literature did not compare and analyze it with other existing QKD routing algorithms; thus, its advantages and limitations among similar algorithms could not be determined. In 2023, the authors of reference [14] investigated the use of QKD routing algorithms to achieve security and privacy in resource allocation in resource-sharing environments, such as cloud computing. The study proposed a resource-allocation framework that can effectively support the distribution and management of resources. However, the study did not consider alternative key management strategies and poses security risks. Although mature QKD routing methods from various perspectives are available, further improvements and optimizations are needed in practical applications, especially in terms of cost reduction, improved communication quality, and critical distribution efficiency. To solve the critical shortage problem, we designed a resizable QKP scheme through QKP technology. The system can adjust the key pool size according to the demand, reducing the cost and mitigating the risk of key shortage. Secondly, this paper uses Bayesian formulae to calculate the link-blocking probability based on the node-blocking chance. It uses a new dynamic routing algorithm that combines the remaining key quantity and the link-blocking opportunity to improve the communication quality and key transmission efficiency. The quantum bit error rate (QBER) is used to assess the quantum channel quality, the quantum bit emission rate is related to the distribution efficiency, and the quantum key generation rate reflects the efficiency and availability of the distribution process.