## 1 Introduction  
Fifth-generation (5G) networks allow for high-speed data transmission and a wide range of services for numerous users, ensuring high quality of service (QoS) [1, 2, 3]. The three main scenarios considered are enhanced mobile broadband (eMBB), massive machine-type communication (mMTC), and ultra-reliable low-latency communication (URLLC) [4]. Beyond 2030, the sixth-generation (6G) network is anticipated to address the need for global coverage; improved spectral, energy, economic efficiency; and enhanced security. To meet these requirements, novel technologies and systems need to be supported on the radio interface and core network, incorporating multiple access, channel-coding schemes, multi-antenna technology, cell-less architecture, cloud/fog computing, and network slicing [5, 6]. Network slicing is a comprehensive concept that encompasses both network and cloud slices, including radio access, transport, and edge computing network [7, 8]. It allows for the deployment of multiple logical, autonomous, and independent network resources, as well as network and service functions, on a single infrastructure platform. Through this management mechanism, resource providers can allocate logically isolated network slices to users, each designed and optimized for specific requirements (e.g., one for cellular communication, another for the Internet of Things (IoT)). Network slicing assumes three business roles: (i) network slice provider (network operator), which is the resource owner and provides the network slice instance; (ii) network slice service provider (communication service provider), which is responsible for providing services to its users; (iii) network slice service user (communication service customer), which uses the provided services [9]. The interactions between two business roles are handled through service-level agreements (SLAs), as shown in Figure 1.  
The question of organizing resource reallocation in 5G network slicing has been addressed in recent research papers. For a review of these works, please refer to Section 2. This paper focuses on modeling and analyzing resource capacity planning and reallocation for network slicing between two providers transmitting elastic traffic, such as during web browsing. The controller sends signals to determine the need for resource reallocation and to plan new resource capacity. A Markov decision process (MDP) is utilized in a controllable queuing system to find the optimal resource capacity for each provider. The reward function incorporates three network slicing principles, including maximum matching for equal resource partitioning, maximum share of signals resulting in resource reallocation, and maximum resource utilization. An iterative algorithm is used to find the optimal resource reallocation policy, and the results are numerically illustrated for two services: web browsing and bulk data transfer. The main contributions of our study are as follows:  
* Innovative mathematical framework. We propose a mathematical framework based on queuing theory and MDP. This framework incorporates three weighted principles: maximum matching for equal resource partitioning, maximum share of signals for resource reallocation, and maximum resource utilization. This multi-principle approach is novel in the context of 5G network slicing, providing a comprehensive and flexible foundation for resource capacity planning. * Efficient algorithm development. An algorithm was developed to efficiently compute the optimal resource capacity planning policy. This algorithm leverages [PERSON]'s iteration, starting with maximum resource utilization as the initial point. The efficiency and effectiveness of this algorithm contribute to the novelty of our work, ensuring practical applicability in the dynamic environment of 5G network slicing. * Numerical analysis and insights.