AGENT MODELLING OF CLUSTER FORMATION PROCESSES IN REGIONAL ECONOMIC SYSTEMS

The subject matter of this research is the processes of the spontaneous clustering in the regional economy. The purpose is the development and approbation of the modeling algorithm of these processes. The hypothesis: the processes of spontaneous clustering in the social and economic environment are supposed to proceed not linearly, but intermittently. The following methods are applied: agent imitating modeling with an application of FOREL and k-means algorithms. The modeling algorithm is realized in the Python 3 programming language. The course regularities of clustering processes in the region are revealed: 1) the clustering processes are intensifying, the production uniformity is increasing; 2) the increase of the level of production uniformity leads to the leveling of customer behavior; 3) the producers of high-differentiated production reduce the level of its differentiation or leave the cluster; 4) the stages of steady functioning are illustrative for clustering processes, their change is followed with arising of bifurcation points; 5) the activation of clustering processes in regional economy leads to the revenue increase of the cluster participants, each of producers and of consumers, and to the growth of synergetic effect values. These results testify the nonlinearity of processes of clustering and ambiguity of their effects. The following conclusions have been drawn: 1) a modeling of the processes of spontaneous clustering in regional economy has showed that they proceed not linearly, a steady progressive development is followed with leaps; 2) the clustering of regional economy leads to the growth of the efficiency indicators of activities of cluster-concerned entities; 3) initiation and activation of the clustering processes requires a certain environment.


Introduction
Modeling the algorithms for the development of regional clusters is highly relevant for the countries implementing the cluster approach.This seems to be a live problem due to a great demand for effective management of clusters, regarding the goals and objectives of the regional economic policy.However, despite the high scientific development of the problems connected with clusters in prospect, their spontaneous emergence and regional clustering remain understudied.As a consequence, it is impossible to consider them for the projects of deliberately created clusters and in the support of clustering structure development.Moreover, it is absolutely necessary for large-scale creating those positive externalities developed by the regional clusters.
Further development of the Regional Cluster Theory and practice to implement the cluster approach requires the cluster process simulation that updates the task of finding the appropriate methods to be realized.
The analysis shows that the patterns and stages of cluster processes in a regional economy still remain unexplored; the mathematical apparatus for the calculation of the key indicators of the clusters arising from their members' behaviors sufficiently undeveloped.The problems mentioned above define the goal of the study, which is the development and application of the algorithm to clustering processes in regional economic systems.

Theory and methods
In the terms of System Theory, regional clusters are understood as a set of interrelated and interacting elements [25]; in the Chaos Theory, they are treated like objects that are heavily dependent on the starting conditions, minor changes in the external environment leading to unpredictable consequences for them [26,27].
Clustering as one of the universal ways to combine individual elements into a whole is widespread in nature and society, including the socio-economic environment.Clustering is a spontaneous process that is formed by the environment that can activate, inhibit or suppress it.
The defining of the cluster phenomenon and subsequent development of economic cluster concept have led to the situation where along with spontaneously formed clusters in the regional economy, there have also appeared deliberately created clusters.Thus, in modern regional economies, two types of cluster processes -spontaneous and managed -are simultaneously developing.Further analysis of causes, conditions and factors leading to clustering regional economies allows us to understand which kind of conversion is needed to activate clustering processes, and how to enhance the effectiveness of cluster projects.
At the disposal of the research team, there is a set of models describing essential aspects of clusters at the categorical level, their universal component-element composition, their organizational structure, functioning mechanisms, etc. [28] In the article under the regional cluster, we understand the non-institutional association of independent economic entities to implement their joint actions, based on proximity (territorial, sectorial, cultural), complementarity (product, resource, and process), interconnectivity (material, nonmaterial, informational [28, р. 162]).We refer the clustering process (formation) to the process of emergence and development of cluster structures, we refer the term "agent" to an economic entity, characterized by the needs, resources, the certain type of behavior altogether defined by the "conditionaction" rules [29], we refer a synergy effect to the additional sales (output), resulting from clustering processes 2 .
Interaction of agents in the cluster is as follows.One or several most successful manufacturers define the parameters of the manufactured goods.Information is spread through communication channels, and as a result, the manufacturers included in the cluster change the final products' specifications, which results in the increased sales.Advertising as a part of the communication between the agents in the cluster also contributes to the process.
Agents play the part of both producers and consumers.The consumer-agent acquires the necessary volume of production on the basis of existing preferences and his or her financial resources.Products or goods are of different sort of attraction for him of her: common attractiveness, characterizing products as a potentially attractive and preferred attractiveness which defines his or her choice of products at the moment of purchase.In the process of sale, the communication between the producer-agent and consumer-agent is carried out, aimed at attracting attention to the consumer, to help in choosing and purchasing incentives.The financial resources spent on the purchase by the consumer have been at the disposal of the producer; their stock is replenished within the economic activity and depends on the external economic environment.
We consider the clustering process to run on as follows.The first step of clustering is connected with core formation which consists of producers that have similar characteristics, such as production techniques, costs, resources consumed, level of innovation, etc.Then in such proto clusters, the information and resource flows are amplified to attract the providers of resources and consumers to be involved into the cluster core.The result is a network structure that provides communication, resource sharing and product interchange.
The algorithm of clustering process modeling in the regional economic system (hereinafter referred to as Algorithm) developed by the research team involves the simulation of agents' interaction in a cluster, considering their types and groups, environmental conditions, as well as the results of the processes of clustering, including the synergistic effect.

