Statistical analysis of the crowd dynamics in Al-Masjid Al-Nabawi in the city of Medina , Saudi Arabia

Purpose – The purpose of this study is to analyze the crowd dynamics of the visitors at Al-Masjid alNabawi during the most oversaturated period to characterize the most critical conditions and suggest technical solutions to accommodate visitors and provide them safe passage. Design/methodology/approach – In this study, the time of entrance from the Al-Salam Gate to the tomb and from the tomb to the exit from the Al-Baqi’ Gate has been collected in the most oversaturated period. To be precise and to model the worst case, important crowd measures of effectiveness data are collected in the two holiest times considered by Muslims, during the holy month of Ramadan and the month of Dhul-Hijjah and during the busiest hours of the day to consider safety factors while proposing future solutions. The conventional manual head-counting method has been adopted to determine the crowd density and to carry out actual counting of the visitors from the recorded videos and photos captured by the legitimate authority. Findings – The analyses revealed that the crowd dynamics in the month of Ramadan (peak) are statistically different from those for other times (off peak). In general, the crowd dynamics at all times on days other than Ramadan are almost identical. Originality/value – The results of crowd characterization from this study are expected to help optimize crowd management in the Masjid at the most critical location and time. The data collected in this study could be used for future research to simulate similar crowd scenes or for even different crowd management scenarios in case of emergencies such as fire hazards or evacuation process.


Introduction
Located in the western region of Saudi Arabia, Medina attracts Muslims worldwide for its historical significance and also the Al-Masjid an-Nabawi, the mosque established over the tomb of Prophet Mohammed.Medina encompasses an area of 590 km 2 inhabited by approximately two million people, making its density approximately 3390 people/km 2 .However, during the season of Al-Hajj (pilgrimage), a mandatory religious duty to be carried out once in a lifetime by all the Muslims with good financial and physical capability, the population density varies significantly.Performing Umrah is another pilgrimage task for Muslims.Medina thus becomes overcrowded in the busiest Islamic seasons, Al-Hajj (Kırlangıço glu, 2015), considering the immense devotion of Muslims toward their spiritual obligations.The Saudi Government has been working extensively for the last few decades to ensure the accommodation of a maximum number of people as possible.The Al-Hajj and Umrah seasons enhance Saudi Arabia's annual income; hence, statistical analysis of the crowd density at the Mosque of Prophet (PBUH) in Medina is worth understanding.The crowd density could increase up to four times Medina's actual population during the busiest seasons.This enormous number warrants a wise consideration for crowd management (Alshehri et al., 2015).Furthermore, the crowd density must be limited to ensure visitors' safety (Moussaïd et al., 2011), as overcrowding would put visitors at risk.Therefore, crowd management during the Al-Hajj and Umrah seasons necessitates a meticulous analysis of the crowd density.As evacuation plans are mostly dependent on the crowd estimates, the approximate number of the visitors along with the citizens must be studied well (TSO, 2010) to establish a constructive plan.
Purpose of the study Al-Hajj, the fifth pillar of Islam, and Umrah, especially in the holy month of Ramadan, are the two holy pilgrimages for all Islamic nations, the former being obligatory and the latter non-obligatory.However, Muslims tend to perform both pilgrimages as part of their religious obligations in a single journey.Thus, the Hajjis (pilgrims) perform Umrah in Makkah and thereafter head to Medina to visit Al-Masjid an-Nabawi and the Prophet Mohammed's tomb to achieve the maximum benefit of their visit (Alshehri et al., 2015).Being internationally recognized, this pilgrimage attracts Muslims worldwide during these seasons, while the Saudi Arabian Government plan extensively to host the enormous number of pilgrims annually.However, with the enormous increase in population, several factors arise, affecting the well-being of the visitors and the citizens.With no intention of preventing any Muslims from practicing their spiritual obligations, the Saudi Arabian Government works on accommodating the Hajjis rather than limiting their numbers; this intricate process requires sophisticated planning.The first step of this plan is to consider the statistical analysis of this annual season to know the approximate number of the Hajjis visiting Medina in the Al-Hajj season as well as those visiting in the month of Ramadan (Seyfried et al., 2005).The main purpose of the statistical analysis in this study is to investigate the current visiting conditions and prepare management plans for future expansion to accommodate the expected number of visitors within specific locations at Al-Masjid an-Nawabi.

