Optimizing Content Placement and Delivery in Wireless Distributed Cache Systems Through Belief Propagation

Wireless distributed cache system (WDCS) is a promising technique to offload traffic and improve energy efficiency in content-centric networks. In this paper, the content sharing problem is considered by minimizing the average energy consumption for content caching and delivering in device-to-device (D2D) enabled cellular networks. The problem is formulated as a joint optimization problem of multiple interactive variables, which is NP-hard. In order to solve this problem, we first decompose the original problem into three subproblems, which are content helper (CH) selection, content caching, and content delivering. Specifically, in CH selection, we propose a PageRank based distributed algorithm to estimate the centrality of mobile users (MUs) by jointly analyzing their social relationships and channel conditions. Based on the selected CHs, the content caching and content delivering are formulated into two weighted matching problems. Two belief propagation (BP) based distributed algorithms are then proposed by considering content popularity and channel states to solve the aforementioned problems. Furthermore, based on the correlation of the three subproblems, a heuristic-based alternating iterative optimization method (HAIOM) is proposed to improve the average energy consumption performance of the content delivering of the WDCS. Simulation results show that by jointly optimizing the CH selection, content caching, and content delivering, the proposed scheme is capable of reducing the average energy consumption and the average content delivery delay, as well as of increasing the caching hit ratio.


I. INTRODUCTION
With the explosive growth of user equipment, the enormous volume of data spouted by the various multimedia services imposes a huge burden on the current wireless networks [2]. Deploying additional base stations (BSs) or improving throughput in the physical layer may no longer catch up with the pace of the rapid growth of the mobile data demands [3]. Thus, wireless caching is now considered The associate editor coordinating the review of this manuscript and approving it for publication was Ilsun You . as a potential key technology to solve this problem in the evolution of 5G [4]- [6].
Caching the content items close to the mobile users (MUs) can not only reduce bandwidth cost [7], [8], content delivering delay [9], [10], and energy consumption [11]- [13], but also offload the burden of BSs [14]- [16]. Moreover, new applications that require higher bandwidth, lower latency, and less power consumption in 5G networks, such as virtual reality, vehicular communications, and drone communications, aspire to wireless caching as a promising technology [17]. Furthermore, the flourishing online social network provides a solid support for tracing the interactive behaviors among MUs and characterizing the MUs preference of services, which is the essence of predicting the MUs' behavior and the content popularity in caching-aided content delivering networks [4]. However, since the volatility of spatio-temporal traffic and mobility of MUs, the wireless caching technique is still surrounded by three main lameness [17]: (i) where to cache; (ii) what the caching strategy is; and (iii) how to deliver content items.
Caching at higher layers, e.g., cloud units and BSs, or caching close to the MUs, e.g., femtocells, and deviceto-device (D2D) equipment, can decrease the content delivering delay and improve throughput gain of the networks. The work in [18] investigated the content caching problem in BS, showing that the caching hit ratio can be improved by optimizing the caching strategy. Considering the average content delivering rate, the authors in [19] argued that the joint optimization in caching locations, including original content servers, central cloud units, and BSs, can significantly enhance the performance of the average content delivering delay and the traffic reduction ratio in both backhaul and fronthaul. To further reduce the content delivering delay, as well as improve the energy efficiency and spectral efficiency, caching the popular content items on D2D equipment was studied in [20], [21]. Furthermore, considering the spatial reuse, the authors in [22], [23] argued that the throughput gains can be significantly improved in caching-enabled wireless networks.
Caching strategy optimization can also improve both network performance and user experience on a large scale. Generally, the caching ability of the caching devices in wireless communication systems is always limited by their caching capacity, thus, optimizing the content placement is crucial [24]. Aiming at caching popular content items in MU devices, the work in [25] proposed a hypergraph-based content storage optimization strategy in a wireless distributed cache system (WDCS). Considering the physical layer transmission models and content popularity in MUs, the work in [26] proposed respectively a submodule based centralized algorithm and a belief propagation (BP) based distributed algorithm to investigate the content placement strategies in fog radio access networks (Fog-RANs). The authors in [27] investigated the caching size minimization problem at BS by optimizing the caching strategy. To further investigate the caching benefits, the work in [5], [22], [23] analyzed the throughput-outage tradeoff to leverage coded caching in 5G system.
Due to the limitations of radio resources, optimizations on content delivering strategy are significantly focused on reducing the delay and the co-interference. To minimize the network delay, the work in [28] proposed a congestion game based distributed content delivering strategy. The work in [29] proposed a heuristic algorithm to optimize the D2D pairing and reuse the spectrum based on the geographic distance between D2D users. Further, spectrum sharing between D2D links and cellular users was investigated in [30].
By proactively caching popular content items in BSs, relays, and D2D users, the paper [31] analyzed average ergodic rates and average outage probability in downlink for different content delivering cases and showed that global throughput and delay performance can be improved significantly.
On the other hand, the joint optimization of content caching and delivering has become an effective method to further improve the network performance by which the network states, such as caching capacity, content popularity, physical link conditions, and remaining power, are comprehensively considered [20]. To minimize the content delivering delay, the authors in [32] modeled the interrelated cross-layer content caching and delivering problem as a two-stage optimization problem. Considering the asynchronism of popular content items in caching-enabled D2D networks, the work in [22], [23] investigated the joint caching and delivering strategy by maximizing the number of active D2D pairs through spatial reuse.
Specifically, WDCS can significantly enhance network performance by leveraging the available caching capacity of both BS and MU devices. Different from the aforementioned works, this paper jointly considers the determination of content helpers (CHs) among MUs along with the strategy optimizations of content caching and delivering in the WDCS. To minimize the average energy consumption for the WDCS, the joint optimization problem involving multiple interrelated variables is formulated as a fractional programming problem which is NP-hard. To conquer the difficulty, content popularity, social relationships, caching capacity, and channel conditions are simultaneously considered for problem optimization in our work. Thus, the original problem is decomposed and then solved in a distributed manner.
The contributions of this paper are summarized as follows: 1) We investigate the problem of cellular traffic offloading to minimize the average energy consumption in WDCS and propose a heuristic-based alternating iterative optimization method (HAIOM). As the considered problem is NP-hard, we decompose it into three subproblems: CH selection, content caching, and content delivering. 2) To help select CHs with high centralities from MUs, a PageRank based distributed algorithm is proposed to estimate the user centrality by jointly considering the MUs' mobility, social relationships, and channel status in real-time.
3) The subproblem of content caching is transformed into a weighted many-to-many matching problem and we propose a BP based distributed algorithm which leverages caching capacity, content popularity by message passing and exchanging. 4) Similarly, based on the optimized content caching, another BP based distributed algorithm is developed for content delivering to solve the one-to-many matching problem between CHs and CRs, which considers the caching states of the CHs and the quality of physical channels. The remainder of this paper is organized as follows: System model and problem formulation are introduced in Section II. Section III decomposes the original problem into three parts, each of which is analyzed and solved, respectively. The HAIOM and complexity analysis are derived in Section IV. Simulation results are presented in Section V. Finally, Section VI concludes this paper.