Model
In the simulation model, three types of agents are considered to be the participants of clustering: 1) agents-producers (products); 2) agents-providers (resources); 3) agents-consumers (products).The accepted assumption is that all agents-producers involved in the process of clustering produce one (or similar) product; agents-providers deliver one (or similar) resource; agents-consumers purchase one (or similar) product.
Each agent type is characterized by certain indicators that are selected by the authors and which are based on the analysis of contemporary models describing the agent's behavior at industrial markets (oligopoly models, competitive interaction models, linear and circular city models, multi-period model of pricing, etc. [30]).A set of selected indicators describes the processes of production and purchase that contribute to the formation and development of links between producers and consumers, that is, sequences of clustering developments in a regional economy that give some reasons to qualify them as necessary and sufficient for modeling the processes mentioned above.The description of the indicators used for the model is as follows.
The main characteristics of the agents-producers can be used to simulate the process of the cluster core formation; they are defined by the vector Z prt = ||z prit || based on integrated indicators of innovativeness, defined by expert method (innovative competence, organization and communication quality, innovative receptivity, resourcing [31]).Accepted assumption is that these characteristics remain constant throughout the whole modeling period.
The common attractiveness of the products is set by vector P cap = ||p capit ||.It includes the indicators defined on the basis of analysis of the cluster investigated and the product to be specialized: the price of a product in monetary units; the level of technology set by the expert method (1 -low, 2 -medium, 3 -high); product quality set by the expert method (1 -low, 2 -medium, 3 -high).The vector varies while restructuring production in a specified modeling time tact.
The common attractiveness of the resources sets vector P car = ||p carit ||.It includes the following indicators: the price of a resource in monetary units; the availability and quality of the resource set by the expert method (1 -low, 2 -medium, 3 -high); the quality of the resource specified by the expert method (1 -low, 2 -medium, 3 -high).
The preferred product attractiveness sets vector P ppa = ||p pait ||, the preferred attractiveness of resources sets vector P par = ||p parit ||.They are similar to the vectors of the common attractiveness.
Initial funding at the beginning of modeling time is set for agents-producers and agents-providers and defines the initial values of the funds, which can be spend on the purchase of resources (products).
Indicator "Funds planned to purchase products (resources)" is set for agents-producers and agentsconsumers.The value of this indicator for agents-producers at the every tact of the modeling time is determined by the formula: where c pi -the price of a resource, monetary units; v necess.res.-the necessary resources to manufacture a product, units; v vpt -the volume produced at the tact of time, units.Financial resources planned to purchase products for agents-consumers are set by the expert method.
The volume of goods (resources) produced is set for each tact of the modeling time, and is determined by the needs of agents-consumers.In the model, the accepted assumption is that all products manufactured by agents-producers are purchased by agents-consumers.The volume is calculated by the formula: where f fpc -funding, planned by the agent-consumer to purchase products, monetary units; M -the number of agents-consumers wishing to purchase products; c prod -the price of a product unit, a monetary unit per a product unit.
The amount of funding received in a tact of modeling time is set for all types of agents: for agentsconsumers, it is set as funding in a tact of modeling time by receiving a salary, income from activities, etc.; for agents-producers and agents-providers, it is determined according to the formula: The cost of funding in a tact of modeling time is defined as the cost of resource acquisition, production, restructuring of production, etc.
The profit from sales of products (resources) to a tact of modeling time is determined by the formula: where f receivedt -profits from sales of products (resources) to a tact of modeling time, monetary units; h expt -production cost to a tact of modeling time, monetary units.The balance of funding in a tact of modeling time is set for all types of agents according to the formula: where f bt -1 -the balance of funds at the previous period of modeling time, monetary units; f prt -profits of an agent to the current period of modeling time, monetary units; h ext -expenses of an agent in the current period of modeling time.
The clustering process, as mentioned above, starts with the cluster core formation.In a simulation model agents-producers are united into the first from cluster-forming structures based on the calculation of distances between them (the Algorithm uses the Euclidean distance) according to the matrix of the main characteristics for each modeling time tact.Selecting the core of an emerging cluster is carried out using the FOREL algorithm.The cluster core might be not selected if agents-producers are rather different by their characteristics.Modeling the interaction of agents is implemented analyzing one cluster as an example.
The initial phase of simulation assumes that the clustering processes are not started; the production and sale of products are carried out by individual agents-producers, among whom, there is no information exchange; innovative technologies are not embedded.The duration of the initial phase is set by the user.
In order to determine the optimal vector of the common attractiveness of the product, the marketing research is conducted.In the cluster simulating, the mathematical model of agents-consumers using algorithm k-means is implemented.Special rules to conduct marketing research (the number of clusters selected and cost of the study calculated) are specified by the user.The optimal vector of the common attractiveness of products represents a profile of the mathematical cluster.
According to the results of marketing research, the restructuring of the production through the introduction of innovative technologies is embedded that affect the productive characteristics.The rules of the production restructuring specify the increment of common attractiveness vector for a given tact of model time, taking into account the values of the optimal vector of the common attractiveness of product.
In the simulation model, the parameters of agents' emergence and collapse can be specified.These processes occur according to the laws of growth given.
Group indicators of modeling clustering processes have the following characteristics.Characteristics of types and classes of agents are set either by the user or by using a random number generator.In the first case, the classes of each type of agents (producers, providers, consumers) are set, determining the number of agents with the same (similar) indicators.The number of classes and the number of agents in each class are also set.
Emergence (collapse) Law of agents defines the increase/decrease in the number of agents of various types and classes.The Law of Exponential Growth or any other law can be used.
Product (resource) attractiveness indicators for all classes of agents are specified by the user or by using random number generators if the classes of agents are not specified.
The threshold of the distance of product (resources) purchase defines the minimum threshold value to the distance between the vectors of common and preferred product attractiveness (resource).
The rules of marketing research specify the number of the selected mathematical clusters of agents-consumers and cost of marketing research.
The rules of production restructuring set the speed of parameter changes in the common attractiveness of manufactured products (resources) while introducing innovative technologies and modernization of products.
The modeling time parameters specify the simulation period and a modeling time tact.
The clustering process indicators determine the beginning of the process and intensity of information flow for each tact of modeling time.
In the model, the following types of modeling time tacts are set: zero -t 0 ; simple communication of agents -t 1 ; starting point of clustering -t 2 ; marketing research -t 3 ; restructuring of production without promoting the modified product to market -t 4 ; introducing the modified product to market without the restructuring of production -t 5 ; introducing the modified product to market with restructuring of production -t 6 ; product promotion -t 7 ; changing the rules of behavior for consumers -t 8 .
As a result, the following indicators are defined: -the volume of products manufactured by agents-producers (at the initial stage, at the stage of clustering, for the entire period of modeling); -the volume of resources created by agents-producers (at the initial stage, at the stage of clustering, for the entire period of modeling); -funding indicators (at the initial stage, at the stage of clustering, for the entire period of modeling); -synergistic effect.
A synergistic effect can be calculated for a particular phase of clustering according to the following formula: where v vptb1 -the volume of product sales by agents-producers at the current stage of clustering b 1 ; v vptb0 -the volume of product sales by agents-producers at the previous stage of clustering b 0 .Process simulation of clustering in regional economy is carried out according to the following algorithm.
Stage 1. Specifying the input parameters: types of agents, classes, their number, characteristics, etc.
Stage 2. Cluster core developing.Stage 3. Specifying the characteristics of clustering, agent's behavior for each tact of modeling time.
Step 3.1.Specifying the tacts of modeling time.
Step 3.2.Simulating the flow of resources to the agents in the initial time t 0 .
Step 3.3.If one specify tact t 1 , move to step 3.4; if t 2 -move to step 3.14; t 3 -move to step 3.16; t 4 -move to step 3.19; t 5 move to step 3.22; t 6 -move to step 3.24; t 7 -move to step 3.28; t 8 -move to step 3.31.
Step 3.4.Calculation of distances between the vectors of the common attractiveness and preferred attractiveness of products.
Step 3.5.Selection of classes of agents-consumers taking into account the threshold distance of product purchase.
Step. 3.6.Calculation of volume of production manufactured by agents-consumers for each agentproducer or class of agents-producers.
Step 3.7.Calculation of the necessary resources for each agent-producer or class of agentsproducers.
Step 3.8.Calculation of distances between the vectors of common attractiveness and of the preferred attractiveness of resources.
Step 3.9.Selection of agents-providers minding a threshold distance of purchasing resources and acquisition of the resources.
Step 3.10.Production process run by agents-producers.The calculation of indicators of created resources, using funds for agent-provider -agent-producer's interaction.
Step 3.11.Promoting to the market and product purchase by agents-consumers.
Step 3.12.Calculation of agents' financial flows, resource flows, sale (purchase) flows of products.
Step 3.14.Changing the intensity indicator of information intracluster flow, taking into account the initial data.
Step 3.16.Marketing research: cluster analysis, profiles of developed mathematical clusters.
Step 3.19.Production restructuring with the introduction of new technologies.Profile change of common attractiveness of products taking into account the values of restructuring.
Step 3.22.Marketing products, modified as a part of production restructuring Step 3.23.Move to step 3.3.
Step 3.24.Production restructuring with the introduction of new technologies.Profile change of common attractiveness of products taking into account the values of restructuring.
Step 3.25.Marketing products, modified as a result of production restructuring.
Step 3.28.Changes in the intensity of intracluster advertising flow taking into account initial data.
Step 3.31.Profile change of the preferred attractiveness for the specified groups/number of agentsconsumers, taking into account the intensity of intracluster advertising flow and initial data.
Step Algorithm is implemented in the programming language Phyton 3.

