1 Introduction

Communicable diseases are the fast growing disease outbreaks which happens when a person comes in contact of another diseased person and it becomes community transmission. Nowadays, COVID-19 is a dangerous disease spreading rapidly all over the world (World Health Organization et al. 2020a) by means of community transmission. Community transmission means when the disease is transferred from a local person to another person and spreads over the society. World Health Organization (WHO) has declared it as global pandemic as it is affecting peoples life and causing many deaths. Currently, according to the reports of WHO there are 106M confirmed cases, 2.31M deaths, and it affects nearly 208 countries. The developed countries like USA, Spain, Italy, Germany, France, etc., are mostly affected of this. It is rapidly affecting the health as well as economy of the country.

The people affected with COVID-19 experience respiratory illness and they recover themselves after a certain time without any special treatment (World Health Organization et al. 2020a). The older people need special treatment if they have other medical problems such as heart disease, diabetes, respiration problem, blood pressure, and cancer. The common symptoms of COVID-19 include fever, tiredness, dry cough, and other symptoms include shortness of breath, pains and aches, sore throat, and some people may report diarrhea, runny nose, and nausea. The people with mild cases may contact medical helpline or can use self-isolation. The people with critical case should go immediately to hospitals for proper and sudden treatment.

COVID-19 can be prevented by following some common practices such as (World Health Organization et al. 2020a):

  • Cleaning Washing hands and fingers are regularly with soap and water or cleaning them using alcohol based hand rubs.

  • Social Distancing Maintaining distance from others at least 1 meter from other (persons sneezing or coughing or any unknown persons)

  • Avoid Touching Face Avoiding touching eyes, nose, ears, and mouth.

  • Cover Covering the mouth with hygienic masks or any other material that can work as mask.

  • Refrain Refraining from smoking and other activities which weakens the respiratory system.

  • Practice Practicing the above points in a right manner to serve humanity.

From the above points, it is observed that social distancing will be a better solution and key to combat with this pandemic. From the reports of WHO, the countries which implemented this effectively for weeks have a great control over the disease. Social distancing means keeping ourselves away from a person or group of persons. This can be performed by staying at home for weeks or not moving to public places by following government rules. This means that density of the people in an area is reduced, to control the number of infected persons. If there are no persons or very little density in an area then the chance of COVID-19 spread can be controlled in a massive way. In this work, a simulation model is proposed to show the impact of social distancing over a density where an infected person walks randomly and the infection spread and control are analyzed.

The major contributions in this work are stated as follows:

  1. 1.

    In this work, the community transmission is presented using simulations. It shows how an infected person affects the healthy persons in an area. This is performed by random walk model where an infected person is randomly moved in an area A by affecting the healthy persons in the neighborhood. The person moves from point A to point B, point B to point C, and then from point C to point D.

  2. 2.

    Simulations also show how social distancing can control the spread of COVID-19. This is performed by reducing the density of healthy persons in that area, and analyzing the number of healthy persons and infected persons in that area.

  3. 3.

    The simulation is performed in GNU Octave programming platform by considering number of infected persons and number of healthy persons as parameters.

  4. 4.

    Results show that using the social distancing the number of infected persons can be reduced and heathy persons can be increased.

The rest of the sections is presented as follows. Section 2 shows the related works. Section 3 presents the problem and methodology to solve the problem. Section 4 presents the simulations and results. Section 5 presents the conclusion and future scope.

2 Related works

Many research works are currently going on to combat COVID-19 which is rapidly increasing day by day all over the world. Many updated articles are published on COVID-19 regarding spreading, medicines, vaccinations, preventive measures, etc. Chen et al. (2020) present the research on control of COVID-19 in China during the new year. Anderson et al. (2020) presented the influence of country-based mitigation methods over COVID-19 spread. Remuzzi and Remuzzi (2020) presents the articles on social distancing in UK due to rise of deaths over the world. Wilder-Smith and Freedman (2020) proposed the article by showing how the old methods such as isolation, quarantine, social distancing, and community containment reduce the effect of COVID-19. Wu and McGoogan (2020) presents the characteristics of lesson from COVID-19 outbreak at China. Dalton et al. (2020) presents that the low-cost social distancing can reduce the severity of cars in COVID-19. Roosa et al. (2020b) predicted the spread of COVID-19 in China from February 5th, 2020 to February 24th, 2020. Leung et al. (2020) presented the mass masking for guidance in COVID-19 spread. Ferguson et al. (2020) presented the impact of non-pharmaceutical interventions over the death rate in COVID-19. Thomson (Oxford Analytica 2020) presented a survey in social distancing that how it works in this situation. Roosa et al. (2020a) forecasted the spread of COVID-19 in Guangdong and Zhejiang from February 13 to February 23, 2020. Yap et al. (2020) presented the social distancing and lockdowns report on COVID-19. Stein (2020) presented the idea about rationally layered social distancing. Jiang et al. (2020) presented a review of clinical characteristics on COVID-19. Many such works are presented in regarding social distancing and COVID-19 (Mahase 2020; Fauci et al. 2020; Ebrahim and Memish 2020; Lipsitch et al. 2020; Mizumoto and Chowell 2020; Wilder-Smith et al. 2020; Thomson 2020; Desai and Patel 2020; Nkengasong and Wessam 2020; Baker 2020; Zhang et al. 2020; World Health Organization et al. 2020a, b; Jiang et al. 2020; Ruan et al. 2020; Bai et al. 2020; Coronavirus Pneumonia Emergency Response Epidemiology Novel et al. 2020; Xie et al. 2020; Melin et al. 2020a, b; Boccaletti et al. 2020; Castillo and Melin 2020, 2021; Shafer et al. 2021; Zhu et al. 2021; Marko et al. 2021; Gunawan 2021; Huang et al. 2021; de Souza Melo et al. 2021; Dong et al. 2020). From the study, according to our knowledge, no such work is performed by the researchers based on simulations of random walk by the infected persons or use of social distancing to reduce the infected persons in an area.