A. SYSTEM MODEL
As shown in FIGURE 1, we consider a wireless content sharing network consisting of one BS and M MUs, where each MU can be served in either a D2D mode or a cellular mode. Hence, MUs can serve as CHs to cache popular content items or can act as content requesters (CRs) for acquiring desired content items from BS or CHs. Assuming that BS and CHs work in an open-access model for a WDCS [33]. In the WDCS, popular content items are cached on the CHs based on their capacity and the requests of the related CRs. Our goal is to minimize the average energy consumption of delivering content items to CRs by jointly optimizing (1) CH selection, (2) content caching, and (3) content delivering. Then the best service can be provided to CRs.
Let U = {u 1 , u 2 , . . . , u M } and C = {c 1 , c 2 , . . . , c N } denote the set of M MUs and the set of N popular content items requested by MUs, respectively. Due to the mobility of MUs, the quality of physical channels, and the capabilities of MUs' equipment, CHs are required to be carefully selected. In practice, the caching capacity of the MUs is usually limited. Therefore, in order to increase the caching benefit of the WDCS, the content items with high popularity are cached in CHs. For example, c 3 and c 5 are cached in u 6 shown in FIGURE 1. The popularity of the content items which can be estimated by some learning procedures [34], [35] is assumed to be known. Since a user can act as CH and CR at the same time, all MUs are assumed to work in Time Division Duplex (TDD). Moreover, we prescribe that each user must first fulfill its own needs.
Without loss of generality, we assume that the BS and all the MUs can be regarded as CH candidates (CHCs). We use The strategy of selecting CHs from CHCs can be denoted as a vector π , where π i = 1 if h i is selected as CH, π i = 0, otherwise. Since BS provides service for all CRs, we always have π 0 = 1. Therefore, there are two ways to deliver content items to CRs: 1) deliver content items to CRs directly from CHCs, 2) CHs as relays to help BS deliver content items to CRs. Let X = {x i,n |h i ∈ H, c n ∈ C} denote the content caching matrix, where x i,n is the binary content caching variable of h i . Here the content delivering matrix, where y i,j is the binary variable between h i and r j . Clearly, y i,j = 1 if r j is connected to h j . Otherwise, y i,j = 0. Thus, our goal is to jointly optimize π, X, and Y for performance improvement of the WDCS.
The communication link switching from content providers to CRs will not only give rise to huge signaling and energy consumption, but also occupy too much time slot resources which will block user pairing and reduce content sharing ratio. Moreover, it leads to increased consumption of computational resources. Therefore, to make the scenario more practical, three basic principles must be predefined. First, parts of MUs, who have free capacity to cache popular content items and are willing to share the cached content items to their peers, are selected as CHs. Second, each CR can be served by only one specific CHC in each content delivering interval. Third, the CHs are working as content providers when they have cached the requested content items, while they are working as relays between BS and CRs under the situation that they don't cache the requested content items.
To evaluate the quality of physical links, channel state information (CSI) is required. It is impractical and costly to acquire instantaneous CSI due to the frequent information updates. Consequently, this work considers statistical CSI. Let g m,v and g B,m denote the channel gains from u m to u v and from the BS to u m , respectively. Similarly, denoted by l m,v the interference links from u m to u v . We assume the Rayleigh fading such that the channel power gains are exponentially distributed. The mean values of g m,v , g B,m , and l m,v are denoted by α m,v , α B,m , and β m,v , respectively. Furthermore, let σ 2 N denote the power of the additive white Gaussian noise (AWGN). To facilitate analysis, the necessary notations and symbols are summarized in TABLE 1.

