The methodology chapter provides a synopsis of the approach that is taken in this project to obtain the results. The design, strategies, data preparation and analysis techniques, security and safety measures, environmental effects, implementation and other factors. This study uses the Google Maps API to retrieve the routes information for both passengers and riders. Google Maps API is efficient in collection multiple possible routes for the same from and to locations. Data about the user experience, passenger satisfaction and other feedback can be obtained through surveys, interviews and other measures. The approach goes into detail on data analysis, with a focus on clustering for demand-supply matching. It emphasizes algorithms, distance measurements, and data pretreatment techniques. To ensure active user participation, user engagement strategies which include gamification, promotional campaigns, and feedback mechanisms are covered in detail. With an emphasis on responsible data collecting and user privacy, ethical issues are essential. An environmental impact evaluation compares the decrease in carbon emissions and the usage of single-occupancy vehicles with the aims of sustainability and scalability of the system. The approach goes into detail on data analysis, with a focus on clustering for demand-supply matching. It emphasizes algorithms, distance measurements, and data pretreatment techniques. To ensure active user participation, user engagement strategies which include gamification, promotional campaigns, and feedback mechanisms are covered in detail. With an emphasis on responsible data collecting and user privacy, ethical issues are essential. An environmental impact evaluation compares the decrease in carbon emissions and the usage of single-occupancy vehicles with the aims of sustainability and scalability of the system. The processing of the proposed system is shown in Fig. 1.
A. Dataset
The dataset is generated manually as the application is not implemented and is to be used in the ecosystem. The dataset contains Rider and passenger routes in tables. The columns of the tables are shown below in Tables 1 and 2.
TABLE I. Mock Dataset For Prototype
Riders Routes
|
Passengers Routes
|
• Pickup location
• Drop location
• Pickup time
|
• Pickup location
• Drop location
|
TABLE II. Actual Dataset
Riders Routes
|
Passengers Routes
|
· Id
· userId
· startLocation
· endDestination
· steps
· distance
· startTime
· duration
|
· Id
· userId
· startLocation
· endDestination
· steps
|
Each table has several columns that store information related to the routes taken by riders and passengers. Let's break down the structure of these tables:
1) Riders Routes Table:
· Id: A unique identifier for each route in the table.
· userId: Identifies the user or rider associated with the route.
· startLocation: Indicates the starting point or location of the route.
· endDestination: Specifies the final destination or endpoint of the route.
· steps: Likely contains information about the specific steps or directions to follow for the route.
· distance: Records the distance of the route, which could be measured in miles, kilometers, or another unit.
· startTime: Represents the time at which the route starts.
· duration: Indicates the duration of the route, possibly in minutes or hours.
2) Passengers Routes Table:
· Id: A unique identifier for each route in the table.
· userId: Identifies the user or passenger associated with the route.
· startLocation: Indicates the starting point or location of the route.
· endDestination: Specifies the final destination or endpoint of the route.
· steps: Likely contains information about the specific steps or directions for the route.
This dataset structure is essential for storing and organizing the route information of both riders and passengers. To use this dataset effectively, it would populate these tables with 18 actual data, and then this can perform various data analysis and optimization tasks based on this information to achieve the project's objectives. Figure 2 shows the exact dataset of the riders’ route.
Clustering Analysis for Demand-Supply Matching
1) INPUTS:
· Riders' route data (supply)
· Passengers' route data (demand)
· Number of clusters (k)
2) METHODOLOGY
Step 1: Start.
Step 2: Collect and preprocess rider’s and passengers’ route data.
Step 3: Apply Clustering Algorithm:
A. Initialize k centroids randomly.
B. Iterate until convergence or a defined number of iterations:
a. Assign each route to the nearest centroid based on distance metrics.
b. Calculate new centroids as the mean of assigned routes.
Step 4: Analyze Clusters:
A. Calculate cluster characteristics:
a. The average distance of routes within each cluster to its centroid.
b. Total passenger demand within each cluster.
B. Identify clusters with high demand and low rider presence.
C. Identify clusters with mismatches or unmet demand.
Step 5: Suggest Alternate Routes:
A. For clusters with high demand and low rider existence:
a. Analyze the routes within the cluster.
b. Suggest alternate routes that can help the demand while maintaining similar ride period.
B. Generate a list of suggested alternate routes for riders.
Step 6: Output:
A. List of suggested alternate routes for the riders.
Step 7: End
Equations to calculate for clustering algorithms are mentioned below.
Euclidean Distance: The Euclidean distance, which is the distance in Euclidean space between two points, is usually used to determine the distance between cluster centroids and data points. The distance between x and c, the centroid, in a multidimensional space of dimension n:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZUAAAAfCAYAAAAvB1AxAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAmySURBVHhe7Z3Jrw1PG8fbu7dwbcXCZSGRsDAkwkbCNcUWeyH8AcSwNISlxJRYimFnYQgSFsQCERJ2i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of using the data points given to a cluster to determine its new centroid. If a cluster is made up of data points x1, x2, x3, x4, x5, xm, and so on, the new centroid c can be found in this way:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAAgCAYAAABadBAfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdVSURBVHhe7Z3PSxRvHMcfv3eJymsh2aEgCMpKpA51sB/nqEAPQUHYoVOUGZ0iy8hLUG1Rx0ipsIv2CzxYSkWHAgPB9OZNi/oHbF4f5/E7DDPr7Mzu7O7j5wUPs/O4u87u88x7P8/7+TwzDUseRlEURcmN//yt83z8+NFs3bpVtoqiKNXEeeGdm5szp06dMq9fvzazs7N+bf58//5dhH/Pnj1mcXHRHDlyxDQ0NJirV6+u/CiwPzo66r9CURRXcV54161bZ+7du2du3Ljh11SHT58+mZcvX5qvX7+aa9eumfv375v+/n4zNDQkPwqfP382ra2tZmpqyn+Foiiu4rzwbty4UUoWHj58KNFoqSVoa5w7d87Mz8+b9evXm4sXL5otW7ZIPZEuPwr2GHfs2CFbRVHcZc14vFk4fvy4RKPQ3d1tmI+MKyMjIyKuUUxMTJiOjo4V0R0bGzOnT5+Wx1giRMPHjh2TfUVR3EWFNwFEo48fPxZBffDgQVEfFuHERoji3bt35uDBg/IYn/ft27dm+/btsv/+/Xtz+PBh8YKJsBVFcZc1I7wIGvz9+1e2pbJz505z8+ZNedzV1SXCGQeTeWF4PhFtW1ub7OPpIuS8L2zatEmE+PLlyxJhK4orMJo7f/68FMvg4KCcJxs2bBBbDsvt9u3b/l+Xz1cmonmek3jDY+fhY4ZLWk6ePCmv96JTv0ZRlDiePXu25AUYSyMjI37N0lJ/f7+cQ729vUsLCwtS7HnF3yyzs7NSz7nGc1xiTQhvOaEDtLS0SCcpFAp+raIoYT58+CDnybdv3/yaZRDX1tZWf28ZRDYuoKEOAXYJXbmWArIVDhw4II+9TrViFyiK8j/YB55gJk7lxHJgnuPNmzd+zTJ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axsEebVMFUVZDa5N7UWpkqeb5l6C9El7njx9+lS2zrAc+FYOhtwMz/McJjCUZwhtZ02xBvioHIsdqrOfdKafY+f5pRb+VxRZrYKsr7fEtQ1DRJeGdUp14TzAciglswYbjv7paj900sijsWhsBASRwmu1E0l0ACvG/C0JiFNYVJOUODiuLBNX5RLeKPhuOPY0/rOiKMmouNVQDRiecHdhT0TMhQsXVpbKegIqydo2hWX37t2yXY1fv36JJ1tqiYI0O47L3vIHkloNeXDnzh3x0/RSl4pSOZwUXrC31rE3j5ycnBRBtnm35LUePXpUHueJnbgK5v8Wu0ZF2FPG9yI/8s+fP35NeSCXF6Hnh8GLpv1aRVEqgbPCa+/oa3n+/PlKFMcsq406876kIxNXSZZPR0H029TUJMfORYkQynItTGFUYIVeo11FqSzOCm/4jr7BG002NjZKNLxv3z5z4sQJqcsLjiutsEVFxnrFMUWpP/TWPznCMl5yEmdmZmp2qbGiKJVHhTcnsAVYfEFSufWdFUVZm6jwKoqi5Iox/wBI0M7iVlkVXwAAAABJRU5ErkJggg==)
In this case, ci represents the i-th component of the centroid, and xij represents the i-th component of the j-th data point.
Cluster Assignment: Calculating the distance between a given data point and the cluster to which it fits. The cluster with the closest centroid is found using data point x:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYIAAAAbCAYAAABx5Ii2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAqsSURBVHhe7Z05ixVLFMd73gdwGY0MRNREDAQRAzFRcEFBEBVFzRRFzUQUFzBQREUMhHEBQ0FFQZNxC0wUQVFQEAxcPoELfoJ591ev/zNnarrv7eXOnX5zzw+K7q6qruWcU+dUT/fVgZEWieM4jtO3/JMeHcdxnD7FA4HjOE6f05NA8OPHj+Ty5cvJ4sWLk9evX6e5zebTp0/JrVu30qvOnD59OsyzX/j161cyODgY9No0sLGBgYH/ja0VBZljk1NhZ/Q73eT5f+DJkychFUF+FjspS+1AcO/evWTjx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nutUz5n5RPaJn+OPB0pI3e+NuPTYPxQWfvwQOA4jtPnNP6fmHAcx3EmFw8EjuM4fY4HAsdxnD7HA4HjOE6f44HAcRynz/FA4DiO09ckyb9g9nAV8KxTrAAAAABJRU5ErkJggg==)
Convergence Criteria: When the centroids no longer vary noticeably across iterations, the algorithm is said to have converged. An often-used criterion for convergence is to see if the centroids have changed more than a certain amount.
To determine the need by enumerating unique passenger routes a collection of unique passenger routes is represented mathematically by the formula below. The cardinality of the set (R), or the total number of unique elements in the set, may be used to compute the number of different passenger routes, D:
![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASEAAAAZCAYAAAB+Q5hvAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAQQSURBVHhe7d2/LzthHAfwp99/wK/RIljEIJFKDAwWhFXixySRkIoYSAgGA4lUwmAQEuYaiERCMDDUhKEGI5OYiPAP3Pfenzyn1/aqX71er9/e+5Vcnnvu2jjS59Pn87mnFTJMygdnZ2fq6+tLDQ0N6SNEFES+BSEiIvijWyIiXzAIEZGvGISIyFcMQkTkKwYhIvJVYIJQb2+v3suP2+cTlaqHhwe1u7ure7ktLS2p5+dn3XPP0yC0vr6uQqFQ1g0Du9C/UC4/XVNbW5ucf39/148mKm8HBwfq4uJCTUxM6COpMBaqq6tlXFhmZmbU4uKiBK+CwDohL729vRnhcBhrkYx4PK6PGkYikTCi0ahRVVUl52KxmD7jjZ6eHr3nfE1PT09GJBKRY/bHWpyOEf3P8NrP9boeHByUMYGxaocx1NDQIOPGLc/TsZqaGtXd3a17SS0tLWpubk5dX18rMxCp4eFhdXNzo896y+ma6uvr1fb2tjL/sPLOUKxrIfLL6Oiomp6e1r1MSNEwC3KCMTQ+Pq4mJyf1kfwVpSZUUVGh9zIhGK2trcn+6uqqtMWQ7ZoaGxulfXx8lJaoHCENM2cxqq+vTx9JhVQL28jIiD6SyZxFyRu227SsJArTAwMD0uIXcqoP5aotWZs9b80H8t/b21vZb29vl5aoHG1sbEgQyQYTg5WVFd1zhgkE/Kao7aQkghCmdpbX11e9l4S0zUwdc254XL7wgVoUyj8+PlQkEvn+AxOVo/v7e1VZWal7qXCzaGpqKmVcZoPyxd3dne7lpySCkJ86OztlFtXf3y/909NTqQ0RlSur3tna2iqtHd6MUaro6OjQR36G8gUCmhslEYTst8Sbmpr0XpKX6Vg8HleJREKK48iRa2tr9RmiYME43NracpVR5KMkgtDh4aG0yFGdpoBep2NIvU5OTiQV6+rqKtz6B6L/yP7+vtRl7W/syBRgfn5e+l4oShD6/PzUe5kw4BcWFmQ/Go1KWwzp14TpZywW+w5ExVxASVRMVqp1dXUlrQU3iJAZ2LednR05hzop+ukwe0JdyA3PgxAu8vLyUveSMMiRPmHAA2oxxSoG26/p5eVFWsC3PGIlKAJROByW25j2VJGoXCDrSH9tY60cApR9a25ulnN1dXXfwcsO9SCndYC/YqYxnsEqS/yIbBtWa5qRVlZfeg0/C7Jdk521ctp+zno+UTnAJxTSX/dOzNmPPC59xTTgUw84h8e4EZivd8Xt9/Pzc937PbfPJyo1uLOFQnS2BYu5YH3Q8fGx63ER+Fv0REF1dHSklpeXde93kMrt7e0VZDkLgxBRQKEGOzs7m9fnvzY3NyUIoY7kFoMQUYDhZgy+xgM3Yf4V0rCxsbGC3Ujiv/whIh8p9RfmnAy6o4WbWAAAAABJRU5ErkJggg==)
The demand is represented by D and the cardinality of the set of different passenger routes that is, the number of unique routes is represented by |R|
The proposed project entails gathering and preparing data as well as initializing the cluster centroids. This would be repeated until convergence or a certain number of iterations were reached. The centroid is computed for each route in rider and passenger data by computing distance metrics. Following that, the routes are assigned to the appropriate cluster. For each cluster, new centroids are calculated as the mean of routes inside the cluster. Each cluster's overall passenger demand is also computed. Clusters with a high and low presence of riders are detected. Along the way, the routes are added to a list. Figure 3 depicts this work.