Results
The source data for the simulation are shown in the Figure 1.Simulation of the interaction is carried out only for two types of agents (agents-producers and agents-consumers) as the necessary and sufficient number for activation of clustering processes.In the simulation model, two classes of agents-producers and four classes of agents-consumers are selected.The number of agents for the modeling time remains unchanged.
At the starting point of modeling time, the agents-producers of the 1 st class have funds of 1000 monetary units, the agents-producers of the 2 nd class -1500 monetary units.The products manufactured by the agents-producers of the 1 st class have a low price (6 monetary units), low level of technology and quality, the products by the agents-producers of the 2 nd class have a higher price (10 monetary units), a higher quality, but low manufacturability.The cost of manufacturing of a product by the agents-producers of the 1 st class is 5 monetary units, a product by the agents-producers of the 2 nd class -6 monetary units.
With the first tact of modeling time, the agents-consumers of the 1stclass, 12 in number, are ready to spend 40 monetary units to purchase the inexpensive products of average manufacturability but of low quality, the agents-consumers of the 2 nd class, 20 in number -30 monetary units to purchase the products of low quality, low level of technology at low cost, the agents-consumers of the 3 rd class, 2 in number -50 monetary units to purchase the expensive products of high quality and manufacturability, the agents-consumers of the 4 th class, 5 in number -50 monetary units to purchase products of high quality and manufacturability at low cost.R-Economy Vol.Indicators of the preferred attractiveness to purchase products: Price, monetary units The model assumes that the agents-consumers purchase products if the distance between the vectors of the common and preferred attractiveness of the products does not exceed 2.9.
The simulation period T amounts to 8 tacts of the modeling time, the interval of the modeling time is a tact.The order and characteristics of modeling time, tacts are shown in Table 1.With the third tact of modeling time the birth or starting stage of clustering processes takes place and intensification of information flows between agents-producers begins.As all producing agentsproducers have the same (similar) characteristics, they all fall within the core of the cluster.
With the fourth tact of modeling time, the marketing research with selecting two groups (mathematical clusters) of the agents-consumers and their profiles with the use of the algorithm k-means is conducted.The marketing research costs 80 monetary units.
In the process of clustering according to the market research, there is a change in the common attractiveness of products towards the developed profiles for preferred attractiveness in the mathematical clusters.The change in this indicator happens with the introduction of innovative technologies and the convergence of common product attractiveness profiles with preferred product attractiveness profiles developed for mathematical clusters.The changing possibilities of the common product attractiveness profile with the introduction of innovative technologies are summarized in Table 1.
Table 2 shows the calculated distances between the vectors of the common and preferred attractiveness of the product for 1 st -3 rd modeling time tacts.
In Table 2 the distance between the vectors of the attractiveness of products that defines the agents-consumers' behavior is highlighted in bold: -agents-consumers of the 1 st class purchase the products of the agents-producers of the 2 nd class; -agents-consumers of the 3 rd class purchase the products of the agents-producers of the 1 st class; -agents-consumers of the 2 nd and 4 th class do not buy products.
With the fourth modeling time tact according to the results of marketing research the agentsconsumers are divided into two mathematical clusters.The profiles and the population of the clusters obtained are shown in Table 3.
Cluster 1 includes the agents-consumers of the 2 nd class with low requirements for purchased products; Cluster 2 includes the agents-consumers of the 1 st , 3 rd and 4 th classes.
With the fifth tact of modeling time, the agents-producers according to market research change the values of the vector of the common product attractiveness with the introduction of innovative technologies.The value of new profiles of the common product attractiveness is given in Table 4.With the fifth tact, the unmodified products are sold, so the agents-consumers' behavior does not change.
With the 6 th tact of modeling time the upgraded products with changed indicators of common attractiveness are sold.Distances between the vectors of common and preferred attractiveness are shown in Table 5.
In Table 6, the distance between the vectors that define the behavior of agents-consumers are highlighted in bold: -agents-consumers of the 1 st , 2 nd and 4 th class purchase the products of the agents-producers of the 1 st class; -agents-consumers of the 3 rd class do not buy products; -products manufactured by the agents-producers of the 2 nd class are not acquired.
With the seventh tact of modeling time, the agents-producers of the 2 nd class change common product attractiveness profile according to the rules given in Table 2. Common attractiveness profiles of products for the eighth tact of the modeling time are shown in Table 5.
With the eighth tact of modeling time, the simple interaction of agents with the given rules of behavior is carried out.Distances between the vectors of the common and preferred attractiveness of products for the eighth tact of modeling time are shown in Table 6.With the 8 th tact of modeling time, all agents-consumers purchase the products of the agentsproducers.
Income and expenditures of all types of agents, synergy values for each modeling time tact are shown below.
There is a rise in sales on the seventh tact of modeling time (Fig. 2).This can be explained as follows.Agents-consumers of the 2 nd and 4 th classes start to purchase products at the last modeling time tacts, once the necessary funds have been accumulated and common product attractiveness profiles have been changed in such a way that the distance between the vectors of common and preferred attractiveness falls within the range of allowed values (Fig. 1).
Figure 3 shows the indicator values of agents-producers' actions in every tact of modeling time.
Figure 4 shows the modified values of funding for agents-consumers.
Modeling of clustering processes performed on the basis of the developed algorithm shows that as a result of their revitalization in the regional economic system, both the value of the balance of funds (profit) of agents and the value of synergies increase.The bifurcation point, as can be seen from the results of the calculations is in the seventh tact of modeling time.
Once clustering enhances the information exchange among all agents, their behavior also changes.In particular, the values of the common product attractiveness vector, as well as the volumes of manufactured (acquired) products, are changed taking into account the results of marketing research.This leads to a drastic change of clustering indicators at the bifurcation points, which corresponds to the changing phases in clustering process.