B. PROBLEM FORMULATION
In this part, we formulate the minimization problem of the average energy consumption for the popular content sharing in the WDCS. In general, MUs in U request content items with specific probabilities based on their preference profiles. Let us record the set of CRs as R = {r j } M , where the corresponding MU of r j in U is u m with j = m. Denote p j,n , where r j ∈ R, c n ∈ C, to be the content item's popularity in CRs, i.e., the r j will request c n with the probability p j,n . The content items' preference of each CR are normalized, so that we have c n ∈C p j,n = 1.
Assuming that the CHs spontaneously share content items with the CRs within their service range as well as any CR can be served by the CHs adjacent to it, the service relationship between h i and r j can be denoted as the binary constant s i,j . Clearly, s i,j = 1 if r j can be served by h i . Otherwise, s i,j = 0. The CRs can be served by BS, and the CHCs are always within their own service ranges. Therefore, we have s i,j = 1 if i = 0 or i = j and i ≥ 1. Clearly, at least one CHC can be used to provide service for r j . However, if a CR is within the service range of multiple CHs, once the CR is assigned to be served by one specified CH, the other CHs will interfere with the assigned communication. Thus, the data rate from BS to h i can be expressed as where B 1 and P B denote the bandwidth and transmission power of the BS, respectively. Furthermore, the data rate from h i to r j can be expressed as where B i is the bandwidth of h i , and P i is the transmission power of u i . Thus, the average content delivering energy consumption that h i acts as a content provider of r j can be expressed by using the following two cases. π i x i,n p j,n P i M n R i,j with M n being the size of c n in bits. Case2: h i doesn't cache the requested content items and acts as the relay between BS and r j to forward content items to r j . The average content delivering energy consumption for this case, denoted as E 2 i,j , can be classified into three types as well: i) h i is BS, i.e., i = 0, where we have E 2 i,j = 0, ii) h i is the CR and it doesn't cache its requested content items, i.e., i ≥ 1 and i = j, where we have π i x i,n p j,n P B M n R i,j , iii) h i acts as the relay between BS and r j , i.e., i ≥ 1 and i = Based on the above two cases, the average energy consumption for delivering content items from h i can be denoted as Denote χ = {χ m } M , where u m ∈ U and u m ∈U χ m = 1, to be the centrality vector of MUs. To illustrate the influence VOLUME 8, 2020 of MUs' centrality on content sharing, a serviceability index denoted by η i,j , is used to indicate the service utility when r j is served by h i , where we have otherwise. (4) The minimum required SINR ξ min i,j between h i and r j can be defined as where ξ C min and ξ D min are the required minimum SINRs of cellular users and D2D users, respectively.
In order to further facilitate the system performance of the WDCS, the joint optimization of CH selection strategy π, content caching strategy X, and content delivering strategy Y is required. Thus, with the goal of minimizing the average energy consumption of delivering the desired content items to CRs in the WDCS, the joint optimization problem is formulated as where C i is the caching capacity of h i , S i is the maximum number of CRs allowed to access to h i , and ξ i,j denotes the achievable SINR from h i to r j . It is worth to point out that S i ≤ S, where S is the maximum number of CRs that can be served by one CHC at the same time. Constraint (6b) indicates that the CHCs having neighboring CRs can be selected as CH. Constraint (6c) indicates that the total size of content items cached in h i is within its caching capacity. Constraint (6d) ensures that each r j can be served by a single CHC. Constraint (6e) demonstrates that the number of CRs severed by h i is equal to the sum of binary association variables taking the value of one, and cannot exceed its maximum value S i . Here, i denotes the total number of CRs that served by h i . Constraint (6f) shows the system SINR limits and constraint (6g) implies that π i , x i,n , and y i,j are binary variables.
Since the binary constraints π , X, Y , and the corresponding attribute requirements on multiple interrelated variables are blended together, which definitely renders the problem even more complicated, obtaining the optimal solution is naturally found to be very difficult and time-consuming. In fact, the original problem involving joint optimization of CH selection strategy, caching strategy, and delivering strategy is a three-stage problem and each stage is affected by the results of the other stages. Therefore, the original problem (6) needs to be decomposed for simplicity.

III. PROBLEM DECOMPOSITION
According to (6), the average energy consumption minimization problem involving the joint optimization of multiple interactive variables with the coupling multiplicative property is proved to be NP-hard [36]. However, according to the concept of three-stage sequential optimization, which contains establishing the WDCS, caching the content items, and delivering content items, the original problem (6) can be decomposed into subproblems of CH selection, content caching, and content delivering. Simultaneously, a PageRank based distributed algorithm is first designed for CH selection and two BP based distributed algorithms are developed to solve the content caching problem and content delivering problem, respectively.

