| Input: EV location data set . |
| Output: the location and number of charging stations and the number of charging piles in the charging station under the optimal cost . |
| 1: According to the location and quantity of EVs in the planned area, estimate the range of the number of charging stations in the planned area |
| 2: Set the initial value of the number of charging stations |
| 3: while |
| 4: Randomly select group data from as the initial position data set of the charging station, |
| 5: repeat |
| 6: Let |
| 7: fordo |
| 8: Calculate the Euclidean distance from EV , to each charging station , |
| 9: According to the principle of closest distance, determine which charging station each EV belongs to: |
| 10: Assign EVs to the corresponding charging stations: |
| 11: end for |
| 12: fordo |
| 13: Calculate the location of the new charging station: |
| 14: ifthen |
| 15: Update the current charging station location to |
| 16: else |
| 17: Keep the current mean vector unchanged |
| 18: end if |
| 19: end for |
| 20: until the current charging station location is no longer updated |
| 21: Current output: division of service scope of charging stations |
| 22: Use queuing theory [M/M/S] to calculate the number of charging piles in the charging station |
| 23: Calculate the total cost of deploying charging stations , 。 |
| 24 end while |
| 25: Calculate the total cost of deploying different numbers of charging stations and get the total cost data set , |