Literature review
Crowd behavior in an average density is completely different from that during emergency and evacuation.Crowd behavior mostly depends on the extent of its flow, speed and density.The speed of the crowd or the time needed by them to reach their destinations are of utmost importance in the crowd dynamic and management studies.During emergency, most people

Crowd dynamics in
Al-Masjid Al-Nabawi lose their logical understanding and patience and become anxious and panicky, consequently leading to stampede and loss of lives and properties.Speed and density are the two critical parameters that must be calculated to prevent overcrowding which could cause an emergency (Lam and Cheung, 2000).Several studies were conducted to inspect crowd dynamics and statistics, with some dealing with the Al-Hajj periods as well as visiting Al-Masjid an-Nabawi in Al-Madīnah al-Munawarah.Alshehri et al. (2015) conducted a study using a simulation tool (Massmotion) to predict the maximum crowd density at Al-Masjid an-Nabawi in the area between the tomb and the exit gate with two protocols for agent simulation.The study concluded that crowd management should be done in batch wise with an appropriate selection of the batch size and timing between batches.
Kırlangıço glu (2015) used modeling techniques based on the average pedestrian velocity to study the crowd dynamics and proposed a solution of having a Metro line to reduce the effects of crowd seasons on the visitors, citizens and the city.In this study, virtual experiments are performed to observe the continuity and density of pedestrian flow at different levels of the Haram (restricted area in Makkah), East Metro Station of the first metro line of Al-Madīnah al-Munawarah, Saudi Arabia.According to the predictions, more than 40,000 passengers are expected to use this station in 1 h after a Friday prayer during the Ramadan period in 2040.Haron et al. (2012) used a specialized crowd evacuation simulation tool, EXODUS, to investigate the best approach to evacuate the crowd when the number of visitors in the mosque has reached maximum, along with analysis for which future considerations could be used.Koshak and Fouda (2008) used Global Positioning Systems (GPS) and Geographic Information Systems (GIS) to analyze pedestrian movement while performing Tawaf around Kaaba during the Hajj in 2004.This case had a crowd situation similar to that in Medina as the pilgrims considered visiting the Prophet (PBUH) in medina during the same pilgrimage.
Deviating from the case of Al-Masjid an-Nabawi, several studies (Still, 2000;Fell, 2003;and Kırlangıço glu, 2015) were conducted to study crowd dynamics and many models were developed.
The number of visitors to Al-Masjid an-Nabawi was counted during the Hajj period of 1437H (2016) as more than 300, 000 in one specific day, 22nd Dhul-Hijjah 1437H (corresponding to September 23, 2016), directly after completing Hajj in Makkah (RACI, 2016).
In the view of the importance of Al-Masjid an-Nabawi and the expected increase in the number of visitors, this study aims to gather statistical crowd data of the mosque to have a deep understanding of the current pedestrian situation and identify the need for modifications to ensure pilgrim safety.In literature, no study has implemented collection of comprehensive manual statistical data to calculate the parameters of the crowd dynamics.This methodological study is expected to fill this gap in literature.