A. CH SELECTION
Since the content caching and delivering are based on the selected CHs, the problem of CH selection is investigated for improving network benefits [22], [23], [37]. Let E S i,n,j denote the reference quantity of energy consumption level of delivering c n from h i to r j , we have In order to minimize the reference quantity of energy consumption level shown in (7), the optimization problem based on (6) of CH selection can be expressed as Intuitively, in order to minimize E S i,n,j , the MUs with high centrality and high channel quality should be selected as the CHs. Specifically, since the MU with high centrality possesses a high probability for peer discovery, high willingness to work with others, high capacity in terms of data transmission volume and frequency [38], selecting the MUs with high centrality to be CHs can improve the performance of resource allocation significantly [39]. Therefore, instead of solving the original problem (8) directly, we propose a PageRank [40] based distributed algorithm for selecting CHs.
Since the sociality of MUs plays an important role in cooperation, content sharing, traffic offloading in D2D communication enabled cellular networks [41], [42], our goal is to derive the centrality of MUs by considering the connections based on physical link quality and social interaction among them. Similar to the work in [43], [44], the probability that u m and u v can establish a steady D2D link, denoted by µ m,v , can be derived as where γ m,v = P m g m,v /σ 2 N , ζ is the average interference power of the cell system. τ m,v is the average contact duration between u m and u v , and ϑ is the size of the data packet that can be transmitted at one time.
Assuming that the D2D link between u m and u v is valid if the condition µ m,v ≥ µ min holds, where µ min is the minimum probability requirement. Thus, the MU set that can form a steady D2D pair with u m can be denoted by Meanwhile, the transition probability vector of u m can be denoted as Let the transition probability matrix of D2D link among MUs be denoted as W = {W m } M . Then, based on the PageRank algorithm, the centrality of all MUs in U can be obtained as where t is the number of iterated operation step and d is the damping factor for the convergence of iterated operation.

Algorithm 1 PageRank Based Distributed Algorithm for CH Selection
: the convergence factor. begin Step 1: Calculate W m using (11) in each MU.
Step 2: Calculate the centrality of MUs.
1) The BS transmits χ(t) to each MU; 2) Each MU calculates its own centrality using (12), and then transmit it to the BS. until |χ(t + 1) − χ(t)| ≤ ; Step 3: Optimize π by using (13), and then select CHs according to π * obtained by (14) in the BS. end Denote χ min to be the minimum value requirement of MUs' centrality that can be selected as CHs. Thus, we have Further, any CH must provide service for at least one CR based on the constraint (6b). Then, the CHs can be determined by In summary, the detailed PageRank based distributed algorithm for selecting the most appropriate CHs is summarized in Algorithm 1.

B. CONTENT CACHING
After the CHs and CRs have been determined by the CH selection, content caching and content delivering are considered. In fact, the MUs can be marked as CHs, or CRs, or both CHs and CRs, we assume that being CHs has absolute priority for these MUs labeled both CHs and CRs. To guarantee the CHs, also marked as CRs, can obtain their desired content items, we prescribe that they can also act as CRs at the same time. Thus, the MUs can be divided into CH set and CR set clearly.
First, a fixed content delivering strategy denoted as Y * is given, so that the problem (6) can be regarded as a content caching problem. Since the BS caches all the popular content VOLUME 8, 2020 items, we have x i,n = 1 for n = 1, 2, . . . , N if i = 0. Thus, the energy consumption of delivering c n from h i to r j for the fixed content delivering strategy Y * can be expressed in (15), as shown at the bottom of the previous page. Thus, for a given content delivering strategy, the optimization problem of content caching based on (6) can be formulated as In our scenario, each content item can be cached in different CHs and each CH can cache multiple content items at the same time. Thus, the problem of content caching can be regarded as a many-to-many weighted matching problem, which is NP-hard [45] for the cross-layer interaction. Considering the time efficiency and computation efficiency, we propose a distributed algorithm by using the BP framework. Before that, the max-product BP algorithm, which has been deferred to APPENDIX A, is introduced.
Clearly, content popularity, physical link conditions, and caching capacity are simultaneously considered in the problem of content caching (16). To apply BP method [46], two types of factor functions are defined as Here, as shown in FIGURE 2(a), ψ n,j is used to characterize the energy consumption level of r j when downloading c n with a feasible caching strategy X for the fixed content delivering strategy Y * , and φ i is used to demonstrate the caching capacity constraint. Then, as shown in FIGURE 2(b), the many-tomany weighted matching problem of content caching can be reformulated as In order to solve the problem (19) by using the standard BP algorithm, the factor graph shown in FIGURE 2(b) should be mapped into the standard factor graph, as shown in FIG-URE 2(c). The mapping rules can be defined as |C a | + ε(n, j), where C j = {c n |p j,n > 0} is the content item set requested by r j , |C j | is the element number of C j , and ε(n, j) is the index of c n in C j . Based on the standard factor graph shown in FIGURE 2(c), we can infer that the message update denoted as θ k→l from the variable z k to the function ϕ l can be obtained from (33). However, the message update, denoted as ρ l→k , which is from the function node ϕ l to the variable node z k , can be calculated by using (34). Thus, the message update of ρ t+1 l→k can be derived as (44). The detailed derivation of formulation (44) is given in APPENDIX B. Therefore, the belief estimation of z k in each Algorithm 2 BP Based Distributed Algorithm for Strategy Optimization of Content Caching Y * : the fixed content delivering strategy. : the converging factor. T c : the maximum number of iterations. begin Step 1: Calculate η i,j using (4).
Step 2: Calculate E D i,n,j based on the fixed content delivering strategy Y * using (15).
Step 3: Map x i,n to z k and ψ n,j , φ i to ϕ l using (20) and (21), respectively.
Step 4: Estimate the variable z k .
Calculate θ t k→l using (33), end end for l = 1 : L do for k = 1 : K do Calculate ρ t l→k using (44), end end for k = 1 : K do 1) Calculate b t k using (39); 2) Calculate z t k using (22). end until |ρ t+1 l→k − ρ t l→k | ≤ and |θ t+1 k→l − θ t k→l | ≤ or t = T c ; Step 5: Map z t k back to x i,n using (20). end interaction can be obtained as Thus, the content caching problem of (16) can be solved by mapping z k back to x i,n by using (20). Finally, the BP based distributed algorithm is summarized in Algorithm 2.