Conclusion
The computing experiment reveals the following patterns of clustering process flow.1.With the intensification of clustering processes, there is equalizing of common attractiveness indicators for cluster products, and the goods manufactured in clusters, over time, become less differentiated and more homogeneous.This is partly due to the increased connectedness of cluster members, forming a clearer structure that helps to activate the internal processes and to enhance synergies.
2. Improving the level of uniformity of the products manufactured in clusters generates a certain type of buyers, gradually increasing their uniformity in consumers' behavior.Clustering, thus, contributes to the development of industrial and mass production.Manufacturers of unique consumer-oriented and highly diversified products, either leave the cluster or collapse due to the decrease in profit.
3. The clustering processes are characterized by stages of quiet operation when the volatility of the main indicators of the cluster is not high.Changing of clustering stages is accompanied with points of bifurcation, in which there is an abrupt change in the values of the major indicators of clustering, followed by either the quiet phase, either the next point of bifurcation.These results indicate instability of intraclustering processes, which, in turn, results in the phase-by-phase transition to clustering with the increase of entropy that raises the level of uncertainty and requires special approaches for decision making [32].
So, the task of modeling natural clustering in regional economy is set for more complete and accurate information on necessary and sufficient conditions of their operation.The patterns of the natural formation of regional cluster structures apply to deliberately generated clusters, as they appear to a special phenomenon of economic clustering.
To increase the efficiency of regional clusters, both managed and self-organizing, a certain quality of economic environment is required.The proposed algorithm allows the authors to take into account the large number of parameters of clusters and watch them change when changing the specified conditions.The results will provide an opportunity for persons interested in cluster development such as managers, representatives of authorities, who are to implement the cluster projects and programs, improve the management of clustered structures, choosing the tools and techniques affecting their development most adequately, while understanding the processes being specific for them.
A computer simulation model, as we hope, will be interesting and useful for professional researchers of cluster phenomenon, teachers, students and anyone interested in this field.
A tested computer model is planned to be carried out in cooperation with regional executive bodies or other authorities interested in clustering processes, as computer simulation of the processes for specific industries or particular regions of the Russian Federation requires the collection and processing of large stock of the expert data and, therefore, significant administrative and time resources to be used.

3 . 32 .
Move to step 3.3.Stage 4. Calculation of resulting indicators of simulation (for each tact of modeling time and resulting indicators).Stage 5. Calculation of the synergistic effect of clustering.Step 5.1.Calculation of absolute deviations from resulting modeling indicators.Step 5.2.Determination of the maximum calculated values in the absolute deviations.Step 5.3.Finding points of bifurcation.Step 5.4.Calculation of synergetic effect for each stage of the clustering process .Stage 6. Cognitive visualization of simulation results.

Fig. 1 .
Fig. 1.Input data map for modeling of clustering processes in regional economic system