Methodology
Visiting Al-Masjid an-Nabawi and greeting Prophet Mohammed's (PBUH) tomb are holy acts that attract most of the visitors who come to Medina from all around the world.Therefore, a statistical analysis tool with duration is required to estimate the flow of visitors in this location and understand their dynamics as well.The visiting area falls in the southern part of Al-Masjid an-Nabawi with a gate from the west (Al-Salam Gate) and to exit from the west (Al-Baqi' Gate).Furthermore, the visiting corridor has an entrance near the IJCS 2,1 Al-Salam Gate along with two entrances from Holy Rawdah area, as shown in Figure 1.The visiting corridor width ranges from 8 to 10 m and is approximately 92 m in length, with aesthetically pleasing Islamic calligraphic columns along the passway.
The crowd flux and dynamics can be detected from the time of visit to Prophet Mohammed's tomb during the Ramadan and Al-Hajj seasons (Koshak and Fouda, 2008).In this study, the time of entry from the Al-Salam Gate to the tomb and from the tomb to the exit from the Al-Baqi' Gate has been noted in the most oversaturated period.To be precise and to model the worst case, important crowd measures of effectiveness data were collected in the two holy seasons as well as the busiest hours of the day for considering the safety factor while proposing future solutions.Table I shows the design of data collection phase of the study, considering the most congested periods in the visiting areas.
Ramadan is the month of fasting for Muslim.Tarawih and Tahajjud prayers are "night prayer," which is recommended (but not compulsory) for all Muslims to perform in the month of Ramadan.Tarawih prayer time starts immediately after Isha payer (the obligatory night prayer), while Tahajjud time starts about 2 h after Tarawih prayer till Fajr prayer (the obligatory morning prayer).Eid al-Fitr day is the day when Muslims break their fasting after observing a month-long dawn to dusk fasting in the month of Ramadan.Muslims worldwide celebrate this day of breaking the fast, marking the end of Ramadan.Eid al-Adha day is called the sacrifice feast day, the second of the two Muslim festivals celebrated Several studies have reported the use of object characterization (number of pixels and shape of the object) to determine crowd density.Few have also reported the use of infrared thermal sequence, pressure sensors and motion sensors to determine crowd density.Forward-facing infrared counter along with CCD cameras are typically used along with developed software module to determine crowd density (Al-Habaibeh et al., 2006).However, the mentioned technologies could not be adopted because of the importance of the restricted study area in terms of security and privacy concerns.Instead, in this study, the conventional manual head counting method has been adopted to determine the crowd density from the recorded videos and photos captured by the legitimate authority and actual counting of flow of visitors.
The time taken for traversing from the entrance of the Al-Salam Gate to the tomb to the exit at the Al-Baqi' Gate was calculated by deploying three observers following three visitors randomly at every 5-min interval in three parallel pathway-capturing scenes while moving in the path.Furthermore, the observers calculated the number of the visitors exiting from the Al-Baqi' Gate.The time elapsed to reach the visiting area, the tomb and the exit was calculated along with diverse captures and scenes of the visiting area from different angles, as shown in Figure 2.

Number of visitors
According to the method described above, data collection was performed to provide an insight of the parameters concerning the crowd and their flow.The results were based on counting the number of visitors between Taraweeh and Tahajjud prayers on the 27th night of Ramadan, which is considered the busiest nights in Ramadan. Figure 3 shows the actual counting of people entering from the Al-Salam Gate and exiting through the Al-Baqi' Gate every minute from 11:00 p.m. to 1:00 a.m. and the counts were summed for 5-min intervals to better detect the flow rate of people exiting the Al-Baqi' Gate within this distinct time scale.
As interpreted from Figure 3, the number of visitors fluctuated with an average number of 380 visitors per 5 min.In the case of studying crowd dynamics, focusing on the minimum number of visitors is not sufficient, as the maximum number is the only required data along with the average values.The maximum number of visitors was 505 visitors per 5 min recorded at 23:10, which is immediately after the Taraweeh prayer.The crowd is much expected at that time as Taraweeh is one of the most spiritual prayers that ensures maximum participation during the month of Ramadan.

Total time spent by visitors
The time data were collected by detecting the motion of the visitors by three observers through three distinctive streamline/paths.The first is the closest to the Prophet's tomb, the second one is in the middle of the aisle and the third is the farthest from the tomb.Figure 4 shows the total time aggregated from the entrance from Al-Salam Gate to the tomb and from the tomb to the exit from Al-Baqi' gate.Table II shows the average and maximum time required to traverse each path.The result shows that the highest average time of the visit was 24.3 min in the path closest to the tomb as the visitors tend to spend more time in that place to say salaam (Islamic salutation) to the Prophet (PBUH).

Number of the visitors waiting
A video-capturing system was deployed to detect the number of visitors waiting in the queue for their turn to visit the tomb and is plotted in Figure 5.The presence of this queue is crucial to manage the number of the visitors who wish to reach the tomb as quickly as they can.

Crowd dynamics in
Al-Masjid Al-Nabawi

Speed of the visitors
Visitors making their way to the tomb from the Al-Salam Gate start going fast before reaching to the visiting area, where they slow down to have the longest time to supplicate and offer salutations to the prophet tomb (PBUH).The speed data were calculated using the time data gathered from the Al-Salam Gate to the tomb by tracking the motion of the visitors by three observers through three paths mentioned earlier.For accuracy purposes, the data collection was conducted 30 times and averaged for a period of 2 h to measure the time a visitor spends in front of the tomb in the three paths to make sure that the gathered data are as accurate as possible.The speed at these three different paths is shown in Figure 6.
Table III shows the statistics of speed data from the Al-Salam Gate to the tomb.
Figure 7 shows the speed of the visitors from the tomb to the Al-Baqi' Gate with time for the three paths.Table IV represents descriptive statistics for the same section.It can be observed that the speed in this area is higher owing to the rapid movement of the people compelled by the police or law enforcing authorities.The data in Tables III and IV are most useful when the crowd study involves running a simulation model.