C. CONTENT DELIVERING
After the content caching strategy has been determined, the problem of content delivering needs to be optimized next.
Similarly, we assume that the caching strategy X * is known, then the problem (6) becomes a content delivering problem. Let E C i,n,j denote the energy consumption of delivering c n from h i to r j for the fixed content caching strategy X * , (23), as shown at the bottom of the previous page can be obtained. Thus, under the circumstance, the optimization problem of content delivering based on (6) can be expressed as Since each CR can be served by a single CH, the problem (24) is a one-to-many weighted matching problem, which is impossible to obtain the optimal solution because it has the form of fractional programming. Thus, a BP based distributed algorithm is proposed to obtain the content delivering strategy. In the considered scenario, the CRs choose to access suitable CHs based on the content items preference, the content items cached in CHs, and the channel quality status between CRs and CHs, as shown in FIGURE 3(a). To apply the BP algorithm, the factor graph FIGURE 3(b) should be mapped into the standard factor graph, shown in FIGURE 3(c). Therefore, similar to (16), two types of factor functions are defined as Here, ψ i,n denotes the energy consumption level of delivering c n to CRs for a feasible delivering strategy Y when it has been cached in h i , and φ j is used to demonstrate the constraint that a CR only can be served by one CH at a time. Thus, involving two types of factor function nodes and one type of variable node, shown in FIGURE 3(b), the one-to-many weighted matching problem can be reformulated into the unconstrained optimization problem of In order to solve the problem (27), we can map the factor graph FIGURE 3(b) into a standard factor graph as shown in FIGURE 3(c). The mapping rules from y i,j to z k , and from ψ i,n and φ j to ϕ l are given by where H n is the CH set that caches the c n , |H n | denotes the number of the elements in set H n , and ε(i, n) is the index of the h i in H n . Therefore, the message update of ρ t+1 l→k can be derived as (49). The detailed derivation of formulation (49) is given in APPENDIX C.
The belief estimation of z k can be obtained by alternating iteration of ρ l→k and θ k→l using (49) and (33) until b t k converges in (39). Let ℵ t j = {b t k |k = (j−1)(M +1)+i, s i,j = 1} denote the belief set of the variables which indicates the probability that the r j can be served by the corresponding CHs. For the reason that a CR can only be served by one CH, the best delivering assignment from the CHs to the CRs in t-th iteration can be estimated by where max(ℵ t j ) denotes the maximum element in ℵ t j . Therefore, the content delivering problem (24) can be solved by mapping z k back to y i,j using (28). The detailed steps of the BP based distributed algorithm can be found in Algorithm 3.

IV. HEURISTIC-BASED ALTERNATING ITERATIVE OPTIMIZATION METHOD AND COMPLEXITY ANALYSIS
In this section, we summarize the three subproblems of CH selection, content caching, and content delivering, and the HAIOM is proposed to solve the original average energy consumption minimization problem (6) in the WDCS. Finally, the complex analysis of the proposed algorithms is given.

Algorithm 3 BP Based Distributed
Algorithm for Strategy Optimization of Content Delivering X * : the fixed caching strategy. : the converging factor. T d : the maximum number of iterations. begin Step 1: Calculate η i,j using (4).
Step 2: Calculate E C i,n,j based on the fixed caching strategy using (23).
Step 3: Map y i,j to z k and ψ i,n , φ r to ϕ l using (28) and (29), respectively.

A. HEURISTIC-BASED ALTERNATING ITERATIVE OPTIMIZATION METHOD FOR THE WDCS
Aiming at delivering the desired content items to the CRs with a minimal level of average energy consumption, caching content items with high popularity in the side of MUs is introduced in this work. To begin, we first select the MUs with high centrality in terms of physical link quality and social interaction as the CHs, which are regarded as the

Algorithm 4 HAIOM-BPBP for Average Energy Consumption Performance Optimization of the WDCS T o : the maximum number of iterations. begin
Step 1: Select the CHs for the WDCS by using Algorithm 1.
Step 2: Establish the relationship among CHs, CRs, and content items, and transform the strategy optimizations of content caching and content delivering for original problem (6) into two interactive weighted matching problems referring to (16) and (24), respectively.
Step 3: Optimize the caching strategy X and delivering strategy Y . Initialize: t = 0, set a start content delivering strategy Y 0 randomly. repeat 1) Update X t+1 by using Algorithm 2 based on Y t ; 2) Update Y t+1 by using Algorithm 3 based on X t+1 . until Convergence or t = T o ; Obtain the optimized content caching strategy X * and content delivering strategy Y * by letting X * = X t and Y * = Y t . end caching nodes of the WDCS. Then, based on the local content popularity, the CHs act as the content providers for caching the popular content items under the constraints of their caching capacity or act as the relay nodes between BS and CRs when their capacity constraints are met. Finally, the CRs are assigned to access the CHs by jointly considering the related caching states and physical link conditions. Although the CH selection, the content caching, and the content delivering are solved independently through the three-stage sequential optimization, the performance of the WDCS is discounted for the variables are interacting with each other. Thus, HAIOM is proposed to further reduce the average energy consumption for content delivering of the WDCS.
First, the problem of CH selection is solved by considering the parameters that are related to content placement and content delivery. Based on the obtained CHs, we then tackle the problems of content caching and content delivering. Since content caching and content delivering are dependent on each other, the alternating iterative optimization method [47], [48] is adopted to achieve a balance between efficiency and convergence in HAIOM. Hence, the strategies of CH selection, content caching, and content delivering in the content-centric networks can be obtained to provide support for content sharing in the WDCS.
Explicitly, two BP based algorithms, i.e., Algorithm 2 and Algorithm 3, are designed to solve the content caching and the content delivering, respectively. For simplicity, the abbre- viation, i.e., HAIOM-BPBP is specified to denote the content caching problem and the content delivering problem are solved by BP in HAIOM. The detailed steps of the HAIOM-BPBP are summarized in Algorithm 4. To clarify the process, a complete flow chart of joint optimization of CH selection, content caching, and content delivering of the WDCS is shown in FIGURE 4. Finally, the WDCS delivers the content items to CRs based on the optimized caching and delivering strategies.
We provide the following approaches for the sake of comparison. Similar to HAIOM-BPBP, HAIOM-SASA is used to represent the case that the content caching problem and the content delivering problem in the HAIOM are both solved by the staged approach (SA) [49]. Moreover, HAIOM-PPBP represents the content caching problem is solved by the popularity priority (PP) method [50], as well as HAIOM-BPSP for the case that the content delivering problem is solved by the SINR priority (SP) method [51].