3 Methodology

This section describes clearly about the problem definition and the methodology or solution to solve it.

3.1 Problem statement

Let, an infected person moves randomly in an area A of size \(l\) \(\times \) \(b\) where l and b are the length and breadth, respectively. The person moves from point A to point B, point B to point C, and then from point C to point D. In this move, the person affects another healthy person in that area based on neighborhood with a certain distance d. The main problem is to present this situation with an illustration and solving the problem using social distancing solution by reducing the number of infected persons and increasing the number of healthy persons in an area.

3.2 Methodology

In this section, the above problem is solved using an illustration and social distancing approach. To represent the problem with an illustration, an area of A is considered. In that area, there are h number of healthy persons and we consider each person in that area is healthy. We assumed this situation because no COVID-19 cases appear in that area till now. So, the density of that area is considered to be \(\lambda \) where it is represented as:

$$\begin{aligned} \lambda =h+n; \end{aligned}$$
(1)

where n is the number of infected persons.

Fig. 1
figure 1

A COVID-19 infected person infecting healthy persons in its neighborhood

Fig. 2
figure 2

Use of social distancing to reduce the number of infected persons

From Fig. 1, it is observed that a COVID-19 infected person (orange) starts his journey from point A to point B. That means in this example, the coordinates of point A and point B are randomly generated. The points are generated using pseudorandom number generation function that generates the coordinates (xy) randomly as follows:

$$\begin{aligned} x\ or\ y=\mathrm{{randi}}([a\ b],1,c) \end{aligned}$$
(2)

where a and b are the numbers between which the random number is generated and c is the number of coordinates generated. The coordinates of all persons in that are generated using Eq. (2).

The infected person (orange) affects those persons who are in the neighborhood. The neighborhood is defined as the persons nearer with maximum threshold distance d. The distance is calculated by using the Euclidean distance formula as follows in Eq. (3):

$$\begin{aligned} d=\mathrm{{sqrt}}\left( (x1-x2)^2 + (y1-y2)^2\right) \end{aligned}$$
(3)

From Fig. 1, it is observed that the person affects \(\{n_1,n_2,n_3,n_4,n_5,n_6,n_7\}\) in the journey because they are all in the neighborhood. Seven number of healthy persons are affected due to a single person. However, if the density of people in this area is less then the number of infected cases will be less than 7. This can be performed by social distancing where the density of persons in an area is reduced.

Social Distancing is the solution to reduce the number of infected persons in an area by reducing the density of people in an area. Let, say in an area A the density of people is \(\lambda \) where all persons are healthy initially. Then, after the move of that infected person \(n_k\) number of healthy persons get affected and the rest number of healthy persons are represented as:

$$\begin{aligned} h_1=\lambda -n_k \end{aligned}$$
(4)

where \(h_1\) is the number of healthy persons after movement of that infected person from A to B. From Eqs. (1) and (4), \(h_1<h\). By applying social distancing as shown in Fig. 2, the number of healthy persons can be increased and infected persons can be decreased. According to Fig. 2, the person only affects \(n_2\) and \(n_5\) because the density \(\lambda \) reduces. The total number of healthy persons after social distancing is represented as:

$$\begin{aligned} h_2=\lambda -n_p \end{aligned}$$
(5)

where \(n_p\) is the number of infected after social distancing. From Eqs. (4) and (5) \(h_2>h_1\). Hence, by using social distancing in this example the COVID-19 spread can be controlled.

figure a

Algorithm 1 shows the implementation of community transmission and the impact of social distancing over this. Step-2 to Step-4 show the deployment of \(\lambda \) (number of healthy persons) in area A by generating the coordinates randomly using randi(). Step-6 to Step-11 move the person from point A to point B. Step-13 to Step-20 move the person from point B to point C. Step-22 to Step-27 move the person from point C to point D. Step-29 to Step-40 show the implementation of community transmission and social distancing with distance d. The number of infected persons n and number of healthy persons h are calculated using Step-41 and Step-46, respectively. This method can be a better solution for reducing the number of infected cases. This is analyzed by simulations which is presented in the next section.

4 Results and discussion