Density of visitors
As expected, the most crowded location is the tomb area as the visitors spend more time in reverence and devotion near the tomb of the Prophet (PBUH).A video was recorded using a remotely rotating camera focused on the tomb area to study the crowd density.The result of the crowed density is appended in Figure 8.The maximum density shown in Figure 8 is 3.49 person/m 2 , which is considered as a moderate density.Even though the area is excessively crowded, it can be clearly interpreted that the Saudi Government and the Management Authority of Al-Masjid an-Nabawi were able to regulate the crowd without any major difficulty.However, the major concern is whether this facility is sufficient enough to accommodate the ever increasing number of visitors.

Time spent in front of the tomb
The time taken by the visitors to traverse the Prophet tomb has been identified based on several recorded videos taken in the peak periods.The average time the visitors take in front of the Prophet tomb is 40.71 s with standard deviation 10.787.While the minimum time is 24 s, the maximum is 55 s.

Summary of results
The above-mentioned data analysis was augmented by other important data, summarized in Table V.These collected and analyzed data will be used later for simulation of the crowd management software.

Statistical testing
To check the collected data from a statistical point of view, the collected data were subjected to t-test and F-test to better understand and check the authenticity and the reliability of these data.Adha compared and the peak day of Hajj period in Medina have same statistical mean values (First three pairs above).This implies any set of collected data for any specific day can significantly be used representing other data for the other day of these three pairs.On the other hand, the other three pairs, when Ramadan month data were used (27th night), showed that the null hypothesis is rejected implying that their means are statistically different.Similar results were obtained for the speed of visitors from Al-Salam Gate to the tomb.The above analysis will help in selecting the set of collected data to be used in the simulation process for the crowds in Al-Masjid an-Nabawi.

Discussion
According to the methodology that applied actual counting, the number of visitors was counted using recorded videos and snapshots of several scenes to collect data, and these are presented in the form of histograms and tables.The data gave an insight of how the Al-Masjid an-Nabawi deals with the visitors for Islamic obligations during the busiest seasons of Al-Hajj and Ramadan.The data collected were reasonable in terms of visitors' safety.
However, this study should be done regularly on an annual basis, as an assurance for the behavior of the visitors and as a controlling tool in this area of significance.This can capture any sudden changes in the crowd movement behavior and its dynamics.The statistical analysis was based on manually counting visitors from photographs and video records and averaged for better accuracy and precision.Moreover, advanced surveillance technologies might be used in observing the crowd movement in this area.Using sensors to detect the crowd dynamics could be very helpful and accurate in these types of studies; sensors are placed in areas of interest to detect the number of people flowing in a certain direction by detecting, for instance, the foot prints.The method purely depended on statistical analysis by calculating the impacting parameters that demonstrate the crowd dynamics.

Conclusion
The methodology adopted in this study gave a reasonable information of crowd dynamics that can be adopted by any responsible crowd management authority that aims to accommodate a large number of visitors during the busiest seasons without causing any harm to the visitors.Fortunately, the Saudi Government has always been working on modifications of Al-Masjid an-Nabawi crowd management to cope with the increasing annual rate of the visitors coming from various parts of the world during the busiest seasons.Results state that the current density is reasonable and provide a reassured margin of safety that could accommodate even a higher number of visitors; however, this study must be conducted on a regular basis to identify the scope of further modifications and capacity enhancement.The data collected in this study could be used for future research to simulate similar crowd scenes or different crowd management scenarios in case of emergencies such as fire hazards or evacuation process.Furthermore, the Al-Masjid an-Nabawi authority can use the results of this study to better manage the visiting crowd behavior and movement.
Figure 1.Layout of the study area Figure 2. Manual counting of visitors from captured photos Figure 6.Speed of the visitors from Al-Salam Gate to the tomb with time Figure 7. Speed of the visitors from tomb to Al-Baqi' Gate with time