B. COMPLEXITY ANALYSIS
In the stage of CH selection shown in Algorithm 1, the centrality of MU is independently calculated, and the computational complexity in each iteration is O (1). Assuming that the maximum number of iterations for Algorithm 1 is T s , where T s is no more than 60 [52]. Hence, the complexity of selecting CHs in each MU is O(T s ).
The main computational task of content caching is to obtain ρ t+1 l→k . For the case of ϕ l = ψ n,j , the calculation involves R times message comparison for N content items cached in R CHs, where R is the number of the selected CHs through Algorithm 1 and can be calculated by R = u m ∈U π m . While, for the case of ϕ l = φ i , the calculation involves R message sorting for N content items cached in R CHs. Thus, the overall complexity for message update of each iteration is O(NR 2 log(R) + NR 2 ) ∼ = O(NR 2 log(R)), where ∼ = represents the equivalence relationship. However, the computational complexity of each iteration in each CH is linear in N and is polynomial in R, i.e., O(NR log(R)), for the reason that the overall computation is propagated to each CH in Algorithm 2 in a distributed manner.
Similar to the content caching problem, the overall computational complexity for content delivering problem is O(RS 2 log(S)+R 2 ) and the computational complexity in each CH is O(S 2 log(S) + R) due to the distributed operations. Furthermore, the maximum number of iterations T c and T d for ensuring the convergence of the algorithm, by experiments, is no more than 20 with the help of the damping techniques.
In general, the Algorithm 4 converges rapidly and stops at a number of iterations T o which is less than 10 in simulations. Let T denote the time of the total maximum iteration needed in Algorithm 4, we have In the considered scenario with ultra-dense MUs, the number of CHs and content items is generally larger than the number of CRs that can be served by a single CH, thus, R ≥ S and N ≥ S. Therefore, the overall computational complexity of Algorithm 4 is polynomial as O(T s + TR(S 2 log(S) + R) + TNR(R log(R) + R)) ∼ = O(TNR 2 log(R)). The computational complexity of each CH, i.e., O(TNR log(R)), is much lower and the computational task in each CH can be processed quickly by itself. Therefore, the proposed Algorithm 4 has high efficiency by spreading the computational burden to each CH.
On the other hand, the SA is known as the centralized algorithm with the computational complexity of O(|V | 2 (log(|V |) 2 + |E|) [53], where, V and E are the vertices set and the edges set of the graph, respectively. Solving the content caching problem and the content delivering problem in HAIOM by SA, the computational complexity can be deduced as O((N + R) 2 (log(N + R) 2 + |E 1 |)) and O((M + R) 2 (log(M + R) 2 + |E 2 |)), respectively. Here, |E 1 | and |E 2 | are the element numbers of set E 1 and set E 2 , and the maximum value of |E 1 | and |E 2 | are N times R and M times R, respectively. Thus, the HAIOM-SASA with T o iterations has the computational complexity of O(T o ((N + R) 2 (log(N + R) 2 +NR)+(M +R) 2 (log(M + R) 2 +MR))). The quick sorting method [54] is adopted to sort the content items for each CH based on their local popularities and the CHs for each CR based on the SINR between them in this work. Thus, the maximum computational complexities of PP and SP in each CH are N 2 and M 2 . Finally, the computational complexity of HAIOM-PPBP and HAIOM-BPSP can be derived as O(TR(S 2 log(S)+N 2 +R)) and O(TR(NR log(R)+M 2 +NR)), respectively.

V. SIMULATION RESULTS
A single cell with a radius of 300 m is considered and 20 MUs are randomly deployed within the service range. The transmit power of BS and MUs are set to be P B = 400 mW and P i = 200 mW, respectively. The number of popular content items is 50, and the size of these content items, with the mean value of 10 MB, is uniformly distributed between 1 MB∼20 MB. The system bandwidth is set to 10 MHz, the power of the background AWGN is set to −96 dBm, and the path-loss exponent factors are set to 4 and 2 for BS and CHs, respectively. Furthermore, r j requests content items with a distribution following the Zipf rule with a parameter λ j . In the experiment, the distribution parameters of all CRs are supposed to be set as the same value λ j = λ, but the distribution of content items for different CRs varies. Besides, all the CHs are supposed to have the same caching capacity C i = C as well. To analyze the performance of the proposed HAIOM, the exhaustive search (ES) method is adopted as the benchmark.
The convergence performance of HAIOM-BPBP, HAIOM-SASA, HAIOM-BPSP, and HAIOM-PPBP are plotted in FIGURE 5. For comparison, we also draw the solution obtained by ES with a black solid line marked with squares in the figure. As seen in FIGURE 5, each algorithm converges to a suboptimal solution after several iterations. Furthermore, we can show that the HAIOM-SASA performs best and its solution is very close to that of ES. The performance of HAIOM-BPBP follows HAIOM-SASA with a very small gap. This phenomenon shows the effectiveness of HAIOM-BPBP on one hand, and on the other hand, it indicates that the system performance can be improved by optimizing content caching and delivering simultaneously.
As shown in FIGURE 6, the average energy consumption optimized by HAIOM-BPBP decreases and converges to an optimized value within 10 iterations, which shows the efficiency of HAIOM-BPBP. Meanwhile, the average energy consumption also decreases with an increased caching capacity. Particularly, average energy consumption is reduced to a smaller value, when the caching capacities of CHs approach  a specific volume ( e.g., 300 MB or 60% of the size of overall popular content items in our simulation). TABLE 2 illustrates the impact of the centrality of MUs on the determination of CHs. The MUs with high centrality will be selected as CHs by both ES and HAIOM-BPBP, which proves sufficient evidence to support the effectiveness of Algorithm 1. In fact, the ES method trends to select a certain number of MUs with the largest centrality as CHs, e.g., the first 4 MUs with the largest centrality are selected as CHs. Thus, the proposed HAIOM-BPBP can achieve better performance. FIGURE 7 shows the number of copies of the popular content items cached in the WDCS through different algorithms. It can be shown that more than half of the content items cached in the WDCS through different caching strategies obtained by the ES and the HAIOM-BPBP have the same number of copies. Although some content items have different numbers of caching copies by using the ES and  the HAIOM-BPBP, the differences in numbers are small. Besides, comparing with the ES, HAIOM-BPBP is better in the WDCS for its high efficiency.
The impact of the number of CHs on the average energy consumption, under different caching capacities, is shown in FIGURE 8. Intuitively, as the number of CHs increases, the average energy consumption decreases rapidly first, and then, rebounds and starts to ascend at a slower speed. There are two reasons for this observation. First, too many CHs in a specified range at the same time result in serious overlap of service areas of them which causes the CRs exposing in these areas to suffer extra interferences. Second, too many CHs also augment the number of content items transformed from the BS to them when they act as relays, thereby the average energy consumption is increasing. In addition, the optimization for energy consumption is constrained by caching capacity for the reason that the CHs act as relays most of the time if they have a small caching capacity. Thus, the cost of transforming content items from the BS to the CHs dominates energy consumption which is much worse than that caused by channel interference. FIGURE 9 demonstrates the impact of content popularity on average energy consumption. As the increase of VOLUME 8, 2020 parameter λ, the average energy consumption of different caching capacities decreases to different stable values. A small value of λ, e.g., λ < 1, means that content items are requested with almost the same popularity. Thus, even a few parts of them have been cached in CHs, there are also lots of them needing to be transmitted from BS to CRs via CHs. However, when we have a relatively large λ, e.g., λ > 1, indicates that the popularity of the requested content items trends to be very different. These content items with high popularity often have a small volume and can be cached in CHs certainly and delivered to CRs from CHs directly, when they are requested. Thus, the average energy consumption can be cut down on a large scale. Though the average energy consumption can be effectively reduced by expanding the caching capacity of CHs, the proposed HAIOM-BPBP is more valid for CHs with medium caching capabilities, e.g., C = 300 MB. This is because that CHs can make sure content items with higher popularity, e.g., the number of popular content items is less than 30 for λ = 1, can be cached in CHs. For the case of small caching capacity, CHs act as relays most of the time to forward content items with high popularity from BS to CRs which results in enormous energy consumption. While, energy consumption mainly comes from content delivering from CHs to CRs when the CHs have a large caching capacity, e.g., C = 500 MB. As a result, the impact of the content popularity on the energy consumption can be ignored in this case.
To emphasize the advantages, we compare the proposed HAIOM-BPBP with some known algorithms, i.e., ES, HAIOM-SASA, HAIOM-BPSP, and HAIOM-PPBP. The impact of the caching capacity C on the average energy consumptions for different algorithms is depicted in FIGURE 10. Apparently, the average energy consumption declines significantly with an increase of C. Meanwhile, HAIOM-BPBP and HAIOM-SASA, which have shown a negligible gap with ES, can achieve much lower average energy consumption than HAIOM-BPSP and HAIOM-PPBP as a whole. Besides, HAIOM-BPSP is superior to HAIOM-PPBP which means that the optimization on the content caching can cut down  more energy consumption than that on content delivering. Moreover, HAIOM-BPBP performance is almost the same as HAIOM-SASA, which shows that the two proposed BP based distributed algorithms can achieve a good balance in accuracy and convergence.
The delay performance of HAIOM-BPBP is shown in FIGURE 11. The average delay in delivering content items is significantly reduced with the increase of the caching capacity of CHs. Although HAIOM-BPBP is slightly inferior to HAIOM-SASA in delay performance, the gap in that between HAIOM-BPBP and ES is extraordinarily small. Besides, HAIOM-BPBP is the best among HAIOM-BPBP, HAIOM-BPSP, and HAIOM-PPBP, followed by HAIOM-BPSP, and HAIOM-PPBP is the worst, which indicates that the proposed BP based distributed algorithms can provide the much better ways to optimize the strategies of content caching and content delivering in the WDCS.
In FIGURE 12, we plot the hit ratio, i.e., the requested content items can be found in the caches of CHs, along with the change of caching capacity for different algorithms. It can be observed that the average hit ratio monotonically increases with the increase of the caching capacity. This is due to the fact that with the increasing of caching capacity, more content items with higher popularity can be cached in the CHs. Meanwhile, the average hit ratio of HAIOM-BPBP is almost equal to that of HAIOM-SASA which is a little bit lower than ES, and much higher than that of HAIOM-SPBP and HAIOM-BPPP. Specifically, HAIOM-BPPP shows the worse performance on hit ratio than HAIOM-SPBP, especially when the caching capacity is small.

VI. CONCLUSION
In this paper, we focused on the minimization of average energy consumption for content sharing in the WDCS, which can be decomposed into CH selection, content caching, and content delivering. First, in order to choose appropriate CH, a PageRank based distributed algorithm has been designed involving the social relationships and channel conditions simultaneously. Then, two BP based distributed algorithms have been proposed for the optimization of content caching and content delivering. Furthermore, we have developed a low-complexity HAIOM-BPBP algorithm to improve system performance based on our analysis. We have shown that energy efficiency can be improved by using HAIOM-BPBP in the WDCS. Comparing with other algorithms, we have shown that the HAIOM-BPBP can not only achieve a good balance in accuracy and convergence, but also outperform in terms of delivering delay and caching hit ratio in the WDCS.
However, it is worthwhile to point out that the HAIOM-BPBP is designed for the case that the requested content items are heavily overlapped over a period of time. In our future work, the design of content update strategy in CHs of the WDCS will be considered to adapt the variation of content popularity over time. Furthermore, due to the failure or departure of the CHs, the recruitment strategy of new CHs for maintaining the effectiveness of the WDCS will be part of future work.
and 1 l and 0 l are defined as Let b t k denote the log-domain belief ratio in each iteration, we have Therefore, the belief b t k of the variable node z k can be got by alternating iteration of θ k→l and ρ l→k until it converges, i.e., |b where is a positive constant, or the pre-defined maximum iteration number is met.

APPENDIX B THE PROOF OF FORMULATION (44)
Notice that any content item can be cached in different CHs, thereby, all of the delivering cases should be summed up based on the predetermined content delivering strategy Y * when a content item is assigned to cache in a specific CH. Meanwhile, a CH will consider whether its performance can be improved before assigning a content item to be cached in it. Thus, the CH will make the caching decision between two set content items, one set indicates that the CH will cache the content item and is denoted by 1 l , and the other set denotes the CH will not cache the content item and is denoted by 0 l . Thus, substituting (17) into (34), for the case that ϕ l = ψ n,j , we have where I t+1 Subsequently, considering the capacity constraint of CHs, it is necessary to check whether it has met the caching capacity of the CH before assigning a content item. Clearly, the CHs will not cache the content items any more if their caching capacity has been exhausted, where X is equal to zero. Let¯ 1 l and¯ 0 l denote the subsets of 1 l and 0 l which satisfies x i,a =z e ∈¯ 1 l x i,a M a ≤ C i and x i,a =z e ∈¯ 0 l x i,a M a − M k−(i−1)N ≤ C i , respectively. Then, we can rewrite the (34) as follows when ϕ l = φ i .
where θ t a→l (v t i ) denotes the v t i − th message in the message set Q t l = {θ t a→l |z a ∈ ϕ l \ {z k }} in which the elements are sorted by decreasing order, and v t i is a variable constant that can be optimized by using the following function according to the caching capacity constraint (6c): where x t i,e (d) can be mapped into z t a (d), which is the corresponding variable node of the message θ t a→l (d). M e (d) is the corresponding content size of the variable node x t i,e (d). Considering the convergence and stability of the algorithm, a damping factor ε is introduced to terminate the algorithm with a small number of iterations [55], [56]. Thus, the message can be written as follows:

APPENDIX C THE PROOF OF FORMULATION (49)
As a matter of fact, the CH will consider providing service for CR groups, including two cases in which contain the present CR or not, to ensure it can obtain the best performance based on its maximum user access constraint (6e) under the current circumstances. Therefore, we can mark the two cases of CR groups as 1 l and 0 l , respectively, where 1 l indicates the present CR is served by the CH, and 0 l indicates the CH will not provide service to the present CR. Thus, the log-domain message ratio can be derived as (45), as shown at the top of the next page by substituting (25)  where he is leading a team to develop fundamental principles, algorithms, and systems for graph learning, cell-free mobile networking and edge computing, AI-enabled networking, and quantum Internet. He has authored over 90 papers in major IEEE/ACM journals and conferences, two book chapters, and one textbook. He is an USENIX Member. He served as a Committee Member of the IEEE ComSoc WTC and the IEEE ComSoc SPCE. He also served as a TPC Member for several IEEE conferences, such as ICC, Globecom, WCNC, VTC, and ICCC. He was a recipient of the Honor of Outstanding Graduates of Shaanxi Province and the Honor of Young Academic Talent