The simulation is performed in GNU Octave programming platform. It is based on MATLAB programming. This platform is installed in a machine of Intel core i3 processor of speed 2.4 GHz, RAM 8 Gb, and 64 bit Windows operating system. In this simulation, the community transmission is implemented by moving an infected person in an area A where the area has a density of healthy persons. The person moves from point A to point B, point B to point C, and then from point C to point D. The points are generated randomly to implement the random walk. The infected person affects those persons in the move who are in the neighborhood. This can be reduced by the implementation of social distancing where the density (number of healthy people) of an area is reduced. In this section, a study has been made by varying the density of people in an area. The main parameters are considered to be number of healthy persons and number of infected persons. To set up the simulation, major parameters are set and represented in Table 1 as follows.

Table 1 Parameter and value
Fig. 3
figure 3

Simulation results of impact of social distancing on community transmission when the infected moves from point A to point B. Green line: Move of infected person, red circle: infected people, and blue: healthy people (colour figure online)

Fig. 4
figure 4

Simulation results of impact of social distancing on community transmission when the infected moves from point A to point B then point C. Green line: Move of infected person, red circle: infected people, and blue: healthy people (colour figure online)

In this simulation, an area of 1000 \(\times \) 1000 m\(^2\) is considered for implementation of community transmission and social distancing. The community transmission is implemented by deploying \(\lambda \) density of healthy people in the area using randi() to generate the coordinates. The position of the healthy persons generated is assumed to be the current position. An infected person moves randomly by starting at a random position and moves to other random positions straightly. It moves in the route \(A-B-C-D\). The person transfers the disease to that person if that persons position is at a distance lower than 10 m. After that, social distancing is implemented by reducing the density from \(\lambda =1000\) to \(\lambda =200\) and observing the impact of this on number of infected persons and number of healthy persons. The simulation results are average of 10 simulation runs.

Table 2 Impact of social distancing on community transmission
Table 3 Impact of social distancing using Markov model, approximated infected population values adapted from Bendtsen Cano et al. (2020)

From Fig. 3, it is observed that when the infected person moves from point A to point B by varying the density from 1000 to 200 then the number of infected people and number of healthy people are observed to be {14,11,7,4,2} and {986,989,993,996,998}, respectively. From Fig. 4, it is observed that when the infected person moves from point A to point C by varying the density from 1000 to 200 then the number of infected people and number of healthy people are observed to be {18,18,20,6,2} and {982,982,980,994,998}, respectively. From Fig. 5, it is observed that when the infected person moves from point A to point D by varying the density from 1000 to 200 then the number of infected people and number of healthy people are observed to be {24,20,11,11,5} and {976,980,989,989,995}, respectively. From the above results represented in Figs. 6, 7 and 8, it is concluded that when the density of people in an area decreases the number of infected people reduces and number of healthy persons increases. It is also concluded that when that persons move more then it is affecting more people. Therefore, social distancing should be implemented well by the government to reduce the number of infected cases. Table 2 shows the impact of social distancing on community transmission, when density of people decreases number of infected people decreases and number of healthy persons increases.

Fig. 5
figure 5

Simulation results of impact of social distancing on community transmission when the infected moves from point A to point B, point B to point C, then point D. Green line: Move of infected person, red circle: infected people, and blue: healthy people (colour figure online)

Fig. 6
figure 6

Impact of social distancing on community transmission when the infected moves from point A to point B

Fig. 7
figure 7

Impact of social distancing on community transmission when the infected moves from point A to point B then point C.

Fig. 8
figure 8

Impact of social distancing on community transmission when the infected moves from point A to point B, point B to point C, then point D

From Table 3, it is observed that the social distancing is implemented with UK data and shown using simulations by the researchers in Bendtsen Cano et al. (2020). R value shows the reproduction number to show the transition probability in Markov Chain. From the results, it is observed that when the R value is 0 means perfect social distancing is maintained the infected persons reduced to zero in 5–10 days. When the value of R is 0.5 means somewhat relaxation of social distancing the infection reduces day wise as shown in Table 3. When R is 0.75 when more relaxation in social distancing is maintained the day wise cases are greater than 400,000. From this, we can conclude that all such researchers proposed their models of social distancing to show the impact over a population. In our work, we have considered a random walk model, which is different from others where an infected person walks randomly in an area and how he/she transfer the disease.

5 Conclusion

In this work, the community transmission is presented using simulations. It shows how an infected person affects the healthy persons in an area. This is performed by random walk model where an infected person is randomly moved in an area A by affecting the healthy persons in the neighborhood. The person moves from point A to point B, point B to point C, and then from point C to point D. Simulations also show how social distancing can control the spread of COVID-19. This is performed by reducing the density of healthy persons in that area, and analyzing the number of healthy persons and infected persons in that area. Results show that using the social distancing the number of infected persons can be reduced and heathy persons can be increased. It is also concluded that when the person moves more in that area he affects more people. Therefore, social distancing, isolation, and home quarantine will be better solutions to be implemented well by the government to reduce the number of infected cases. In future, many such mathematical models, prediction models, etc., can be developed and improved to predict the impact and control of this pandemic.