<p>Communication networks are exposed to internal or external risks that can affect all or part of the system. The most important components that form the infrastructure of these systems are routers, which act as nodes. In the field of graph theory, there are sophisticated techniques that can be used to optimize the path of a packet as it travels through various routers from its origin to its destination. A notable example of such an algorithm is Dijkstra's algorithm, which is designed to efficiently determine the shortest path. The algorithm works under the assumption that the system operates under ideal conditions. Real-time systems can perform better if risk factors and optimal conditions are taken into account. The relationship between the nodes can be expressed by various metrics such as distance, delay, and bandwidth. The aforementioned metrics facilitate the calculation of the optimal path, with the ultimate objective of achieving low-latency networks characterized by rapid response times. Round-trip time (RTT) can be employed as a metric for measuring enhancements in a range of latency types, including those associated with processing, transmission, queuing, and propagation. The use of Z-numbers was employed in this study to incorporate risk into the optimal path metric. RTT was the preferred metric and reliability was represented by fuzzy linguistic qualifiers. A comparison of several scenarios was shown using a numerical example of a communication network. It is expected that this study will have a significant impact on the evolution from models that consider only ideal conditions to real-time systems that include risks using Z-numbers.</p>