**Proof of Theorem 7.** Note that there exists *U*−1 *un* 0, what is obvious since (−*Uun*) is a Metzler stability matrix. If *ρ U*−1 *un U*\* < 1then there exists *Uun* + *U*\* −1 = *Uun I*3*n* + *U*−1 *un U*\* −1 = *I*3*n* + *U*−1 *un U*\* −1 *U*−1 *un* . Thus,

$$R\_{0\varepsilon} = \rho \left( F\_{\varepsilon} \mathcal{U}\_{\varepsilon}^{-1} \right) = \rho \left[ \left( F\_{\text{un}} + \vec{F} \right) \left( \mathcal{U}\_{\text{un}} \left( I\_{3n} + \mathcal{U}\_{\text{un}}^{-1} \vec{\Omega} \right) \right)^{-1} \right] = \rho \left[ \left( F\_{\text{un}} + \vec{F} \right) \mathcal{M} \mathcal{U}\_{\text{un}}^{-1} \right] \tag{A23}$$

where *M* = *I*3*n* + *U*−1 *un U*\* −1 = *U*−1 *c Uun*. Since *M I*3*n* + *U*−1 *un U*\* = *I*3*n* + *U*−1 *un U*\* *M* = *I*3*n* then −1

$$M = I\_{3n} - \mathcal{U}\_{\rm un}^{-1} \hat{\mathcal{U}} M = I\_{3n} - \mathcal{U}\_{\rm un}^{-1} \hat{\mathcal{U}} \left( I\_{3n} + \mathcal{U}\_{\rm un}^{-1} \hat{\mathcal{U}} \right) \quad \stackrel{\cdot}{=} I\_{3n} - \mathcal{U}\_{\rm un}^{-1} \hat{\mathcal{U}} \mathcal{U}\_{\rm un} \tag{A24}$$

Thus, the following matrix equalities hold from:

$$F\_{\varepsilon} \mathcal{U}\_{\varepsilon}^{-1} = F\_{un} M \mathcal{U}\_{un}^{-1} + \tilde{F} M \mathcal{U}\_{un}^{-1} = \left( F\_{un} + \tilde{F} \right) \mathcal{U}\_{un}^{-1} \left( I\_{3n} - \tilde{\mathcal{U}} \mathcal{U}\_{\varepsilon}^{-1} \right) \tag{A25}$$

Now, one has

$$\left(\left(I\_{\mathfrak{N}n} + \mathcal{U}\_{\mathfrak{un}}^{-1}\widetilde{\mathcal{U}}\right)^{-1} = \left(\mathcal{U}\_{\mathfrak{un}}^{-1}\mathcal{U}\_{\mathfrak{un}} + \mathcal{U}\_{\mathfrak{un}}^{-1}\widetilde{\mathcal{U}}\right)^{-1} = \left(\mathcal{U}\_{\mathfrak{un}} + \widetilde{\mathcal{U}}\right)^{-1}\mathcal{U}\_{\mathfrak{un}} = \mathcal{U}\_{\mathfrak{e}}^{-1}\mathcal{U}\_{\mathfrak{un}}\tag{A26}$$

$$-\left(F\_{\rm un} + \vec{F}\right) \mathcal{U}\_{\rm un}^{-1} \vec{\mathcal{U}} \left(I\_{3u} + \mathcal{U}\_{\rm un}^{-1} \vec{\mathcal{U}}\right)^{-1} = -\left(F\_{\rm un} + \vec{F}\right) \mathcal{U}\_{\rm un}^{-1} \vec{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} \mathcal{U}\_{\rm un} \tag{A27}$$

and one has from Equation (A27) that:

*R*0*c* ≤ *R*0*un* if

$$0 \prec F\_{\text{un}} \mathsf{U} I\_{\text{un}}^{-1} \left( I\_{3n} - \mathsf{U} \mathsf{U} I\_{\text{c}}^{-1} \right) + \mathsf{F} \mathsf{U} I\_{\text{un}}^{-1} \left( I\_{3n} - \mathsf{U} \mathsf{U} I\_{\text{c}}^{-1} \right) \prec F\_{\text{un}} \mathsf{U} I\_{\text{un}}^{-1} \tag{A28}$$

Note that Equation (A28) is equivalent to:

$$-F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \prec -F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \tilde{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} + \tilde{F} \mathcal{U}\_{\rm un}^{-1} \left( I\_{3n} - \tilde{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} \right) \prec 0 \tag{A29}$$

then to

$$-F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \left( I\_{3n} - \widetilde{\mathcal{U}} \mathcal{U}\_{\varepsilon}^{-1} \right) \prec \widetilde{F} \mathcal{U}\_{\rm un}^{-1} \left( I\_{3n} - \widetilde{\mathcal{U}} \mathcal{U}\_{\varepsilon}^{-1} \right) \\
\prec F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \widetilde{\mathcal{U}} \mathcal{U}\_{\varepsilon}^{-1} \tag{A30}$$

The constraints Equation (A30) can be written in equality form as follows:

$$-F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \left( I\_{3u} - \hat{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} \right) + M\_1 = \check{F} \mathcal{U}\_{\rm un}^{-1} \left( I\_{3u} - \hat{\mathcal{U}} \right) \\ = F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \hat{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} - |\, M\_2| \tag{A31}$$

for some given real 3*n* matrices *M*1 0 and *M*2 0. Since *I*3*n* + *U*−1 *un U*\* −1 = *U*−1 *c Uun*, note that

*U U*\* −1 *c Uun* = *U*\* *U*−1 *un Uun* + *U*\* −1 = *U*\* *I*3*n* + *U*−1 *un U*\* −1 (A32)

so that, if *ρ U*−1 *un U*\* < 1, one has that *I*3*n* + *U*−1 *un U*\* −1 exists and

$$I\_{3\mathfrak{n}} - \tilde{\mathcal{U}}\mathcal{U}\_{\mathfrak{c}}^{-1}\mathcal{U}\_{\mathfrak{n}\mathfrak{n}} = I\_{3\mathfrak{n}} - \tilde{\mathcal{U}}\left(\mathcal{U}\_{\mathfrak{n}\mathfrak{n}} + \tilde{\mathcal{U}}\right)^{-1}\mathcal{U}\_{\mathfrak{n}\mathfrak{n}} = I\_{3\mathfrak{n}} - \tilde{\mathcal{U}}\left(I\_{3\mathfrak{n}} + \mathcal{U}\_{\mathfrak{n}\mathfrak{n}}^{-1}\tilde{\mathcal{U}}\right)^{-1} \tag{A.33}$$

is also nonsingular if *ρ UU*\* −1 *c* = *ρ U*\* *I*3*n* + *U*−1 *un U*\* −1 < 1. From Banach Perturbation Lemma [13],

$$\left\|\left\|\tilde{\mathcal{U}}\left(\mathcal{U}\_{\text{un}} + \tilde{\mathcal{U}}\right)^{-1}\mathcal{U}\_{\text{un}}\right\|\_{2} = \left\|\tilde{\mathcal{U}}\left(I\_{3n} + \mathcal{U}\_{\text{un}}^{-1}\tilde{\mathcal{U}}\right)^{-1}\right\|\_{2} \leq \left\|\tilde{\mathcal{U}}\right\|\_{2} \frac{1}{1 - \left\|\tilde{\mathcal{U}}\right\|\_{2} \left\|\mathcal{U}\_{\text{un}}^{-1}\right\|\_{2}} < 1\tag{A34}$$

that is, if *U*\* 2 < 1/2 *U*−1 *un* 2 which ensures both the previous condition *ρ U*−1 *un U*\* < 1 guaranteeing that *I*3*n* + *U*−1 *un U*\* −1 exists and that *I*3*n* − *UU*\* −1 *c Uun*−1 = *I*3*n* − *U*\* *I*3*n* + *U*−1 *un U*\* −1 *U*−1 *un* −1 exist. Thus, since , Equation (A31) is equivalent to

$$-F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} + M\_1 \left( I\_{3u} - \widetilde{\mathcal{U}} \left( I\_{3u} + \mathcal{U}\_{\rm un}^{-1} \widetilde{\mathcal{U}} \right)^{-1} \mathcal{U}\_{\rm un}^{-1} \right)^{-1} = \widetilde{\mathcal{F}} \mathcal{U}\_{\rm un}^{-1} \tag{A35}$$

$$= F\_{\rm un} \, \mathcal{U}\_{\rm un}^{-1} \widetilde{\mathcal{U}} \mathcal{U}\_{\rm c}^{-1} \left( I\_{3u} - \widetilde{\mathcal{U}} \left( I\_{3u} + \mathcal{U}\_{\rm un}^{-1} \widetilde{\mathcal{U}} \right)^{-1} \mathcal{U}\_{\rm un}^{-1} \right)^{-1} - |M\_2| \left( I\_{3u} - \widetilde{\mathcal{U}} \left( I\_{3u} + \mathcal{U}\_{\rm un}^{-1} \widetilde{\mathcal{U}} \right)^{-1} \mathcal{U}\_{\rm un}^{-1} \right)^{-1} \tag{A35}$$

Recovering again the matrix inequality form for Equation (A35) and *U U*\* −1 *c* = *U*\* *I*3*n* + *U*−1 *un U*\* , since *M*1 and *M*2 are arbitrary, yields that the condition 4 is equivalent to Equation (A35), which is also equivalent to Equation (A28), since *U*−1 *un* 0 if *U*\* 2 < 1/2 *U*−1 *un* 2. Property **(i)** has been proved. Now, assume that*F*\* = − 0 0 0 *F*\* 0 0 0 ≺ 0. Then, Equation (A35) holds, and then Equation (A28) also holds, if, for the given pair (*Fun* , *Uun*), the pair 0 0 0 *F*\* 0 0 0 = −*F* , *U*\* fulfils the matrix constraints:

$$\left(I - F\_{\rm un} \, \mathrm{Li}\_{\rm un}^{-1} \tilde{\boldsymbol{\Omega}} \left(I\_{3n} + \boldsymbol{\mathcal{U}}\_{\rm un}^{-1} \tilde{\boldsymbol{\Omega}}\right) \left(I\_{3n} - \tilde{\boldsymbol{\Omega}} \left(I\_{3n} + \boldsymbol{\mathcal{U}}\_{\rm un}^{-1} \tilde{\boldsymbol{\Omega}}\right)^{-1} \boldsymbol{\mathcal{U}}\_{\rm un}^{-1}\right)^{-1} \boldsymbol{\mathcal{U}}\_{\rm un} \, \prec \, \middle| \, \tilde{\boldsymbol{\mathcal{F}}} \left| \, \prec F\_{\rm un} \right.\tag{A.36}$$

Since *FunU*−1 *un* 0 and |*F*| *U*−1 *un* 0 then the matrix inequalities Equation (A36) imply that Property **(ii)** holds since *R*0*c* ≤ *R*0*un* and, furthermore, *R*0*c* < *R*0*un* if either *FunU*−1 *un* or 0 0 0 *F*\* 0 0 0 *U*−1 *un* is irreducible. In the last case, one (but not both) of the symbols ≺ might be replaced with ≺. This result is a direct application of Corollary 1.2 in [12] since if *A* and *B* are real matrices of the same order with *A B*( = *A*) 0, equivalently, *A B* 0 then the maximal eigenvalue of *A* is larger than that of *B* if *A* is irreducible but they can be identical if *A* is reducible.

#### **References**

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **Evolution of Conformity Dynamics in Complex Social Networks**

#### **Yuhui Gong 1,2 and Qian Yu 3,\***

Received: 10 January 2019; Accepted: 21 February 2019; Published: 28 February 2019

**Abstract:** Conformity is a common phenomenon among people in social networks. In this paper, we focus on customers' conformity behaviors in a symmetry market where customers are located in a social network. We establish a conformity model and analyze it in ring network, random network, small-world network, and scale-free network. Our simulations shown that topology structure, network size, and initial market share have significant effects on the evolution of customers' conformity behaviors. The market will likely converge to a monopoly state in small-world networks but will form a duopoly market in scale networks. As the size of the network increases, there is a greater possibility of forming a dominant group of preferences in small-world network, and the market will converge to the monopoly of the product which has the initial selector in the market. Also, network density will become gradually significant in small-world networks.

**Keywords:** conformity; evolutionary dynamics; ring network; small-world network; scale-free network

#### **1. Introduction**

Humans are highly susceptible to social influence. When a person's judgment conflicts with a group's, that person often conforms their judgment to that of the group [1]. This diffuse occurrence that individuals change their behaviors and attitudes to match the majority's behavior is known as conformity. Conformity is everywhere in our lives. For example, consumption caused by conformity will be influenced by the evaluation of others and driven by other people's behavior. People's pursuit of fashion often leads to the pursuit of a certain type of goods and forms a trend of popularity. Merchants often take advantage of consumers' conformity and the fact that they will imitate idols and follow fashion trends to promote their products.

The earliest study on conformity influence dates back to the 1930s and was carried out by social psychologists Jenness [2] and Sherif [3]. Since then, extensive studies have shown that conformity can affect individual choice behavior. The well-known experiment by Asch [4] in 1955 showed that over 75% of people tend to conform to others in varying degrees. Bernheim [5] analyzed conformity by a theoretical model in which individuals care about both consumption and social status. Existing works carried out by Kelman et al. [6] and Akert [7] have repeatedly verified the significant effect of conformity influence in our social life. Krüger [8] determined the conditions needed to reach a consensus in a double-clique network with conformity and anticonformity as types of social influence.

After then, many researches have measured the degree of conformity. Mehrabian and Ksionzky [9] used a two-dimensional scheme to represent affinitive characteristics to build a function of conformity. Luce and Fishburn [10] built a conformity function which was proved to be the only possible function, which is concave for gains and convex for loses, while satisfying the requirements of segregation

and binary prospect theory. Also, researchers have made efforts to establish models for exploring the factors and effects of conformity, mostly focusing on the relationship between conformity and personal characters. Crutchfield [11] put forward the idea that conformity is involved in individual differences such as age and gender. Reitan and Shaw [12] found conformity was also related to the group size. Egebark [13] did a research to show that appreciation, expressed as a single "like" on social networks, from a single stranger increased the size of the influencing group and doubled the probability that subjects expressed positive support. Zollman [14] found that conformity effects induce reliability in some contexts and, surprisingly, this happens even when it is counterproductive. Often, the methods for reducing its effects are not helpful. He attempted to determine the epistemic effects of conformity by analyzing a mathematical model of this behavior. Lascu and Zinkhan [15] proposed a classical conformity model and classified the influencing factors of conformity. The influencing factors of conformity were classified in: individual factors, group factors, product factors, and work factors. Among them, individual factors mainly refer to personality characteristics, knowledge and experience, cultural differences, personality characteristics, social status, and so on; group factors mainly refer to group size, group cohesion, individual position, consistency of group opinion, group authority, and so on. Product factors are its visibility, the specific features of the product, and the functions of the product [16]; work factors mainly refer to the fuzziness of information, the openness of conformity, and the influence of authority [17]. In addition, Deutsch [18] divided the influencing factors of conformity into normative effects and informational effects.

In the study of evolutionary games, an interesting question is why spatial topology can provide the beneficial environment for the evolution of cooperation [19,20]. Various works have demonstrated the effect of spatial reciprocity on the promotion of cooperation dynamics [21]. Conformity has been attracting much attention also recently. Szolnoki and Perc designated a fraction of population as being driven by conformity rather than payoff maximization [22]. Yang [23] and Niu [24] found that conformity-driven reproductive ability, especially rational conformity behavior, can greatly enhance cooperation compared with homogeneous reproductive ability in the evolutionary spatial prisoner's dilemma game. Kabir et al. [25] found that the shape of the cooperative cluster and the ability to expand a single perfect C-cluster are the two factors that bolster the effect of network reciprocity.

In economics, customers are affected not only by the quality and price of the product, but also by the behaviors of other people in the market. For example, Bernheim [5] proposed a theory of social conformity and presented a model to describe the conformity process that has been replicated a large number of times across age groups and cultures by researchers. Corazzini [26] studied the role of social preferences and conformity in herding behavior in anonymous risky environments. Park and Kwanghee [27] identified three features of clothing conformity, i.e., normative, informative, and identifiable conformity. They found the interest in appearance was relatively high, and normative conformity was the most common among the three factors of clothing conformity. By analyzing quarterly data for the 1975–94 period, Wermers [28] investigated whether mutual funds tend to "herd" when trading stocks and examined the impact of herding on stock prices and whether it is stabilizing or destabilizing.

As it is well known, the social network is a theoretical construct useful in social sciences to study relationships between individuals, groups, or organizations. Most researchers use random networks, small-world networks, or scale-free networks to represent the social networks. The random networks, which was studied by Erdös and Rényi [29], is generated by a disconnected set of nodes that are then paired randomly. Other two well-known and much studied classes of complex networks are small-world networks and scale-free networks. Watts and Strogatz [30] found the small-world networks, which are characterized by specific structural features—short path lengths and high clustering—are more suitable than the random networks for describing social networks. They can be generated from a k-regular ring graph, and each edge of the network will rewire randomly according to a certain probability. Scale-free networks, proposed by Barabasi and Albert [31], are more appropriate for representing real networks of hyperlinks between websites and online social

networks, when the preferential attachment mechanism works, and the power-law degree distributions of degrees are obeyed.

Along with the developing of the complex network theory, many research issues of social problems were proposed. Zanette [32] reported numerical evidence that an epidemic-like model, which can be interpreted as the propagation of a rumor, exhibits critical behavior at a finite randomness of the underlying small-world network. Moreno [33] derived mean-field equations characterizing the dynamics of a rumor process that takes place on top of complex heterogeneous networks. Nekovee [34] showed that scale-free social networks are prone to the spreading of rumors, just as they are to the spreading of infections. They are relevant to the spreading dynamics of chain emails, viral advertising, and large-scale information dissemination algorithms on the Internet. Zhang [35] researched how the conformity tendency of a person changes with their role, as defined by their structural properties in a social network. Li [36] reviewed the models for characterizing the information diffusion in online social networks. Martinˇci´c-Ipši´c et al. [37] established two weighted similarity measures to analyze link prediction among co-occurrence language networks based on hashtags and all the words in tweets. Carrera [38] developed a probabilistic approach to discovering information diffusion among network communities based on an extended hidden Markov model (HMM).

Although a large number of theoretical, empirical, and experimental studies, particularly in psychology and sociology, have investigated the presence of conformity observations with regard to human society, there are few works investigating conformity in social network. It is in this light that we examined the effect of consumers' conformity in the different structures of social networks. On the basis of the studies of conformity and complex networks, we explored the effect of social networks' structure on conformity. We modeled the social networks as random networks, small-world networks, and scale-free networks and then checked the evolution of conformity behavior on these networks.

This paper is organized as follows. Section 1 describes the concepts and the assumptions used in the study. The conformity in ring networks is analyzed in Section 2, and the conformity in complex networks is analyzed in Section 3. Finally, a summary of our study is presented in Section 4.

#### **2. Conformity in Ring Networks**

In order to investigate the effects of conformity in social networks, we used the model of conformity effects which was constructed by Chalip and Green [39]. While this model is impoverished in many ways relative to the actual effect of conformity, its simplicity provides a convenient avenue for investigating the effects of the phenomena.

Suppose there are two products, product 1 and product 2. Each customer in the market will be informed about them with an assigned probability. Customers are arranged on a social network, and time is divided into a series of discrete time periods. In each period, every customer simultaneously surveys his neighbors' behavior. If the majority of people make the opposite choice to theirs, the customers change their mind. In the opposite case, the customers maintain their choice. It is said that the customers in the market have a high level of conformity and would be largely influenced by other people in their neighborhood. For convenience, the following several assumptions are made:

**Assumption 1.** At the first round, the event of a customer being informed by either firm 1 or firm 2 is exclusive, and a customer will choose to buy from the informer.

**Assumption 2.** Suppose conformity is the only factor influencing a customer's decision. Whether a customer in the following rounds will change its mind merely depends on other customers in the network, regardless of the product price and quality.

**Assumption 3.** Not all customers are equally social, some may be in contact only with a few neighbors, while others may be connected to relatively larger groups.

**Assumption 4.** Every customer is affiliated to a group, the size of any network should be *n* ≥ 2, and any network is closed.

**Assumption 5.** The decision-making process of customers can continue for infinite rounds.

At the beginning, every customer will be informed of the products from either firm 1 or firm 2 and then will make their choice, which might be changed in the following rounds. Assume that any individual is informed by firm 1 with probability (1 − *ε*) and by firm 2 with probability *ε*.

For customer *i*, its choice at time *t* is *St i* . We define *Nt i*(1) = 0 0 ! *a* ∈ *N* : *St a* = 1 80 0 as the number in *i*'s neighborhood who would choose to buy products from firm 1; *Nt i*(2) is defined accordingly. We can define the choice function *St i* of a customer based on conformity:

$$S\_i^t = \begin{cases} 1 \text{ if } N\_i^{t-1}(1) > N\_i^{t-1}(2) \\ 1 \text{ if } N\_i^{t-1}(1) = N\_i^{t-1}(2) \text{ and } S\_i^{t-1} = 1 \\ 2 \text{ otherwise} \end{cases} \tag{1}$$

In order to simplify our research, we began the study on a ring network model which has some similarities to the model of Zollman [14]. Actually, in a regular grid topology, each node in the network is connected with two neighbors along one or more dimensions. If the network is one-dimensional and the chain of nodes is connected to form a circular loop, the resulting topology is known as a ring. Imagine customers who lead lonely lives and only know about two customers among their neighbors. The social network of these customers would be a ring, as follow (Figure 1):

**Figure 1.** A sample market on a ring network.

 According to our choice function *St i* , a customer originally informed by firm 1 will change its decision if both of its neighbors choose to buy from firm 2. We can thus conclude that a ring will converge to choose firm 2 as shown in Figure 2, if every firm 1 chooser is surrounded by firm 2 choosers. If every ring follows this rule, then firm 2 will take up the market eventually.

**Figure 2.** Conformity effect on customer's choices in the ring network.

In addition, an interesting phenomenon will occur if every firm 1 chooser and firm 2 chooser appear alternatively: in this case, the ring would never converge, every node would change from 1 to 2 and then back to 1 (Figure 3), which means any individual will change its mind after every round.

**Figure 3.** Switch loop of customer's choices affected by conformity.

The following propositions can be obtained for analysis.

**Proposition 1.** *The chooser in a ring network will converge to firm 1 if, and only if, every customer has two firm 1 choosers as neighbors and does not have two firm 2 choosers as neighbors.*

**Proof.** This proposition seems to be reasonable as we can see from the rings above: every customer with firm 1 choosers as neighbors will become a firm 1 chooser in the next round. As the process goes on, it is possible that all customers would become firm 1 choosers. With this in hand, our task now is to explore if a ring will converge to either firm 1 or firm 2 in the end.

To make it simple, we broke the ring and extended it to a linear model. The probability of not having two consecutive firm 2 choosers as neighbors is set to be *Q*. The customer itself has a probability (1 − *ε*) to become a firm 1 chooser and a probability *ε* to become a firm 2 chooser. When there is only one customer in the market, *Q* = 1; when there are two customers, *Q*(2,*ε*) = (1 − *ε*) + *ε*(1 − *ε*). As the number of customers increases, we divide the situation into two parts. If the first customer chooses firm 1, then the rest (*n* − 1) customers should not have two firm 2 choosers as neighbors in a row, for which the probability *Q*(*n* − 1,*ε*) is required; if the first one is a firm 2 chooser, then the second person should choose firm 1, and for the rest (*n* − 2) customers, the probability must satisfy *Q*(*n* − 2,*ε*). Based on this, we have:

$$Q(n,\varepsilon) = (1-\varepsilon)Q(n-1,\varepsilon) + \varepsilon(1-\varepsilon)Q(n-2,\varepsilon),\tag{2}$$

#### **Proposition 2.** *For* 0 < *ε* < 1, *Q*(*n*,*ε*) *is strictly decreasing.*

**Proof.** In the above linear model, the probability of not having two consecutive firm 2 choosers decreases as the number of customers increases according to proposition 2. As in a ring, the only difference between this and the linear model is one connection between the first customer and the last one. In this case, if the first person is a firm 1 chooser, we require *Q*(*n* − 1,*ε*); if the first customer chooses firm 2, then the second and the last customers should all choose firm 1 to meet the requirement; for the rest (*n* − 3) customers, the probability should be *Q*(*n* − 3,*ε*).

So, the adjusted probability *P*(*n*,*ε*) based on *Q*(*n*,*ε*) can be given as:

$$P(n,\varepsilon) = (1-\varepsilon)Q(n-1,\varepsilon) + \varepsilon\left(1-\varepsilon^2\right)Q(n-3,\varepsilon),\tag{3}$$

It has a similar character as *Q*(*n*,*ε*) according to another proposition.

#### **Proposition 3.** *For* 0 < *ε* < 1, *P*(*n*,*ε*) *is strictly decreasing.*

**Proof.** As the size of the ring network increases, the probability of one customer having two firm 2 choosers as neighbors will increase, and according to Proposition1, there would finally be some customers choosing firm 2, and the ring will never converge to firm 1. Two firms would be able to maintain a duopoly market as they share the customers together. In the simplest network (the ring), conformity may not be able to affect all customers because of lack of communication between people. It is worth mentioning that a small ring has higher chances to converge to either firm than a large one, according to the probability function *P*(*n*,*ε*) which is strictly decreasing. However, in a larger ring, the majority would have higher chances to cause convergence to firm 1 or firm 2 and thus to lead to a monopoly market. It is also reasonable and provable that the firm with higher *ε* would be able to gain more customers. In order to increase their value, firms may adopt other methods such as informative advertising to increase the value of *ε* [14].

In order to illustrate the above propositions, we calculated the probability of not having two choosers of firm 2 in a row as neighbors for different values of *n* and *ε*. The size of the network was set to be in the range from 2 to 20; we obtained four curves with different *ε*. The values of both probability functions are ploted in Figures 4 and 5:

**Figure 4.** *Q*(*n*,*ε*) function decreases as *n* increases. *Q*(*n*,*ε*) with higher *ε* converges more quickly to 0.

**Figure 5.** *P*(*n*,*ε*) function decreases as *n* increases. *P*(*n*,*ε*) with higher *ε* converges more quickly to 0.

As mentioned above, for any *ε*, *Q*(1,*ε*) = *P*(1,*ε*) = 1. In this sense, we neglected the icons when *n* = 1 and chose to start with *n* = 2 in *Q*(*n*,*ε*), *n* = 3 in *P*(*n*,*ε*). It is evident from Figures 4 and 5 that both probability functions *P*(*n*,*ε*) and *Q*(*n*,*ε*) decrease as *n* increases, which indicates the larger a social group is, the more difficult it will be to converge to one firm. It is also worth mentioning that firms with higher probability to inform customers (i.e., with higher *ε*) are less likely to take up the whole market in a ring network. This seems a little counterintuitive, but we should notice that firms of this type have higher chances to defeat their opponents and own more shares in the market.

#### **3. Analysis of Conformity in Complex Networks**

Most real-world networks, especially social networks, are complex.  For example, small-world networks, according to Watts and Strogatz, are distinguished from other networks by two specific properties: high clustering among nodes and short path lengths. A scale-free network, such as collaboration networks and inter-bank payment networks, is a network whose degree of distribution follows a power law. Hence, in order to further study the influence of customer conformity in the social networks, we conducted a comparative study in random networks, small-world networks, and scale-free networks.

We supposed there are N nodes in the network *G* = (*N*, *V*), in which *N* = {1, 2, 3, ··· , *n*} is a finite set of nodes, and *V* = {(*i*, *j*)|*i*, *j* ∈ *N*} is a set of connection lines between all nodes, and in which (*i*, *j*) ∈ *V* represents an associated relationship between customer i and j. Also, each customer is set at a 0 or 1 status, *si* ∈ {0, 1}, where *s*1 indicates that production of firm1 is selected, and *s*0 indicates that production of firm 2 is selected. Then, the state space of a social network with *n* customers can be described as Θ*n* = {*s*0,*s*1}*n*, at any time t.

When the network size *n* is large enough and the nodes in the network obey the homogeneous mixed distribution, the mean-field equation can be applied to analyze the evolution dynamics of the customer's choice behavior system. Suppose *ρk*(*t*) represents the proportion of nodes in which the customer with degree k in the network selects "firm 1" at time t, and *kP*(*k*) *k* represents the probability of the node connecting with the customer node with degree k in the network, where *k* = ∑*k*≥1 *kP*(*k*) is the network average degree. Then, at time t, the probability of any customer selecting firm 1 is: *ϕ*(*t*) = ∑*k*≥1(*kP*(*k*)*ρk*(*t*))/*k* . Thus, the probability of a node that chooses firm 1 among the nodes connected with customers with degree k is: *k a ϕ*(*t*) *a* (1 − *ϕ*(*t*)) *k*−*a* , defined as *P*(1|*a*, *k*, *ϕ*(*t*)). It can

be seen that a mean field parameter of *ϕ*(*t*) is applicable to any network node and is not affected by network connectivity.

Let *δ* > 0, *δ* is a conformity coefficient, indicating the probability of customers to adjust their choice behavior. The probability that the customer choice state changes from firm 1 to firm 0 is:

$$\Pr(1|k,\varphi(t)) = \sum\_{a=0}^{k} \delta f(k,a)P(1|a,k,\varphi(t)),\tag{4}$$

where *f*(*k*, *a*) = *a k* represents the proportion of the specific behavior of the associated node.

The probability of state changing from firm 0 to firm 1 is:

$$\Pr(0|k,\varphi(t)) = \sum\_{a=0}^{k} \delta f(k,a)P(1|a,k,1-\varphi(t)),\tag{5}$$

Then, *r*(0|*k*, *ϕ*(*t*)) + *r*(1|*k*, *ϕ*(*t*)) = *δ* .

**Proposition 4.** *The equilibrium state in the market is ρk* = *δ*−1*r*(1 0 0*k*, *ϕ*(*t*))*.*

**Proof.** The change rate of the customer's choice behavior to firm1 in the network can be expressed by the mean-field equation:

$$\frac{d\rho\_k(t)}{dt} = -\rho\_k(t)r(1|k,\rho(t)) + (1-\rho\_k(t))r(0|k,\rho(t)),\tag{6}$$

The above formula shows that the change rate of the behavior of the customer selecting firm 1 mainly depends on the change rate of the selection behavior and the current state of the customer's behavior, regardless of the specific time, and can be regarded as the Markov process of the continuous time system. For *k* ≥ 1 and *dρk* (*t*) *dt* = 0, in equilibrium state, the proportion of customers whose selection behavior is 1 can be obtained by *ρk* = *r*(1|*k*,*ϕ*(*t*)) *r*(0|*k*,*ϕ*(*t*))+*r*(1|*k*,*ϕ*(*t*)) = *δ*−1*r*(1 0 0 0 *k*, *ϕ*(*t*)).

Following the assumptions about the market and consumers in the previous section, we carried out a series of simulation experiments to examine the influence of network structure, network size, and the initial market share on the evolution of customer conformity behaviors. In each simulation, the social network was generated with a different structure, obtaining random networks, small-world networks, and scale-free networks. Then, each experiment was iterated for 20 rounds and performed 100 times.

The results of the series of experiments are as follows:

#### **(1) Evolution of herding behavior under different network structure types and network size.**

The initial market shares *ε* in the social networks were set randomly with the expected value of 0.5, and the size were set as 100, 300, and 500. Then, simulations were carried out in the generated random network, small-world network, and scale-free network, respectively. The experiment results are reported in Figure 6.

**Figure 6.** Evolution of market share with effect of conformity on networks having different structures and sizes.

The Figure 6 shows that the topology structure of the networks has a significant impact on the evolution of the consumers' conformity behavior. In the random network, the market share, which represents the distribution value of the consumers' choice, may converge to one of the products, that is, the market share may reach the highest value of 1 or fall to 0, which appears as the line of iterations rises to the top or falls to the bottom; it is also possible that the line of iterations will oscillate around the middle. In the small-world network, the market share will soon converge to a stable state, showing that all consumers tend to have a common choice. In the scale-free network, the distribution value of the consumers' choice will oscillate to varying degrees with a high probability rather than converge to a monopoly state. In addition, the scale of the network has a significant impact on the evolution of customers' conformity behaviors. The larger the scale is, the stronger the effect of the network structure will be.

The simulation results showed that in the small-scale random network, due to the randomness of social connection, it is difficult to play a decisive role. The evolution of consumers' behavior has a strong randomness, and the market has a certain probability to converge to the monopoly of one product. However, as the scale of the network increases, there is a great possibility of forming a dominant group of preferences in social relations, and the market share will converge to a certain monopoly state. In the small-world network, because of the shortest path and high agglomeration, consumers are likely to form a power of public opinion, which causes a high probability of converging to a monopoly of certain products in the market. In a small-scale network, there is a certain probability in a chaotic state, but as the scale increases, the convergence increases, and the market will quickly converge to a monopoly of a certain product. In a scale-free network, a non-hub node may be affected

by different selected hub nodes and shift to different options, so it is difficult to converge to a monopoly state in the overall network.

**(2) Evolution of conformity behavior in small-world networks with different network densities and network scales.**

The initial market shares *ε* in the small-world networks were set randomly with the expected value of 0.5, and the size were set to 100, 300, and 500. Then, simulations were carried out in the generated networks with average degree of 10, 30, and 50, respectively. The experiment results are shown in Figure 7 as follows:

**Figure 7.** Evolution of market share with effect of conformity on small-world networks having different average degrees and sizes.

The simulation results showed that the network density (which is closely related to the average number of neighbors) has a little effect on the evolution of consumers' conformity behavior in small-world networks when the scale is small, while it will become gradually significant when the scale of the networks gets bigger. With the increase of the network density, the convergence of the market share becomes slower and weaker and may even fail to converge to the monopoly of a certain product. The possible reason is that, when the network density of small-world networks increases, the interference effect among different clustering groups is stronger, which will result in an unstable sway of some nodes in conformity selection.

#### **(3) The influence of different initial distributions on the evolution of herd behavior.**

To check the effect of the initial market share on customer conformity, we set the social networks as random network, small-world network, and scale-free network, with size ranging from 100 to 500. Then, the experiments were carried out with initial distribution of 0.4, 0.45, 0.5, 0.55, and 0.6, respectively. The experimental results are shown in Figure 8 as follows:

**Figure 8.** Monotonicity of *Q* in different networks and with different *ε*.

In order to compare the results with those of the ring networks, we similarly defined *Q* = *E t* (*ϕ*(*t*)) = ∑*t* ∑*k*≥1 *kP*(*k*)*ρk* (*t*) *k T* , where *Q* represents the mean probability of choosing firm 1 during evolution.

When *Q* approaches 1, the distribution of consumer choices in the market tends to be monopolized by product 1. When *Q* approaches 0, the distribution of consumer choices in the market tends to be monopolized by product 2. The experimental results show that in all three kinds of social network, *Q* value will increase as *ε* increases; when the given *ε* is greater than 0.5, *Q* will increase with the size of the network. When the given *ε* is less than 0.5, *Q* will decrease with the increase of network size. When *ε* is equal to 0.5, *Q* will stabilize between 0.4 and 0.5. The above trends are particularly significant in random networks and are less obvious in scale-free networks.

The above results show that the dominant consumer groups in the initial selection distribution tend to influence the herd behavior. In turn, the market will converge to the monopoly of the product. In addition, when the initial market share is quite balanced, the distribution of consumer choice may appear as chaotic in a social network with a small scale. In a large-scale social network, it is more likely that the market will converge to the monopoly of dominant products. The above results are obvious in random networks and small-world networks, but in scale-free networks, the chaotic state is more likely to occur.

#### **(4) The evolution of Conformity behavior on Facebook social network.**

To verify the simulation results, we used a real-world social network dataset. The following Figure 9 shows the real-world social network on Facebook, whose dataset was collected from survey participants using the Facebook app and freely provided by the SNAP library of Stanford university. This dataset consists of 'circles' (or 'friends lists') from Facebook and includes node features (profiles), circles, and ego networks. The network consists of 4039 nodes and 88234 edges, the average clustering coefficient is 0.617, the average path length is 3.693, and the average degree is 43.691, which meet the characteristics of small-world network.

**Figure 9.** Image of the social network on Facebook.

The experiments were carried out with the initial distribution *ε* as 0.4, 0.45, 0.5, 0.55, and 0.6, and each experiment was run 30 times. The experimental results (Figure 10) showed that the market will converge to the monopoly of a certain product which is dominant in the initial market. When the initial distribution *ε* is larger than 0.55 or less than 0.45, the market will converge to a monopoly state more quickly. When the initial distribution *ε* is around 0.5, the market will not to converge to a monopoly state in the overall network and will exhibit a chaotic state. These results are consistent with experiments carried out on simulation networks.

**Figure 10.** Evolution of market dynamics on Facebook social networks with different *ε*.

#### **4. Conclusions**

In this paper, we established the conformity model in networks where the customers in the market have strong conformity and are largely influenced by their neighborhood in social networks. We studied the influence of customer conformity in different structures of social networks, including ring network, random network, small-world network, and scale-free network.

When the network is a ring network, the market share will more likely converge to a monopoly state, and the firm with a higher market share will be able to gain more customers. However, conformity does not always lead to convergency as the network size increases. The reason may be that a customer might not be able to assert its influence on other buyers because of limited communication in the social network.

The simulations on random networks, small-world networks, and scale-free networks showed that the topology structure, network size, and initial market share will have significant effects on the evolution of customers' conformity behaviors. Firstly, when the social network is a small network, the market will more likely converge into a monopoly market due to its shortest path and high agglomeration, and public opinion will be more powerful in the social network. However, in the scale-free network and random network, it is difficult to converge to a monopoly state in the overall network.

Secondly, the size of networks also plays an important role in determining conformity in social networks. As the scale of the network increases, there is a greater possibility of forming a dominant group of preferences in social networks. However, in scale-free networks, this is difficult to happen, and the network will exhibit a chaotic state. Furthermore, the initial market share will dramatically determine the final results. The market will converge to the monopoly of the product which has the initial selector in market.

Finally, the results also showed that the network density will has an effect on consumers' conformity in social networks, especially in small-world networks, and the impact will be increasingly significant when the scale of the networks gradually becomes larger.

**Author Contributions:** Methodology, Q.Y.; Visualization, Y.G.; Writing—original draft preparation, Y.G.; Writing—review and editing, Q.Y.

**Funding:** This work was supported by the National Natural Science Foundation of China (No. 71774128).

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **A Novel Computational Technique for Impulsive Fractional Differential Equations**

#### **Changyou Ma \***

College of Mathematics and Information Science, Neijiang Normal University, Neijiang 641100, China<EMAIL_ADDRESS>
Received: 24 December 2018; Accepted: 25 January 2019; Published: 13 February 2019

**Abstract:** A computational technique for impulsive fractional differential equations is proposed in this paper. Adomian decomposition method plays an efficient role for approximate analytical solutions for ordinary or fractional calculus. Semi-analytical method is proposed by use of the Adomian polynomials. The method successively updates the initial values and gives the numerical solutions on different impulsive intervals. As one of the numerical examples, an impulsive fractional logistic differential equation is given to illustrate the method.

**Keywords:** fractional derivative; Adomian method; computational technique

#### **1. Introduction**

Fractional calculus appears frequently in various applied topics [1–7] and pure mathematics [8–12]. They are employed to depict the long-interaction of different statues of the systems. The fractional order controls the amount of dependence on past information and shows the quantity of the memory. On the other hand, as a result, it holds both quantitative and qualitative aspects. It shows some features that are not present in other tools. This is the main reason for the popularity of the fractional calculus as a modeling tool for the memory process.

Impulse theory is often used in control methods of differential equations. The impulsive point changes dynamics of continuous time systems locally. Then, the solution has a jump and becomes a piecewise continuous function on the whole interval, and impulsive points are the endpoints of each short interval. A differential equation containing impulses is also called a system with a jump. Hence, the impulsive differential equation is not a continuous time system but the one combining both continuous and discrete point information. It depicts the impact of external conditions which may be negative or positive. Impulsive fractional differential equations have received much attention recently [13–19]. It can illustrate totally distinct dynamics in comparison to standard fractional systems, and this property has often been adopted in fractional impulsive control. Many analytical methods have been efficiently developed for differential equations [20–27]. However, the less numerical method and analytical method were developed for impulsive fractional differential equations. In this study, our main purpose is to extend methods from the integer order to the fractional order.

The Adomian decomposition method (ADM) has been applied in various nonlinear problems, and the Adomian polynomials play a crucial role in the treatment of the nonlinear terms in fractional differential equations. Recently, Duan et al. proposed a new way to calculate the polynomials which can derive the same results but greatly improve computational speed and save time in comparison with the classical one. Hence, various novel algorithms based on the new Adomian polynomials can be considered now. It was successfully used in fractional differential equations [28] where a semi-analytical method was developed.

In this paper, a novel computational technique is proposed for the following equation by use of new Adomian polynomials [21–23]:

$$\begin{cases} \, \, ^C\_{t\_0} D\_t^\mathbf{a} \mathbf{x}(t) = F(t, \mathbf{x}), t \in J\prime := J \backslash \left[ t\_{N\_1}, \dots, t\_{N\_M} \right], J := \left[ t\_{0\prime}, T \right], \\\ \, \Delta \mathbf{x}\_{N\_k} = I\_k \left( \mathbf{x}\_{N\_k}^- \right) = \mathbf{x} \left( t\_{N\_k}^+ \right) - \mathbf{x} \left( t\_{N\_k}^- \right) = y\_k, 1 \le k \le M\_r \\\ \mathbf{x}\_k = \mathbf{x}(t\_k), \mathbf{x} \left( t\_{N\_k}^+ \right) = \lim\_{\hbar \to \infty} \mathbf{x} \left( t\_{N\_k} + \hbar \right), \mathbf{x} \left( t\_k^- \right) = \lim\_{\hbar \to 0} \mathbf{x} \left( t\_{N\_k} - \hbar \right), \\\ \hbar > 0, \mathbf{x}(t\_0) = \mathbf{x}\_0. \end{cases} \tag{1}$$

The Adomian polynomials are used in fractional differential equations. However, to the best of our knowledge, we did not find any work on semi-analytical solutions for impulsive fractional differential equations. This paper combines both analytical and numerical solutions' features to develop a semi-analytical method.

#### **2. Preliminaries**

#### *2.1. Definitions and Properties of Fractional Calculus*

The fractional calculus is defined as the following:

**Definition 1** [1]. *The Riemann–Liouville (R-L) integral of* α *order is defined by*

$$\rho\_{t\_0} l\_t^a f(t) = \frac{1}{\Gamma(a)} \int\_{t\_0}^t (t - \tau)^{a-1} f(\tau) \, d\tau,\ 0 < t, 0 < a. \tag{2}$$

**Definition 2** [1]. *The R–L derivative is defined as*

$$\begin{cases} t\_0 D\_t^\mathbf{x} f = \frac{1}{\Gamma(m-n)} \frac{d^m}{dt^m} \int\_{t\_0}^t \frac{1}{(t-\tau)^{n-m+1}} f(\tau) \, d\tau, \\ t\_0 < t, 0 < \alpha, \ m = \lceil \alpha \rceil + 1, \end{cases} \tag{3}$$

where Γ is the Gamma function.

**Definition 3** [1]. *The Caputo derivative is defined as*

$$\begin{cases} \, \_0^C D\_t^a f = \_{t\_0} D\_t^a (f(t) - \sum\_{k=0}^{m-1} \frac{(t - t\_0)^k}{k!} f^{(k)}(t\_0)),\\ 0 < t, 0 < \alpha, m = [\alpha] + 1. \end{cases} \tag{4}$$

**Remarks**: For *Definition 3, the Caputo derivative of a constant is zero;*

If *f*(*t*) ∈ *Cm*([*t*0, ∞), *R*), then the Caputo derivative can be rewritten as

$$\, \_{l\_0}^C D\_t^a f = \frac{1}{\Gamma(m-a)} \int\_{t\_0}^t \frac{1}{(t-\tau)^{a-m+1}} \frac{d^m}{d\tau^m} f(\tau) \, d\tau. \tag{5}$$

In Definition 3, the function *f*(*t*) can be discrete if it is integrable such that the fractional impulsive equation makes sense at the impulsive point.

In the sequel, we all use the definition of the Caputo derivative. We need the integral transform so that the fractional differential equation can be reduced to an integral one and the integral methods can be applied straightforward.

**Property 1.** *The Leibniz integral law holds*

$$\begin{aligned} \,\_{t\_0}I\_t^{\alpha} \,\_{t\_0}^C D\_t^{\alpha} f(t) &= f(t) - f(t\_0), \\ \,\_t t\_0 \le t, 0 < \alpha \le 1. \end{aligned} \tag{6}$$

**Lemma 1 [14].** *The impulsive fractional differential Equation (1) is equivalent to the following integral equation of fractional order*

$$\begin{cases} \mathbf{x}(t) = \mathbf{x}\_0 +\_{t\_0} I\_t^\mathbf{z} F(t, \mathbf{x}), t \in [t\_0, t\_{N\_l}] \\ \mathbf{x}(t) = \mathbf{x}\_0 + \mathbf{y}\_1 + \_{t\_0} I\_t^\mathbf{z} F(t, \mathbf{x}), t \in (t\_{N\_l}, t\_{N\_l}] \\ \mathbf{x}(t) = \mathbf{x}\_0 + \mathbf{y}\_1 + \mathbf{y}\_2 + t\_{t\_0} I\_t^\mathbf{z} F(t, \mathbf{x}), t \in (t\_{N\_{l2}}, t\_{N\_l}] \\ \vdots \\ \mathbf{x}(t) = \mathbf{x}\_0 + \sum\_{j=1}^k y\_j + t\_{t\_0} I\_t^\mathbf{z} F(t, \mathbf{x}), \ t \in (t\_{N\_k}, t\_{N\_{k+1}}], \\ \vdots \\ \mathbf{x}(t) = \mathbf{x}\_0 + \sum\_{j=1}^M y\_j + t\_{t\_0} I\_t^\mathbf{z} F(t, \mathbf{x}), t \in (t\_{N\_M}, T], \ 1 < N\_M. \end{cases} (7)$$

#### *2.2. Adomian Polynomials*

Considering a nonlinear equation

$$\mathbf{x}(t) = \mathbf{G}(\mathbf{x}(t))\tag{8}$$

for the nonlinear term *G*(*x*(*t*)), the Adomian polynomial named after G. Adomian [29] can be obtained by

$$A\_{\mathcal{U}} = \frac{1}{n!} \frac{\partial^n}{\partial \lambda^n} (G[\sum\_{k=0}^{\infty} x\_k \lambda^k])|\_{\lambda=0}. \tag{9}$$

With the known values of *x*0, ··· , *xn*, we can successively obtain *An*. Duan [21–23] newly proposed a fast Adomian polynomial as the following

$$A\_{\rm nl} = \frac{1}{n} \sum\_{k=0}^{n-1} (k+1) \mathbf{x}\_{k+1} \frac{\partial A\_{n-1-k}}{\partial \mathbf{x}\_0},\\ A\_0 = G(\mathbf{x}\_0) \tag{10}$$

Generally, the one of the z-variable is calculated by

$$A\_{\rm nl} = \frac{1}{n} \sum\_{i=1}^{z} \sum\_{k=0}^{n-1} (k+1) \mathbf{x}\_{i,k+1} \frac{\partial A\_{n-1-k}}{\partial \mathbf{x}\_{i,0}}, i = 1, \ldots, z. \tag{11}$$

Although both lead to the same analytical solution, the new one is given in a more concise form and saves computational time. This is very important for solutions of the fractional calculus since the fractional derivative has the memory effects and can possess a large storage space.

#### **3. Semi-Analytical Method Based on Adomian Polynomials**

Consider the following fractional system with impulse (1). Using the idea by Duan [21], we give steps of a novel algorithm for impulsive fractional differential equations.

• Assume the solution in a series form as

$$\mathbf{x}(t) = \sum\_{i=0}^{\infty} c\_i (t - t\_0)^{i\alpha} \tag{12}$$

and *xn* is assumed as *n* ∑ *i*=0 *ci*(*t* − *t*0) *i*α accordingly.

• Substituting (12) into (8), with Adomian polynomials, the coefficients of *ci* are obtained as

$$\begin{cases} \ c\_{n+1} = \frac{\Gamma(1+n\alpha)}{\Gamma(1+(n+1)\alpha)} A\_{\mathbb{II}}[c\_0, c\_1, \dots, c\_{\mathbb{II}}], 0 \le n, \\\ c\_0 = x\_0 + \sum\_{j=1}^k y\_j. \end{cases} \tag{13}$$

• *xn* can be obtained as

$$\mathbf{x}\_{n} = \boldsymbol{\psi}(c\_{0\prime}t\_{0\prime} \sum\_{j=1}^{k} \mathbf{y}\_{j\prime}\mathbf{t}\_{j}), \mathbf{t} \in (\mathbf{t}\_{\mathrm{N}\_{k}\prime}\mathbf{t}\_{\mathrm{N}\_{k+1}}).\tag{14}$$

• Set *t* ∈ [*t*0, *T*], *t* = *ih*, *H* = *T N* , *h* = *H K* , *i* = 0, 1, ... , *NK* and let *x*∗ *i* = *ψ*(*x*∗ *i*−1, *ti*−1, *k* ∑ *j*=1 *yj*, *ti*), where *x*∗ 0 = *c*0. We can obtain the numerical solutions *x*∗ 0,..., *x*∗ *i* .

#### **4. Numerical Solutions based on Adomian Polynomials**

In this section, we consider an application of the method to Caputo fractional differential equations with impulses

$$\begin{cases} \, \, ^C\_{t\_0} D\_t^\mu \mathbf{x}(t) = \mu \mathbf{x}(t) (1 - \mathbf{x}(t)),\\ \, \, t \in J := J \backslash [t\_{N\_1}, \dots, t\_{N\_M}], \, J := [t\_{0\prime}, T] \\ \, \, \Delta \mathbf{x}\_k = y\_k, \mathbf{x}\_k = \mathbf{x}(t\_k), y\_k = 0.1 \\ \, \, \mathbf{x}(t\_0) = \mathbf{x}\_0 = 0.2, t\_0 = 0. \end{cases} \tag{15}$$

By use of Lemma 1, we have an integral equation as

$$\begin{cases} \begin{aligned} \mathbf{x}(t) &= \mathbf{x}\_{0} + \mu\_{0}I\_{t}^{\mathbf{x}}\mathbf{x}(t)(1-\mathbf{x}(t)), \ t \in [t\_{0}, t\_{N\_{1}}], \\ \mathbf{x}(t) &= \mathbf{x}\_{0} + y\_{1} + \mu\_{0}I\_{t}^{\mathbf{x}}\mathbf{x}(t)(1-\mathbf{x}(t)), \ t \in (t\_{N\_{1}}, t\_{N\_{2}}], \\ \mathbf{x}(t) &= \mathbf{x}\_{0} + y\_{1} + y\_{2} + \mu\_{t\_{0}}I\_{t}^{\mathbf{x}}\mathbf{x}(t)(1-\mathbf{x}(t)), \ t \in (t\_{N\_{2}}, t\_{N\_{3}}], \\ &\vdots \\ \mathbf{x}(t) &= \mathbf{x}\_{0} + \sum\_{j=1}^{k} y\_{j} + \mu\_{l0}I\_{t}^{\mathbf{x}}\mathbf{x}(t)(1-\mathbf{x}(t)), \ t \in (t\_{N\_{k}}, t\_{N\_{k+1}}], \\ &\vdots \\ \mathbf{x}(t) &= \mathbf{x}\_{0} + \sum\_{j=1}^{M} y\_{j} + \mu\_{l0}I\_{t}^{\mathbf{x}}\mathbf{x}(t)(1-\mathbf{x}(t)), \ t \in (t\_{N\_{M}}, T], \ 1 < N\_{M}. \end{aligned} \tag{16}$$

Adopt the semi-analytical method in Section 3. We have the recurrence relationship of the coefficients as

$$\begin{cases} \ c\_{n+1} = \frac{\Gamma(1+n\alpha)}{\Gamma(1+(n+1)\alpha)} A\_n[c\_0, c\_1, \dots, c\_n], 0 \le n, \\\ c\_0 = x\_0 + \sum\_{j=1}^k y\_{k'} \mathbf{1} \le k \le M. \end{cases} \tag{17}$$

We give the first few coefficients here

$$\begin{cases} c\_1 = \frac{\Gamma(1)}{\Gamma(1+\alpha)} (\mu c\_0 - \mu c\_0^2), \\\ c\_2 = \frac{\Gamma(1+\alpha)}{\Gamma(1+2\alpha)} (\mu^2 c\_0 - 3\mu^2 c\_0^2 + 2\mu^2 c\_0^3), \\\ c\_3 = \frac{\Gamma(1+2\alpha)}{\Gamma(1+3\alpha)} (-6\mu^3 c\_0^2 + 10\mu^3 c\_0^3 - 5\mu^3 c\_0^4 + \mu^3 c\_0), \\\ \vdots \end{cases} \tag{18}$$

such that we determine the approximate analytical expression of series solutions.

We vary the parameters α and *M* to observe the behavior. In Figure 1, the fractional order α = 0.9 and the number of impulsive points is set to 5. We can see that, with the increase in *M* (See Figures 2 and 3), the solutions' values also increase if all of the impulse is positive. Figure 4 illustrates the stable solution without an impulse in the same fractional case. From all of the figures, we can observe that our semi-analytical solutions are plotted on the interval [0,10] which holds a longer time domain than the standard one.

**Figure 1.** Numerical simulation:α = 0.9, *M* = 5.

**Figure 2.** Numerical simulation:α = 0.9, *M* = 11.

**Figure 3.** Numerical simulation:α = 0.9, *M* = 19.

**Figure 4.** Numerical simulation: α = 0.9, without impulse.

#### **5. Conclusions**

Impulsive fractional differential equation has recently become an important topic, but less work has focused on numerical or analytical methods. In this paper, we develop an efficient method for nonlinear equations. New Adomian polynomials are adopted to treat the nonlinear terms, and a semi-analytical method is developed. Firstly, the impulsive fractional differential equation is given equivalently in an integral equation. Fractional Taylor series is implemented to derive a recurrence relationship. Since there is no differential or integral calculus, it becomes very quick and saves computational time to derive the analytical or numerical solutions in comparison with classical ADM. The semi-analytical solution shows that the method is very efficient. However, there are still some difficulties that we need to overcome in future. The following topics are also disadvantages that we will try to address:

For example, how can series solutions be found for boundary value problems? Hence, it is very important to develop new ideas for this topic.

**Author Contributions:** The author C.M. takes full responsibility for this study and finished this paper by himself. **Funding:** There is no financial program supporting this study.

**Acknowledgments:** The author feels grateful to the editor and the referees' kind help to improve this study.

**Conflicts of Interest:** The author declares no conflict of interest.

#### **References**

© 2019 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## *Article* **An Intelligent Approach for Handling Complexity by Migrating from Conventional Databases to Big Data**

#### **Shabana Ramzan 1, Imran Sarwar Bajwa 1,\* and Rafaqut Kazmi 2**

Received: 26 October 2018; Accepted: 14 November 2018; Published: 3 December 2018

**Abstract:** Handling complexity in the data of information systems has emerged into a serious challenge in recent times. The typical relational databases have limited ability to manage the discrete and heterogenous nature of modern data. Additionally, the complexity of data in relational databases is so high that the efficient retrieval of information has become a bottleneck in traditional information systems. On the side, Big Data has emerged into a decent solution for heterogenous and complex data (structured, semi-structured and unstructured data) by providing architectural support to handle complex data and by providing a tool-kit for efficient analysis of complex data. For the organizations that are sticking to relational databases and are facing the challenge of handling complex data, they need to migrate their data to a Big Data solution to get benefits such as horizontal scalability, real-time interaction, handling high volume data, etc. However, such migration from relational databases to Big Data is in itself a challenge due to the complexity of data. In this paper, we introduce a novel approach that handles complexity of automatic transformation of existing relational database (MySQL) into a Big data solution (Oracle NoSQL). The used approach supports a bi-fold transformation (schema-to-schema and data-to-data) to minimize the complexity of data and to allow improved analysis of data. A software prototype for this transformation is also developed as a proof of concept. The results of the experiments show the correctness of our transformations that outperform the other similar approaches.

**Keywords:** big data; complexity; NoSQL databases; Oracle NoSQL; data migration

#### **1. Introduction**

The modern information systems have to deal with high-dimension data in terms of gigantic size, and the heterogenous and complex nature of the data. Similarly, the cloud applications and social media applications also have to store, manage and process a massive amount of data. However, the Relational Databases (RDBs) have fixed schema and allow storage and handling of only structured data in the form of tuples or relations [1]. Additionally, the RDBs only provide vertical scalability (vertical scalability allows only vertical growth of a data-structure by adding only new records at run-time.) at higher hardware cost but no horizontal scalability (horizontal scalability allows horizontal growth of a data-structure by also allowing the addition of fields at run-time.) is provided by the RDBs. Since horizontal scalability is needed by today's software applications to handle high-speed heterogenous data; currently, the relational databases have to face various challenges at the application development level and operational level. At the application development level, the system developer needs high coding velocity to handle large number of users; however, such capability is not available in relational databases. Additionally, modern complex and heterogenous data needs horizontal scaling but that feature is also not provided by the relational databases and consequently, they fail to cope with the needs of modern data-intensive software applications.

Once of the key challenges in recent times has been to handle high-speed data, as there is a rapid increase in digital information, exponentially growing (see Figure 1) to Petabytes (PB) PB = 1000 TB) from Terabytes (TB) 1TB = 1000 GB, and even to Exabytes (EB) 1EB = 1000 TB as shown in Figure 1. John Gantz and David Reinse also predicted this phenomenon [2]. Typical relational database systems have shown their limits for such exponential growth of data. The shortcomings of typical relational databases are addressed by Big data solutions such as NoSQL databases [3–5]. Here, NoSQL stands for "Not Only SQL". Such databases are currently the main focus of research due to the fast and persistent growth of data. The NoSQL was introduced in 1998 by Carlo, and the name given to his relational database solution that was due to not using Structured Query Language (SQL) [6]. The idea of NoSQL was redefined in 2009 and became the competitor of RDBs. Now they have become the backbone of large-sized enterprises such as Google, Twitter, Facebook, Amazon, etc. due to its peculiar features such as high availability (when a data is automatically distributed evenly across a cluster with no single master.), efficient performance, horizontal scalability, and the support of a variety of data models and queries. Moreover, the rapid growth of cloud computing has highlighted the problems that are endured in handling large volumes of data. However, NoSQL databases can handle "Big Data" problems efficiently rather than RDBs. These databases are becoming popular because they are providing a high level of scalability. Additionally, they are very efficient in handling the unstructured data to facilitate universal data communication [7] in modern information systems. Relational databases follow the ACID (Atomicity, Consistency, Isolation, Durability) and BASE (Basically available, Soft-state, Eventual-consistency) properties. Whereas, NoSQL databases exist in a spectrum between ACID and BASE alliance.

**Figure 1.** Exponential growth of digital information, going to Exabyte.

The NoSQL databases have typically four different models: (1) key-value store, (2) column store, (3) graph store, and (4) document store [8]. Each NoSQL database model has its own distinct schema of storing data [9]. The most simple and flexible model is a key value store that is used in our study and an overview of key-value stores is given below:

#### *1.1. Key-Value Stores*

A Key-value store is a database that stores data in the form of associative arrays known as a hash or a dictionary. Each dictionary has a collection of records that have different fields of data. They store data as a key-value (record) pair as shown in Figure 2. Each value is stored and retrieved through a unique key. A value is a data of an arbitrary type, size and structure. Here, value can be anything such as a number, text, image, programming code (such as PHP), markup code (such as HTML), etc. They do not have any query language, only use get, put and delete operations [10]. A key can be simple (filename, hash or URL) or a composite key (such as in Oracle NoSQL) [11].

A set of operations are used to interact with key-value stores such as Get operation is used to retrieve a value that is stored against a unique key and put operation is used to insert the key-value pair. However, manipulation of multiple values in a single operation is not allowed by these single-key operations. These operations facilitate the users that do not have proper knowledge of query language to easily retrieve data. A key-value store handles the process data retrieval manually at the application level. Here, lookup structures are used that are based on keys such as Log-Structured Merge-trees (LSM-trees) and Distributed Hash Tables (DHTs) [12], and are highly suitable for applications that can access data through a single key, such as web session information, user profile/configuration and online shopping cart. Key-value stores are the only databases that provide efficient data retrieval and storage mechanisms to cloud-based applications [13]. Key-value stores provide features like easy partitioning and high scalability. Figure 2 shows a storage model of a typical key-value store.

**Figure 2.** Key-Value Store data model.

On the base of storage models, key-value stores can be divided into three types of stores including permanent, temporary and hybrid. In permanent stores, all the data is stored on the hard disk but I/O operations are slow. The temporary key-value store ensures fast data access as all data is stored in memory; however, if the system is down, the data will be lost. Whereas, a hybrid store is a combination of the positive features of both permanent and temporary stores as it supports data storage in memory and when specified conditions are met, the date is written to the hard disk. The most popular key-value stores are hyperdex, Redis, Riak, Oracle NoSQL, BerkelyDB, Yahoo Pnuts and Project Voldemort. The following section provides an overview of Oracle NoSQL.

#### *1.2. Oracle NoSQL*

Oracle NoSQL is a distributed type of key-value store. It provides important features like horizontal scalability, monitoring, transactional semantics for improved data manipulation, and simple administration of data. The Oracle NoSQL has a very simple data model. Each row is a key-value pair; value is associated with a unique key. Value is of arbitrary length. It has tables, rows and fields which are equivalent to tables, rows and columns of relational databases but has a different concept. The following are the key features of Oracle NoSQL stores:

Figure 3 shows the relational and Oracle NoSQL key-value store databases. Oracle Berkeley DB Java Edition high-availability storage engine is the basis of Oracle NoSQL. It provides sharding, replication, transparent load balancing, high availability and fault tolerance. It is a free schema and supports various programming languages such as C++, C, C#, Ruby, Scala, Java, Javascript(Node.js), and Python. Oracle NoSQL supports simple data types (java string float, integer, long, boolean, double) as well as complex data types (array, enum, fixed binary, map, records).

**Figure 3.** Relational database (**a**) and Oracle NoSQL Key-value store database (**b**).

Considering the challenges of big data, the modern organizations are rapidly shifting to NoSQL databases from conventional RDBs. Relational to relational database like MySQL to Oracle conversion is possible because they are based on mathematical theory [14]. On the other hand, NoSQL databases are non-relational and their scheme design is completely different. So RDB-trained staff has difficulty in converting existing RDB system to NoSQL databases [15,16]. However, the lack of methodological and tool support for automated migration from RDB to NoSQL has been a real challenge in recent times. In this paper, a methodology is presented to transform the existing relational database into a NoSQL database. It automatically transforms both the data and schema. The proposed approach transforms the MySQL database into an Oracle NoSQL database by handling the complexity of data.

The rest of the paper is organized as follows. Section 2 introduces related work in the fields of RDBs, NoSQL and migration between these two generations of databases. Section 3 describes the used approach and Section 4 discusses the implementation details of our approach. The results of experiments and discussion is given in Section 5 along the evaluation details. Finally, Section 6 concludes the results with possible future work.

#### **2. Related Work**

A data transformation from a relational database to an NOSQL database depends on different factors such as mapping styles, query structures, storage structures, etc. Additionally, querying data from a relational database and a NoSQL database at the same time is difficult but now it is applicable by using the data adapter technique [17]. Here, a method DB converter is described that transforms relational data into NoSQL data for querying results. However, this conversion is temporary, only for query execution [17], since NoSQL databases are efficient in data storage and provide high levels of scalability and availability. There are several different studies on NoSQL databases [4], such as BigTable [13], Cassandra [18], HBase [15], MongoDB [19] and for big data [20]. It is studied that the schema conversion from relational databases to NoSQL is difficult because relational databases use JOINs but the NoSQL databases do not support it. In NoSQL databases, nesting tables are used as an alternative to JOINs. This method is designed to improve the performance of cross table query. In nesting table technique, the parent-child layer is designed with references as relationships between the tables. Here, the referred table is defined as a child and the other one is defined as a parent [21]. The cross table query is important in SQL databases, but in NoSQL, a question arises on how to use JOIN type or alternative queries to retrieve data from NoSQL databases. Column-oriented databases provide a solution for these types of queries because column-oriented databases have a design principle of DDI (Denormalization, Duplication and Intelligent keys). This method works as: initially, denormalization of the database and its transformation into a big table; then identification of unique keys in a big table; and finally, the selection of the most suitable key as primary key. In this method, MySQL database is transformed into a column-oriented database [22]. Most of the web-based applications and Content Management System (CMS) solutions are using relational databases for data management, but users of internet and clouds are growing rapidly, so it is difficult for relational databases to handle the huge data traffic. The designed approach transforms the real CMS SQL database to a NoSQL database [23]. This approach has two steps, first to denormalize the SQL database and then to choose a unique identifier key as a primary key for a big table. In this approach, MySQL database is migrated to a column-oriented Hbase database.

Another method is designed to transform data from a relational database (MySQL) to NoSQL (MongoDB). Migration from relational to NoSQL has a few steps; initially, MySQL database connection is created, after connectivity, the details of the database are accessed through prototype software. In next step, mapping is performed between the relational database MySQL to NoSQL MongoDB [24,25].

For transformation from RDBs to NoSQL, another application is developed which deals with the transformation of relational database schema to NoSQL schema. This application is able to handle both the DDL and DML commands of relational schema and transform these commands into equaling commands of NoSQL [26]. To access the NoSQL database, a subset of SQL commands is used. CQL is the query language for Cassandra, where CQL and SQL are quite similar. Cassandra and MongoDB are integrated because MongoDB is capable of performing complex queries. Therefore, authors designed a system for translation of SQL commands to NoSQL. This system is implemented by middleware in C# [27]. Table 1 shows the comparison of existing approaches. The majority of the researchers tend to use HBase and MonogoDB as a target database but no one used Oracle NoSQL. The facts tabulated in the following table clearly show the research gap that currently no approach or tool supports automated transformation of MySQL to Oracle NoSQL for both data and schema transformation.

**Table 1.** Comparison of transformation approaches.

There is another methodology for the conversion of a relational database to HBase in four steps [28]. First, create a single merge table in HBase and convert all one-to-one and one-to-many relationships into that table. Second, merge neighboring tables through a recursive method. Third, a row key design, and fourth, create access patterns views. The set of rules for schema conversion between an existing relational database to Hbase are defined [29]. First, experimentally justify the need of conversion rules by observing the conversions without conversion rules. This first experiment is used as a baseline of the second experiment. Second, the experiment is performed convert the existing relational database application to Hbase using a first list of conversion rules. This conversion proves that the conversion rules reduce the difficulty of the whole conversion process. Another approach is presented for RDBs to NoSQL migration that has two phases [30], the first phase transforms relational

database schema to HBase schema and also provides guidelines to develop HBase application. In the second phase, schema mappings are used to create a set of programs to automatically transform the data of the source database to the target database. Similarly, this proposed a solution for migrating RDBMS schema to document oriented NoSQL database schema [16]. This method provides atomicity using atomic aggregate and avoids join operations. It uses the column-level denormalization in order to minimize the disadvantages of table-level denormalization.

Data extraction from Big data has been one of the major research challenges [31,32] in recent times. Since, Big data has discrete and heterogenous types of data, this challenge becomes more difficult. However, various contributions [32–34] are made to address this challenge. Suciu [33] discussed the extraction of knowledge from Big data and [34] discussed how conceptual modeling can help in addressing this challenge. The NoSQLayer tool presented is proposed for migrating from a relational database to a NoSQL database; this approach has two modules. The data migration module migrates the SQL database to the NoSQL database. Here, the metadata of the MySQL database is accessed during Java Metadata API. The data mapping module transforms data from a relational database to a NoSQL database seamlessly [35].

To the best of our knowledge, there is no approach or tool available to handle the complexity of automatic conversion of a RDB (such as MySQL) to Big data solutions (such as Oracle NoSQL database) and the major contribution of this paper is to present a novel approach that is intelligent enough to handle the complexity of data and automatically transform MySQL database to Oracle NoSQL for both data and schema conversion.

#### **3. Used Approach for Handling Complexity of RDB to Big Data Conversion**

The used approach is based on a rule-based system that has two modules: The first module handles the conversion of a relational database (such as MySQL) schema to a NoSQL database schema which is very flexible in nature (Schema Conversion). Whereas, the second module handles the conversion of the data from the relational database (such as MySQL) to NoSQL database (such as Oracle NoSQL). The working of the first module in the proposed approach is shown in Figure 4, that performs the schema transformation.

**Figure 4.** Schema transformation module.

The following text explains the components used in both modules (schema transformation and data transformation) and their working.

#### *3.1. Schema Transformation*

This module handles the transformation of MySQL schema to Oracle NoSQL schema. For this purpose, a relational database in MySQL is taken as an input and parses in Java to extract metadata of MySQL databases such as table-names, their attribute-names, attribute-data-types, relationship-names, indexes from the database, etc. Here, the JDBC driver and the Java metadata base class library is used to access the schema of tables from MySQL database. For relationship metadata extraction, the primary and foreign key constraints of each table were used as the relationship information can be helpful for schema conversion. Here, Java metadata class library provides different methods to extract schema information in different aspects, e.g., if we want to get information about a primary key then

we use metadata's primary key function. The methods used for this approach are listed in Table 2. When all required metadata of the tables' schemas are extracted, the mapping given in Table 3 is used to transform the MySQL metadata to Oracle NoSQL key-value store.

**Table 2.** List of methods used in schema transformation.

This mapping is implemented in Java to accomplish the schema level transformation of MySQL to Oracle NoSQL database. Once the schema transformation is accomplished, the data level transformation is carried out; this is described in the following section.

**Table 3.** Migration mapping RDBs to Oracle NoSQL.

In our approach, we have created an online test preparation of a student database in MySQL. A subset of this MySQL database is shown in Figure 5 that is used to explain the schema conversion methodology of our approach.

Relational database has an important feature of JOIN. But Oracle NoSQL database uses parent-child relationship instead of JOIN. MySQL database Student table (parent table) is linked with Marks table (child table) and Marks table (parent table) is linked with Course table (child table) and Course table (parent table) is linked with lecturer table (child table) and lecturer table (parent table) is linked with Classes (child table). In Figure 6, we see that Student is a parent table, Marks is a child table as well as the Course is a sub-child table and Course table is a parent table and Lecturer is a child table and classes are sub-child table.

In Oracle NoSQL key-value store, these tables are stores in the form of Avro schema. Avro schema supports both APIs of Oracle NoSQL, and that is why the entire key-value store is based on this schema. Figure 7 shows the Avro Schema of tables stored in Oracle NoSQL store and Figure 8 shows Avro Schema of Marks table. Table API of the Oracle NoSQL key-value store is just a front-end layer to provide a user friendly environment.

**Figure 5.** Database model used as test database.

**Figure 6.** Relationships of Oracle NoSQL database tables.

**Figure 7.** Detail of tables stored in Oracle NoSQL store.

**Figure 8.** Avro Schema of Marks Table.

#### *3.2. Data Transformation*

For data transformation, a table in source MySQL database is selected from which the data is to be extracted and transformed into JSON format for final storage in an oracle NoSQL database. For this purpose, the ETL (Extract, Transform and Load) methodology [31] is used. The data transformation module is shown in Figure 9.

**Figure 9.** Data transformation module.

JSON format is a light weight, data interchange format, and is easy to understand. JSON is used in Oracle NoSQL database as a data type and also as a schema; the schema created through JSON is called Avro Schema. Before inserting data into a key value store, it is necessary to create an Avro schema for the record which defines the structure of the data.

In the first step, the required table is selected, from which data will be extracted. The next step is to convert data of the table row by row from MySQL database and store it in a text file; when all the data of the table is transformed, then this text file is called by another module that stores it into the Oracle NoSQL database. For data transformation, we need to know about some data types used in MySQL database to compare it with data types of the Oracle NoSQL database as shown in Table 4.

**Table 4.** Data type comparison.

In the data transformation process, every column data type of the MySQL database table is compared with the Oracle NoSQL data types. Such a comparison helps in finding the exact match of MySQL data type. Figure 10 shows the mapping of category table from RDBs to Oracle NoSQL.

{"id":1, "S-name": "james", "Class": "ist year", "Subject": "OOP", "Marks": 84} {"id":2, "S-name": "jane", "Class": "2nd year", "Subject": "Java", "marks": 70}

**Figure 10.** Mapping of relational table to Oracle NoSQL table.

The designed software prototype transforms all data of the required table into JSON format and temporarily stores this data into a text file. After converting data into JSON format, the next step is to insert data into Oracle NoSQL destination schema table. Finally, put() function is called to read JSON data from the file and store it into an Oracle NoSQL schema table.

#### **4. Implementation Details**

The approach discussed in the previous section is implemented in Java as Eclipse plugin. The implemented system starts working with the connectivity with a source relational database. After connectivity, two options will be displayed for conversion/transformation process. One is Schema Conversion and the other is Data Conversion. Which option is used depends on the user or administrator. If the user selects schema conversion, then the first step is to select the required database to transform into the Oracle NoSQL database. The next step is hidden from the user, which actually maps the databases and makes a conversion. In the last step, the transformed database schema will be displayed on the form. After creating schema from the relational to NoSQL database, a user can also transform data from MySQL to NoSQL. The second option is Data Conversion, if the user goes for this option, firstly, he will select the database and the required table from the database afterwards. The next step is to transform the data from the relational database to the Oracle NoSQL database. Consequently, a stored procedure is designed which transforms relational database data into Avro schema base JSON data. The entire working of the proposed system is shown in Figure 11.

**Figure 11.** Framework of the proposed approach.

#### *4.1. Module A. Creating Schema of Mysql Table and Store It in the File*

The function is used, which transforms the MySQL database tables into Avro Schema as shown in Figure 7. This function has the following steps.

1. Get metadata of MySQL database tables:

In this step, after database connectivity, MySQL tables are selected one by one and a function of Java metadatabase class library is called, which selects the table and its attributes.

2. Create a file:

For this step, a function of file Java class library is used, and to write data to this file PrintWriterfunction or PrintWriter Java class library are used.

3. Get keys from metadata:

In this part, the primary and foreign keys of are table are used for primary and foreign key mapping with NoSQL Avro Schema.

4. Map the data types of both databases and create fields in avro style:

In this step, the mapping process is defined, col.next() built-in function is used to select the column names of the tables one by one and compare the data type of MySQL table with Oracle NoSQL data types.

5. Create JOIN like parent-child relationship:

The fk.next() is a result set which hold the foreign key details and its corresponding tables. The table name of the foreign key is selected as a parent table name for the under-process table.

According to Oracle NoSQL, a parent-child relationship is like:

Parenttable.childtable (attributes with data types and primary keys of both tables).

#### *4.2. Module B. Schema from File to NoSQL*

In this module, the file is called, which has temporarily stores the schema of tables; after that, an object of Oracle NoSQL key-value store is created to access the NoSQL database. In the next step, an object of Table API is created for new table creation. Now the function runs while looped and gets data from files and sends it to KVstoreexecuteSync() function for table creation in the Oracle NoSQL store.

#### *4.3. Module C. Transform Mysql Data into Oracle NoSQL Data*

This module performs two tasks:

#### **5. Results and Discussion**

The implemented system was tested with a number of examples to verify the working of the tool and the accuracy of the transformation output. Here, MySQL is used as a source database and Oracle NoSQL is used as a target database. The experiment is performed on different datasets of databases. Our developed system has two parts, one is schema conversion, and the other is data transformation. In the Schema Conversion part, the software will work according to these steps:

**Figure 12.** Schema conversion details.

In the data transformation part, all steps are the same except for Step.5. The Step.5 of data transmission is started when a table is selected from the given tables. After selecting the table, and clicking on the Data transformation button, a function is called to get the data of the table from MySQL database and store it in a text file. After that, another function is called which gets data from a text file and stores it in specific schema table of the Oracle NoSQL database. The form will display the details of the converted table. The conversion detail of the city table is shown in Figure 13.

The proposed system is tested on a Ci5 2.4 Ghz processor with 4GB RAM with Ubuntu 14 OS on VM; five different databases are tested in the proposed system to check the effectiveness of the proposed system. The databases used for the evaluation of our proposed methodology are given below:

**Figure 13.** Data conversion details.

Figure 13 shows the screenshot of the data conversion module that allows the user to select a table name of the source database and it converts it into the Oracle NoSQL database table. Here, for the conversion, the approach discussed in Section 3.2 is applied and the results of the conversion are also shown in Figure 13.

#### *5.1. Evaluation Methodology*

The working, and the results, of the presented approach have been discussed in the previous section. To evaluate the performance of our approach, an evaluation methodology was designed to find how accurately the relational database schema and data is transformed into Key-value NoSQL format. An evaluation methodology, for the performance evaluation of intelligent tools, is used, and was originally proposed by Hirschman, L., Thompson in 1995 [36]. The following section describes the evaluation methodology used to evaluate the performance of our approach.

#### 5.1.1. Criterion for Evaluation

A criterion was defined for the quantitative evaluation of the designed approach to find how accurately it transforms the source database to the target database. Accuracy of the transformation is measured by finding how close the output is of our approach to the opinion of a human expert (named total results). In this study, the opinion of a human expert for the target input was taken and used as a total result for the sake of evaluation.

#### 5.1.2. Method of Evaluation

For the quantitative evaluation of the results of the used approach, each correct transformation (tables, fields, views, keys, etc.) was matched with the expert's opinion (*Ntotal\_transformations*). The results of all transformations were matched as all the transformations that matched the expert's opinion were declared correct (*Ncorrect\_transformations*), and otherwise, were considered incorrect (*Nincorrect\_transforamtions*).

#### 5.1.3. Measures of Evaluation

A set of evaluation measures used in our evaluation methodology are: recall, precision, and F-Measure. The details of these three evaluation measures are given below:

**Recall.** The recall can be attributed as the completeness of the results produced by system. In our methodology, Recall (R) is calculated by finding the number of correct transformation from the total number of transformations. In Equation (1), *Ncorrect\_transformations* is the number of correct transformations generated by the approach and *Ntotal\_transformations* is the number of total correct transformations.

$$R = \frac{N\_{correct\\_transformation}}{N\_{total\\_transformation}} \tag{1}$$

**Precision.** The precision can be attributed to as the accuracy of the designed system. Precision is measured by comparing the designed system's number of correct results by all (incorrect and correct) results produced by the system, calculated as: In Equation (2), *Ncorrect\_transformations* is the number of correct transformations generated by the approach and *Nincorrect\_transformations* is the number of total incorrect transformations.

$$P = \frac{N\_{\text{correct\\_transformations}}}{N\_{\text{correct\\_transformations}} + N\_{\text{incorrect\\_transformations}}} \tag{2}$$

**F-measure:** The F-measure can be attributed as a harmonic mean of Precision and Recall. F-measure is the harmonic mean or the "standard" average of total, correct, and incorrect results. By using harmonic mean, Sasaki (2007) [24] calculated F-measure using the following formula:

$$F = \frac{2(P)(R)}{P+R} \tag{3}$$

#### *5.2. Quantitate Evaluation*

A set of five cases were selected to test the accuracy of the transformation. The selected cases have a set of MySQL databases with different numbers of respective tables in each database. All these five cases were processed with our tool for schema transformation and then data transformation. Table 5 shows the results of schema transformation whereas, each metadata element was considered on the transformation element.

**Table 5.** Calculate the values of P, R and F-measure.

Table 5 shows that in all five experiments of RDB to NoSQL migration, the rate of success of transformation in terms of Recall was as high as 88 to 96%. There were rare incorrect transformations as well. In our approach, the conversion rules are supporting the maximum type of conversions from RDB to NoSQL.

Figure 14 shows the results of recall, precision and F-measure of all five different case studies. The results of these measurements show the accuracy and performance of the system under the different database loads. The results shown in Figure 14 depict that the schema to schema transformation and data to data transformation are carried out successfully.

ĐĐƵƌĂĐLJŽĨƚƌĂŶĨŽƌŵĂƚŝŽŶ

WƌĞĐŝƐŝŽŶ ZĞĐĂůů &ͲŵĞĂƐƵƌĞ

**Figure 14.** Evaluation results from Relational to NoSQL key-value store.

#### *5.3. Qualitative Evaluation*

These databases first tested on schema conversion and the details of this conversion are shown as a graph in Figure 15. In this graph, the world database has three tables, onlineQuiz has five tables and accounts has six tables; however, the conversion time taken for OnlineQuiz accounts for more than double the world class because the OnlineQuiz and accounts database have multi parent child relationship, and therefore, it takes the max time.

**Figure 15.** Schema Conversion time in microseconds.

The data conversion time of databases is shown in Figure 16. The single table data conversion time is the same, in the parent-child relationship there is a minor difference in time, but in the multi parent-child relationship, the time is double the parent-child relationship. This is because in the proposed software prototype, the process of mapping parent-child relationship is time consuming. In this process phase, the system finds all foreign keys which are linked with the child table then it creates NoSQL key value store (JSON) storage schema of data and sends it to databases.

**Data Conversion Time In Microseconds, Ci5 2.4ghz, 4GB RAM**

**Figure 16.** Data conversion time in microseconds.

We could not compare the results of our prototype tool to other tools as no other tool is available that can generate Oracle NoSQL database from the relational database. However, we have compared the results of our prototype tool to a few tools that migrate the relational database to different types of NoSQL databases. Table 6 shows a comparison of performance with the previous approaches:

In this paper, the used approach is novel and automatically transforms the existing database in MySQL to Oracle NoSQL database and provides a highly accurate transformation. The used approach uses a rule-based system to perform transformation at the schema level as well as at the data level. A software prototype for this transformation is also developed as a proof of concept. The results of the experiments show the correctness of our transformations, and outperforms the other similar approaches.

#### **6. Conclusions and Future Work**

This study has presented a system to automatically transform relational database into a NoSQL key-value store. The developed system does conversion at the schema level as well as at the data level. The user chooses the type of conversion one wants to perform. In the schema conversion part, the structure of the whole database tables with relationships will be converted to the Oracle NoSQL schema. In the data conversion part, the data of the required tables are converted to Oracle NoSQL supported data types. JSON schema is used for this conversion methodology. The software prototype is developed in Java language. The system has been implemented and evaluated on different sample databases. The results show that the transformation process is very efficient and accurate.

As a future direction, our approach will be able to enhance advance technologies to support all other relational databases and NoSQL databases. The transformation time can be further reduced by using direct entry method (from MySQL to Oracle NoSQL without using middle storage medium). Here, a model transformation to map RDB elements to NoSQL elements can also improve the accuracy and efficiency of the said migration.

**Author Contributions:** S.R. contributed in design, implementation, and experimentation of this research and writing this manuscript. I.S.B. supervised this work and also edited this manuscript. R.K. contributed in experiments and evaluation of this research.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Symmetry* Editorial Office E-mail<EMAIL_ADDRESS>www.mdpi.com/journal/symmetry

MDPI St. Alban-Anlage 66 4052 Basel Switzerland

Tel: +41 61 683 77 34 Fax: +41 61 302 89 18