-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMCDA-EVSE.Rmd
More file actions
1996 lines (1514 loc) · 94.6 KB
/
Copy pathMCDA-EVSE.Rmd
File metadata and controls
1996 lines (1514 loc) · 94.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Advancing Sustainable Mobility: A GIS-Based Multi-Criteria Decision Analysis for Equitable Electric Vehicle Supply Equipment Deployment in Philadelphia"
author: "Emily Zhou, Junyi Yang"
date: "`r Sys.Date()`"
output:
html_document:
theme: simplex
toc: yes
toc_float: yes
code_folding: hide
code_download: yes
editor_options:
markdown:
wrap: sentence
---
Version 5.0 \| First Created Nov 17, 2023 \| Updated Mar 9, 2025
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Abstract
The transition from traditional fossil fuel vehicles to electric vehicles (EVs) stands out as a pivotal solution to decarbonize the transportation systems and combat the climate crisis. However, the widespread adoption of EVs faces challenges, with one significant obstacle being the expansion of electric vehicle supply equipment (EVSE). The City of Philadelphia’s Office of Innovation Technology (OIT) is actively engaged in developing a network of extensive, equitable, and accessible EVSEs as part of its Smart City initiatives. Despite these efforts, the initiative faces a common challenge related to the selection of suitable sites.
We share a geographic information system (GIS)-based multi-criteria decision analysis (MCDA) method that can be used to evaluate the suitability of potential EVSE sites to support the sustainable and equitable deployment of EVSE in Philadelphia. Our MCDA approach considers key criteria ranging from socio-demographic indicators (e.g. driving-age population) to site-specific characteristics (e.g. spatial accessibility of existing EVSEs, availability of public parking garages, and city-wide power grid) and is based on the Analytic Hierarchy Process (AHP). To identify the optimal sites, three MCDA methods – WSM (weighted sum method), PROMETHEE (Method for Organizing Ranking of Preferences for Enrichment), as well as TOPSIS (Technique for Order Preference by Similarity to Ideal Solutions) – are applied and compared.
We implemented our study with open-source R markdown and acquired data from the American Community Survey (ACS), OpenStreetMap, and the US Department of Energy. Specifically, a five-step solution approach is developed for the problem: 1) creating a fishnet for Philadelphia as the spatial unit for analysis and removing any water features, 2) determining and preprocessing criteria, among which we calculated the spatial accessibility of EVSEs using 2SFCA and distance to parking lots using k-nearest neighbor, 3) aggregating criteria into the fishnet, 4) prioritizing the criteria using AHP and finally 5) ranking the potential sites using WSM, PROMETHEE, and TOPSIS.
The results of our MCDAs highlighted several areas in Philadelphia with a pronounced demand for new EVSE. We selected one of those sites in South Philadelphia and proposed a public-private partnership model between Philadelphia’s OIT and local grocery stores to install and maintain the EVSEs. We subsequently conducted financial analyses for the cost and revenue of breakdowns and designed a phased implementation of EVSE infrastructure given the current site conditions. Our study highlighted the challenges of agreeing on the input criteria and weighting schemes in MCDA but provided a spatially informed starting point to identify sites for new EVSE that contribute to Philadelphia’s sustainable transportation goals while addressing social disparities. It also provides a scalable and replicable model for other cities facing similar challenges in deploying EVSE and advancing smart city initiatives. More importantly, it emphasized the potential of geospatial analysis in shaping a more climate-smart and equitable future.
The study is conducted collaboratively by graduate students from the Weitzman School of Design and Wharton Business School at the University of Pennsylvania and is available as a reproducible repository on [GitHub](https://github.com/emilyzhou112/CAGIS-UCGIS-2024).
## Keywords
Multi-Criteria Decision Analysis, Analytic Hierarchy Process, Electric Vehicle Supply Equipment, Sustainable Transportation, Smart City, GIS
# Setup
```{r packages and processing environment, message=FALSE, warning=FALSE}
# list of packages required
packages = c("tidycensus", "tidyverse", "viridis", "FNN", "dplyr", "sf", "classInt", "readr", "ggplot2", "here", "tmap", "SpatialAcc", "svDialogs", "MCDA", "nngeo", "leaflet", "gghalves", "NbClust", "kableExtra", "factoextra", "irlba", "devtools", "cluster", "NbClust")
# load and install required packages
package.check <- lapply(
packages,
FUN = function(x) {
if (!require(x, character.only = TRUE)) {
install.packages(x, dependencies = TRUE, quietly=TRUE)
library(x, character.only = TRUE)
}
}
)
# load functions
source(here("code", "KNN.R"))
# save the R processing environment
writeLines(
capture.output(sessionInfo()),
here("environment", paste0("r-environment-", Sys.Date(), ".txt"))
)
```
# Study Area
```{r process study area, warning=FALSE, message=FALSE}
philly <- st_read(here("data", "raw", "city_boundary.geojson")) %>% st_transform('ESRI:102728')
water <- st_read(here("data", "raw", "water_features.geojson")) %>% st_transform('ESRI:102728')
# generate fishnet for Philadelphia
fishnet <- st_make_grid(philly,
cellsize = 1640, # 500 meters
square = TRUE) %>%
.[philly] %>%
st_sf() %>%
mutate(uniqueID = 1:n())
# remove grids in water with 330 ft buffer
fishnet_nowater <- fishnet %>%
filter(!(uniqueID %in% (water %>%
st_buffer(dist = 330) %>%
st_intersection(st_centroid(fishnet), .) %>%
st_drop_geometry() %>%
dplyr::select(uniqueID) %>%
pull(uniqueID))))
```
```{r map study grids}
ggplot() +
geom_sf(data=fishnet, color="black", fill="#726DA8") +
geom_sf(data=fishnet_nowater, color="black", fill="white") +
labs(title = "Fishnet of Philly") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_rect(colour = "grey", fill=NA, linewidth=0.8)
)
```
```{r save the intermediaries}
st_write(fishnet, here("data", "derived", "philly_fishnet.geojson"), driver = "GeoJSON")
st_write(fishnet_nowater, here("data", "derived", "fishnet_nowater.geojson"), driver = "GeoJSON")
```
# Criteria Processing
## Demographic Information and EV Ownership
```{r load demographic info, message=FALSE, warning=FALSE}
options(timeout=1000)
# get API Key
census_api_key(dlgInput("Enter a Census API Key",
Sys.getenv("CENSUS_API_KEY"))$res,
overwrite = TRUE)
acs_vars <- load_variables(year = 2022, dataset = "acs5", cache = TRUE)
# query 2022 acs data
philly22 <- get_acs(geography = "tract",
variables = c(
"B01001_001E", # total population
"B01001_010E", # male 22-24
"B01001_011E",
"B01001_012E",
"B01001_013E",
"B01001_014E",
"B01001_015E",
"B01001_016E",
"B01001_017E",
"B01001_018E",
"B01001_019E", # male 62-64
"B01001_034E",
"B01001_035E",
"B01001_036E",
"B01001_037E",
"B01001_038E",
"B01001_039E",
"B01001_040E",
"B01001_041E",
"B01001_042E",
"B01001_043E" #female 62-64
),
year=2022, state="PA", county="Philadelphia",
geometry=TRUE, output="wide") %>%
st_transform('ESRI:102728')
philly22 <- philly22 %>%
mutate(popden = B01001_001E / (st_area(geometry) * 9.2903e-8),
density = as.integer(gsub("\\[.*\\]", "", popden)),
pop22_64 = B01001_010E + B01001_011E + B01001_012E + B01001_013E + B01001_014E +
B01001_015E + B01001_016E + B01001_017E + B01001_018E + B01001_019E +
B01001_034E + B01001_035E + B01001_036E + B01001_037E + B01001_038E +
B01001_039E + B01001_040E + B01001_041E + B01001_042E + B01001_043E,
driving_pop = pop22_64 / B01001_001E,
totalpop = B01001_001E) %>%
dplyr::select(GEOID, totalpop, density, driving_pop) %>%
mutate(driving_pop = ifelse(is.nan(driving_pop), 0, driving_pop))
```
```{r save the queried acs information}
st_write(philly20, here("data", "derived", "acs2020.geojson"), driver = "GeoJSON")
```
```{r load registered ev, message=FALSE, warning=FALSE}
reg_ev <- st_read(here("data", "raw", "reg_ev.geojson"))
Zip_Code <- as.character(c(
19120, 19124, 19111, 19143, 19149, 19134, 19140, 19148, 19104, 19144,
19145, 19131, 19139, 19146, 19147, 19115, 19136, 19128, 19135, 19121,
19154, 19141, 19132, 19152, 19114, 19116, 19151, 19138, 19142, 19119,
19130, 19125, 19133, 19103, 19150, 19122, 19126, 19123, 19107, 19106,
19153, 19129, 19118, 19137, 19127, 19102, 19108, 19109, 19176, 19112,
19160, 19155, 19162, 19161, 19171, 19170, 19173, 19172, 19175, 19178,
19177, 19181, 19179, 19183, 19182, 19185, 19184, 19188, 19187, 19192,
19191, 19194, 19193, 19196, 19195, 19244, 19197, 19255, 19019, 19093,
19092, 19101, 19099, 19105, 19110, 19190
))
reg_ev <- reg_ev %>%
filter(zip %in% Zip_Code) %>%
dplyr::select(elec_cnt) %>%
st_transform('ESRI:102728')
```
## Existing EVSE Distribution and Access
```{r load existing evse, message=FALSE, warning=FALSE}
evse <- read.csv(here::here("data", "raw", "existing_evse.csv"))
evse <- evse %>%
filter(City == "Philadelphia") %>%
dplyr::select(Latitude, Longitude, EV.Level2.EVSE.Num) %>%
filter(is.na(Latitude) == FALSE & is.na(Longitude) == FALSE) %>%
st_as_sf(., coords = c("Longitude", "Latitude"), crs = 4326) %>%
st_transform('ESRI:102728') %>%
mutate(num = ifelse(is.na(EV.Level2.EVSE.Num), 1, EV.Level2.EVSE.Num))
```
```{r compute spatial accessibility, message=FALSE, warning=FALSE}
tracts.coords <- st_coordinates(st_centroid(philly22))
evse.coords <- st_coordinates(evse)
dist.matrix <- distance(tracts.coords, evse.coords, type = "euclidean")
TSFCA <- ac(p = philly22$totalpop,
n = evse$num,
D = dist.matrix, d0 = 2000, family = "2SFCA")
philly22 <- philly22 %>%
mutate(TSFCA = TSFCA)
```
## Local Environment
```{r load site environmental metrics, message=FALSE, warning=FALSE}
parking <- st_read(here("data", "raw", "osm_features", "parking.geojson"))
parking <- parking %>%
filter(!access %in% c("no", "permissive", "permit", "private")) %>%
st_transform('ESRI:102728')
police_fire <- st_read(here("data", "raw", "osm_features", "police_fire.geojson"))
police_fire <- police_fire %>%
st_transform('ESRI:102728') %>%
st_centroid()
zoning <- st_read(here("data", "raw", "zoning", "zoning.shp"))
zoning <- zoning %>%
st_transform('ESRI:102728') %>%
mutate(zoning = case_when( ZONINGGROU == "Commercial/Commercial Mixed-Use" ~ "Commercial",
ZONINGGROU == "Industrial/Industrial Mixed-Use" ~ "Industrial",
ZONINGGROU == "Residential/Residential Mixed-Use" ~ "Residential",
ZONINGGROU == "Special Purpose" ~ "Special",
TRUE ~ "Undefined")) %>%
mutate(zone_score = case_when( zoning == "Commercial" ~ 0.4,
zoning == "Industrial" ~ 0.15,
zoning == "Residential" ~ 0.3,
TRUE ~ 0.15))
```
## Energy
```{r load property electricity data, message=FALSE, warning=FALSE}
electricity <- read.csv(here("data", "raw", "property-electricity-data.csv")) %>%
dplyr::select(Y = y_coord, X = x_coord, portfolio_bldg_id, postal_code, primary_property_type, sector, electricity_2021) %>%
na.omit() %>%
st_as_sf(coords = c("X", "Y"), crs = 4326, agr = "constant") %>%
st_transform('ESRI:102728') %>%
st_intersection(., fishnet) # clip to fishnet extent
```
# Aggregate Criteria
```{r aggregate all criteria into fishnet, message=FALSE, warning=FALSE}
net_centroid <- st_centroid(fishnet_nowater)
fishnet_nowater <- fishnet_nowater %>%
left_join(net_centroid %>%
mutate(evse.nn = nn_function(st_coordinates(net_centroid),
st_coordinates(evse), 2)*0.3048) %>% # distance to evse
st_drop_geometry(), by = "uniqueID") %>%
left_join(net_centroid %>%
st_intersection(philly22) %>%
st_drop_geometry(), by = "uniqueID") %>% # demographic info and spatial acc
left_join(net_centroid %>%
st_intersection(reg_ev) %>%
st_drop_geometry(), by = "uniqueID") %>%
left_join(net_centroid %>%
mutate(parking.nn = nn_function(st_coordinates(net_centroid),
st_coordinates(parking), 2)*0.3048) %>% # dist to parking
st_drop_geometry(), by = "uniqueID") %>%
left_join(net_centroid %>%
mutate(policefire.nn = nn_function(st_coordinates(net_centroid),
st_coordinates(police_fire), 1)*0.3048) %>% # police and fire
st_drop_geometry(),by = "uniqueID") %>%
left_join(net_centroid %>%
st_buffer(dist = 200) %>%
st_intersection(zoning) %>%
st_drop_geometry(), by = "uniqueID") %>%
mutate(TSFCA = ifelse(is.infinite(TSFCA), 0, TSFCA)) %>%
mutate(elec_cnt = ifelse(is.na(elec_cnt), 0, elec_cnt)) %>%
filter(is.na(GEOID) == FALSE) %>%
filter(is.na(zone_score) == FALSE) %>%
dplyr::select(-c(GEOID, totalpop, featCount, ZONINGGROU, zoning)) %>%
group_by(uniqueID) %>% # for duplicate grids, take the mean of the zone score
mutate(zone_score = mean(zone_score)) %>%
ungroup() %>%
distinct(uniqueID, .keep_all = TRUE)
```
```{r aggregate power grid, message=FALSE, warning=FALSE}
# buffer the building and aggregate building centroid into the buffer
# if outside the buffer, get the nearest neighbor
elec_grid <- st_join(net_centroid,
electricity %>% st_buffer(dist = 1640)) %>%
group_by(uniqueID.x) %>%
summarize(elect_use = mean(electricity_2021))
unjoin <- elec_grid %>%
filter(is.na(elect_use)) %>%
mutate(neighbor_index = 1:n())
nn_indices <- st_nn(unjoin,
electricity, k = 1)
nearest_neighbors <- electricity[unlist(nn_indices), ] %>% mutate(neighbor_index = 1:n())
unjoin <- unjoin %>%
st_drop_geometry() %>%
left_join(nearest_neighbors %>% select(electricity_2021, neighbor_index),
by = c("neighbor_index" = "neighbor_index"))
elec_grid <- elec_grid %>%
left_join(., unjoin %>%
dplyr::select(uniqueID.x, electricity_2021), by = c("uniqueID.x" = "uniqueID.x")) %>%
mutate(elect_use = case_when(
is.na(elect_use) ~ electricity_2021,
TRUE ~ elect_use
)) %>%
dplyr::select(-electricity_2021) %>%
st_drop_geometry()
fishnet_nowater <- fishnet_nowater %>%
left_join(., elec_grid, by = c("uniqueID" = "uniqueID.x"))
```
```{r save all aggregated criteria}
st_write(fishnet_nowater, here("data", "derived", "all_criteria_raw.geojson"), driver = "GeoJSON")
```
# Multi-Criteria Decision Analysis
In it's simplest term, MCDA can be summarized into three steps.
1. Transform indicator data into standard **geographic unit**. This include: aggregate or dissolve for nested relationship, area-weighted re-aggregation for un-nested relationship, count points within polygons, etc.
2. Transform indicator data into standard **measuring unit**. This include: rank or percentile, z-score, some other functions.
3. Combine indicator data into a composite score with certain weights.
## Self-Assigned Weight + WSM
The Weighted Sum Method is one of the simplest and most commonly used MCDA techniques. In WSM, each criterion is assigned a weight based on its importance, and each alternative is scored based on these criteria. The final score for each alternative is calculated by summing the products of the scores and their respective weights.
1. Scale all the criteria from 0 to 1.
2. Invert the scale for certain criteria if necessary.
3. Assign a weight to each criterion reflecting its relative importance. The sum of weights should equal 1.
4. For each alternative, multiply the performance score of each criterion by its weight and sum the results.
5. Rank the alternatives based on their total weighted scores.
```{r weighted sum}
scale_values <- function(x){(x-min(x))/(max(x)-min(x))}
WSM <- fishnet_nowater %>%
mutate(scl_density = scale_values(density),
scl_acc = scale_values(TSFCA),
scl_drivingpop = scale_values(driving_pop),
scl_evse = scale_values(evse.nn),
scl_elec = scale_values(elec_cnt),
scl_parking = scale_values(parking.nn),
scl_policefire = scale_values(policefire.nn),
scl_elect_use = scale_values(elect_use)
) %>% # now inverse some scales
mutate(scl_evse_re = 0 - scl_evse + 1,
scl_acc_re = 0 - scl_acc + 1,
scl_parking_re = 0 - scl_parking + 1,
scl_policefire_re = 0 - scl_policefire + 1) %>%
mutate(score = 0.12*scl_density + 0.18*scl_evse_re + 0.15*scl_elec + 0.1*scl_drivingpop + 0.1*scl_parking_re + 0.05*scl_policefire_re + 0.05*zone_score + 0.12*scl_acc_re +0.13*scl_elect_use) # self assign weight
```
```{r visualize weighted sum}
custom_palette <- c("#C4C4C4", "#B2BF95", "#80A676", "#88BFBF", "#7EA1BF")
quantiles <- classIntervals(WSM$score, n = 5, style = "quantile")
WSM$quantile <- cut(WSM$score, breaks = quantiles$brks, include.lowest = TRUE)
WSM_plot <- ggplot()+
geom_sf(data=fishnet, color=NA, fill="white") +
geom_sf(data=WSM, color = NA, aes(fill=quantile)) +
scale_fill_manual(values = custom_palette) +
labs(title = "Weighted Sum Method Score", fill = "Bins") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_rect(colour = "grey", fill=NA, size=0.8)
)
```
```{r save a version}
st_write(WSM, here("data", "derived", "WSM.geojson"), driver = "GeoJSON")
```
## Self Assigned Weight + TOPSIS
TOPSIS is a method that identifies solutions from a finite set of alternatives based on their geometric distance from an ideal solution. The ideal solution has the best performance values for all criteria, and the negative-ideal solution has the worst. This approach is employed widely for four main reasons: 1) the logic is rational and understandable, 2) the computation process is straightforward, 3) the concept permits the pursuit of the best alternatives for each criterion depicted in a simple mathematical form, 4) the importance weights are incorporated into the comparison procedure.
1. Construct the decision matrix where each element represents the performance score of each alternatives.
2. Normalization
3. Determine the ideal and negative ideal solution. In other words, the best and worst possible value for each criterion.
4. Calculate the separation measure as in euclidean distance calculation.
5. Measure relative closeness: how close each alternative is to the ideal solution relative to its distance from the negative-ideal solution.
6. Ranking
```{r construct performance table}
performanceTable <- fishnet_nowater %>%
dplyr::select(-c(uniqueID)) %>%
st_drop_geometry() %>%
mutate(density = scale_values(density),
TSFCA = scale_values(TSFCA),
driving_pop = scale_values(driving_pop),
evse.nn = scale_values(evse.nn),
elec_cnt = scale_values(elec_cnt),
parking.nn = scale_values(parking.nn),
policefire.nn = scale_values(policefire.nn),
elect_use = scale_values(elect_use)
)
uniqueIDs <- fishnet_nowater$uniqueID
rownames(performanceTable) <- uniqueIDs
```
```{r topsis operations}
# reverse is min
weights <- c(0.18, 0.12, 0.1, 0.12, 0.15, 0.1, 0.05, 0.05, 0.13)
criteriaMinMax <- c("min", "max", "max", "min", "max", "min", "min", "max", "max")
# positiveIdealSolutions <- c(0.17, 0.60, 0.70, 0, 0.50, 0.10, 0.14, 0.3,0.007)
overall1 <- TOPSIS(performanceTable, weights, criteriaMinMax)
TOPSIS <- data.frame(uniqueID = names(overall1), values = overall1) %>%
mutate(uniqueID = as.integer(uniqueID))
TOPSIS_toplot <- fishnet_nowater %>%
left_join(TOPSIS, by = "uniqueID")
```
```{r visualize topsis result}
quantiles <- classIntervals(TOPSIS_toplot$values, n = 5, style = "quantile")
TOPSIS_toplot$quantile <- cut(TOPSIS_toplot$values, breaks = quantiles$brks, include.lowest = TRUE)
TOPSIS_plot <- ggplot()+
geom_sf(data=fishnet, color=NA, fill="white") +
geom_sf(data=TOPSIS_toplot, color=NA, aes(fill=quantile))+
scale_fill_manual(values = custom_palette) +
labs(title = "TOPSIS Score", fill = "Bins") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_rect(colour = "grey", fill=NA, size=0.8)
)
```
However, the TOPSIS method presents certain drawbacks. One of the problems attributable to TOPSIS is that it can cause the phenomenon known as rank reversal. In this phenomenon the alternatives’ order of preference changes when an alternative is added to or removed from the decision problem. In some cases this may lead to what is called total rank reversal, where the order of preferences is totally inverted, that is to say, that the alternative considered the best, with the inclusion or removal of an alternative from the process, then becomes the worst.
```{r save a version}
st_write(TOPSIS_toplot, here("data", "derived", "TOPSIS.geojson"), driver = "GeoJSON")
```
## Self Assigned Weights + PROMETHEE
PROMETHEE is a ranking method based on pairwise comparisons of alternatives according to each criterion, considering both preference and indifference thresholds. Preference threshold refers to the minimum difference between the performance of two alternatives on a given criterion such that the decision-maker has a strict preference for one alternative over the other. **If the performance difference is greater than or equal to p, the decision-maker clearly prefers one alternative over the other for that criterion.** The indifference threshold q represents the maximum difference between the performance of two alternatives on a given criterion such that the decision-maker is indifferent between them. **If the performance difference is less than or equal to q, the decision-maker considers the two alternatives to be effectively equal with respect to that criterion.** A preference function, which define how much better one site is over another for each criterion (a linear function where the lower the accessibility, the better), is then applied based on the two thresholds.
1. Calculate the difference in performance scores for each criterion between all pairs of alternatives.
2. Set up an indifference threshold.
3. Set up a preference threshold.
4. Decide a preference function
5. Apply the preference function using the indifference and preference threshold to convert the differences into preference value, which is typically betweeen 0 and 1.
6. For each alternative, sum the preference values across all criteria to obtain the aggregated preference indices.
7. Calculate the positive and negative outranking flows for each alternative, which represent how much an alternative outranks others and is outranked by others, respectively.
8. Use the net outranking flow (positive flow minus negative flow) to rank the alternatives.
Now, this indifference and preference thresholds are based solely on quantitative analysis on the distribution of the data. We computed the IQR for all criteria and use that as the preference threshold. We divide the IQR by three and use that as the indifference threshold.
```{r determine indifference and preference threshold}
IQR(performanceTable$evse.nn) / 3
IQR(performanceTable$density) / 3
IQR(performanceTable$driving_pop) /3
IQR(performanceTable$TSFCA) / 3
IQR(performanceTable$elec_cnt) / 3
IQR(performanceTable$parking.nn) / 3
IQR(performanceTable$policefire.nn) / 3
IQR(performanceTable$zone_score) / 3
IQR(performanceTable$elect_use) / 3
```
```{r promethee operations}
criteriaWeights <- c(0.18, 0.12, 0.1, 0.12, 0.15, 0.1, 0.05, 0.05, 0.13)
names(criteriaWeights)<-colnames(performanceTable)
criteriaMinMax <- c("min", "max", "max", "min", "max", "min", "min", "max", "max")
names(criteriaMinMax)<-colnames(performanceTable)
preferenceFunction<-c("Usual","U-shape","V-shape","Level","V-shape-Indiff","Gaussian", "Level","V-shape-Indiff", "Level")
# The gaussParameter vector in the code specifies the standard deviation (s) for the Gaussian preference
# function for each criterion.
gaussParameter<-c(0.25,1,2,0,0,0,0,0,0)
names(gaussParameter)<-colnames(performanceTable)
#Preference threshold
preferenceThreshold<-c(0.31, 0.21, 0.12, 0, 0.17, 0.19, 0.23, 0.075, 0.005367344)
names(preferenceThreshold)<-colnames(performanceTable)
#Indifference threshold
indifferenceThreshold<-c(0.1, 0.07, 0.041, 0, 0.058, 0.065, 0.078, 0.025, 0.001789115)
names(indifferenceThreshold)<-colnames(performanceTable)
performanceTable <- as.matrix(performanceTable)
promethee <- PROMETHEEOutrankingFlows(performanceTable, preferenceFunction,preferenceThreshold,
indifferenceThreshold,gaussParameter,criteriaWeights,criteriaMinMax)
```
```{r clean up promethee table}
promethee_df <- data.frame(uniqueID = names(promethee$outrankingFlowsPos),
Pos = unname(promethee$outrankingFlowsPos),
Neg = unname(promethee$outrankingFlowsNeg)) %>%
mutate(uniqueID = as.integer(uniqueID)) %>%
mutate(net = Pos-Neg) %>%
dplyr::select(uniqueID, net)
PROMETHEE_toplot <- fishnet_nowater %>%
left_join(promethee_df, by = "uniqueID")
```
```{r visualize promethee}
quantiles <- classIntervals(PROMETHEE_toplot$net, n = 5, style = "quantile")
PROMETHEE_toplot$quantile <- cut(PROMETHEE_toplot$net, breaks = quantiles$brks, include.lowest = TRUE)
PROMETHEE_plot <- ggplot()+
geom_sf(data=fishnet, color=NA, fill="white") +
geom_sf(data=PROMETHEE_toplot, color=NA, aes(fill=quantile)) +
scale_fill_manual(values = custom_palette) +
labs(title = "PROMETHEE Score", fill = "Bins") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_rect(colour = "grey", fill=NA, size=0.8)
)
```
```{r save a version}
st_write(PROMETHEE_toplot, here("data", "derived", "PROMETHEE.geojson"), driver = "GeoJSON")
```
## AHP + TOPSIS
To determine weights using the Analytic Hierarchy Process (AHP), start by defining the decision problem and structuring it into a hierarchy, including the goal at the top, followed by criteria and sub-criteria (if any), and the alternatives at the bottom. Construct pairwise comparison matrices for the criteria by comparing each pair and assigning relative importance values on a scale from 1 to 9. Normalize the matrices by dividing each element by the sum of its column, then calculate the priority vector (weights) by averaging the normalized values across each row.
```{r set up pairwise matrix}
crit <- c("density","evse","ev", "drivingpop", "parking", "policefire", "zoning", "acc", "electricity")
criteriaWeightsPairwiseComparisons <- matrix(c(1.0, 3.0, 2.0, 1/2, 1/2, 1/4, 1/3, 1.5, 1.2,
1/3, 1.0, 1/1.2, 1/4, 1/4, 1/8, 1/6, 1/2, 1/1.5,
1/2, 1.2, 1.0, 1/3, 1/3, 1/6, 1/6, 1/2, 1/1.5,
2, 4, 3, 1.0, 1/1.2, 1/4, 1/5, 1.5, 1.8,
2, 4, 3, 1.2, 1.0, 1/4, 1/4, 2, 1.5,
4, 8, 6, 4, 4, 1, 1.2, 3, 2,
3, 6, 6, 5, 4, 1/1.2, 1, 3, 2,
1/1,5, 2, 2, 1/1.5, 1/2, 1/3, 1/3, 1, 1.5,
1/1.2, 1.5, 1.5, 1/1.8, 1/1.5, 1/2, 1/2, 1/1.5, 1
),
nrow=length(crit),
ncol=length(crit),
dimnames=list(crit,crit))
```
```{r compute weights based on the matrix}
column_sums <- colSums(criteriaWeightsPairwiseComparisons)
# Divide each element by the sum of its column
normalized_matrix <- sweep(criteriaWeightsPairwiseComparisons, 2, column_sums, FUN = "/")
weights <- rowMeans(normalized_matrix)
# Output the weights
print(weights)
```
```{r apply topsis operations}
# reverse is min
weights <- c(0.249, 0.114, 0.105, 0.098, 0.1909, 0.074, 0.033, 0.033, 0.102)
criteriaMinMax <- c("min", "max", "max", "min", "max", "min", "min", "max", "max")
overall2 <- TOPSIS(performanceTable, weights, criteriaMinMax)
AHP_TOPSIS <- data.frame(uniqueID = names(overall2), values = overall2) %>%
mutate(uniqueID = as.integer(uniqueID))
AHP_TOPSIS_toplot <- fishnet_nowater %>%
left_join(AHP_TOPSIS, by = "uniqueID")
```
```{r visualize ahp results}
quantiles <- classIntervals(AHP_TOPSIS_toplot$values, n = 5, style = "quantile")
AHP_TOPSIS_toplot$quantile <- cut(AHP_TOPSIS_toplot$values, breaks = quantiles$brks, include.lowest = TRUE)
AHP_TOPSIS_plot <- ggplot()+
geom_sf(data=fishnet, color=NA, fill="white") +
geom_sf(data=AHP_TOPSIS_toplot, color=NA, aes(fill=quantile)) +
scale_fill_manual(values = custom_palette) +
labs(title = "AHP Score", fill = "Bins") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_rect(colour = "grey", fill=NA, size=0.8)
)
```
```{r save a version}
st_write(AHP_TOPSIS_toplot, here("data", "derived", "AHP.geojson"), driver = "GeoJSON")
```
# Analyses
## Mapping Spatial Consistency
```{r fig.height=12, fig.width=12}
library(ggpubr)
ggarrange(WSM_plot, TOPSIS_plot, PROMETHEE_plot, AHP_TOPSIS_plot, ncol = 2, nrow = 2)
```
## Measure Rank Alignment
```{r combine all ranks together}
TOPSIS <- TOPSIS %>%
mutate(topsis_rank = min_rank(desc(values)))
WSM <- WSM %>%
dplyr::select(c(uniqueID, score)) %>%
mutate(wsm_rank = min_rank(desc(score)))
PROMETHEE <- promethee_df %>%
mutate(promethee_rank = min_rank(desc(net)))
AHP_TOPSIS <- AHP_TOPSIS %>%
mutate(ahptopsis_rank = min_rank(desc(values)))
rank_compare <- WSM %>%
dplyr::select(c(uniqueID, wsm_rank)) %>%
left_join(., TOPSIS %>% dplyr::select(uniqueID, topsis_rank), by = "uniqueID") %>%
left_join(., PROMETHEE %>% dplyr::select(uniqueID, promethee_rank), by = "uniqueID") %>%
left_join(., AHP_TOPSIS %>% dplyr::select(uniqueID, ahptopsis_rank), by = "uniqueID") %>%
mutate(avg_rank = as.integer((wsm_rank + topsis_rank + promethee_rank + ahptopsis_rank) / 4))
```
```{r spearman rank correlation}
options(scipen=999)
# Define a function to compute correlation and p-value
compute_spearman <- function(x, y) {
cor_test <- cor.test(x, y, method = "spearman")
return(c(correlation = cor_test$estimate, p_value = cor_test$p.value))
}
# Compute correlations and p-values for all comparisons
global_cor_results <- data.frame(
Comparison = c("AHP vs TOPSIS", "AHP vs WSM", "AHP vs PROMETHEE",
"TOPSIS vs WSM", "TOPSIS vs PROMETHEE", "WSM vs PROMETHEE"),
Correlation = c(
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$topsis_rank)[1],
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$wsm_rank)[1],
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$promethee_rank)[1],
compute_spearman(rank_compare$topsis_rank, rank_compare$wsm_rank)[1],
compute_spearman(rank_compare$topsis_rank, rank_compare$promethee_rank)[1],
compute_spearman(rank_compare$wsm_rank, rank_compare$promethee_rank)[1]
),
P_Value = c(
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$topsis_rank)[2],
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$wsm_rank)[2],
compute_spearman(rank_compare$ahptopsis_rank, rank_compare$promethee_rank)[2],
compute_spearman(rank_compare$topsis_rank, rank_compare$wsm_rank)[2],
compute_spearman(rank_compare$topsis_rank, rank_compare$promethee_rank)[2],
compute_spearman(rank_compare$wsm_rank, rank_compare$promethee_rank)[2]
)
)
cor.test(rank_compare$ahptopsis_rank, rank_compare$topsis_rank, method = "spearman")
```
Comparing across TOPSIS, PROMETHEE, and weighted sum in ranking the alternatives by looking at the distribution of differences in the rank, we found that:
1. The differences in rank between weighted sum and promethee method is the smallest.
2. TOPSIS is leading to rank reversal issues for some parts of Philadelphia. In other word, a few grids that were ranked of lower priority in PROMETHEE and WSM are ranked of much high priority in TOPSIS and vice versa. Closer examination of these grids reveal that they are located in the outskirt of Philadelphia, mainly industrial areas that use a lot of electricty power. TOPSIS assumes that criteria are independent of each other. When a new alternative is introduced or an existing one is removed, the distance to the ideal and negative-ideal solutions can change. The presence of extreme values (very high or very low) can significantly influence the ideal and negative-ideal solutions. MCDA is sensitive to the quality of our data.
3. Assign weights directly has under-ranked several sites than using the AHP.
```{r neighborhood?}
# rank consistency by neighborhood?
neighborhood <- st_read(here("data", "raw", "PhillyPlanning_Neighborhoods", "PhillyPlanning_Neighborhoods.shp")) %>% st_transform('ESRI:102728')
final <- fishnet_nowater %>%
left_join(., rank_compare %>% st_drop_geometry, by = "uniqueID") %>%
left_join(net_centroid %>%
st_intersection(neighborhood %>% dplyr::select(NAME)) %>%
st_drop_geometry(), by = "uniqueID") %>%
mutate(NAME = ifelse(is.na(NAME), "NOT APPLICABLE", NAME))
```
1. Difference between WSM and TOPSIS
2. Difference between WSM and PROMETHEE
3. Difference between WSM and AHP
4. Difference between TOPSIS and PROMETHEE
**5. Difference between TOPSIS and AHP**
6. Difference between PROMETHEE and AHP
```{r}
# if negative, it means that the first one over-rank the second one
# if positive, it means that the first one under-rank the second one
compare<- final %>%
mutate(wsm_topsis = wsm_rank - topsis_rank, # compare the rank between wsm and topsis
wsm_promethee = wsm_rank - promethee_rank, # compare the rank between wsm and promethee
wsm_ahp = wsm_rank - ahptopsis_rank, # compare the rank between wsm and ahp
promethee_topsis = promethee_rank - topsis_rank, # compare the rank between topsis and promethee
topsis_ahp = topsis_rank - ahptopsis_rank, # compare the rank between topsis and ahp
promethee_ahp = promethee_rank - ahptopsis_rank) # compare the rank between promethee and topsis
```
```{r compare difference distribution 2}
custom_palette1 <- c("#B2BF95", "#80A676", "#88BFBF", "#7EA1BF", "grey", "pink")
my_sort <- c("promethee_topsis", "topsis_ahp", "wsm_topsis", "wsm_promethee", "wsm_ahp", "promethee_ahp")
temp <- compare %>%
st_drop_geometry() %>%
dplyr::select(c(uniqueID, promethee_topsis, topsis_ahp, wsm_topsis, wsm_promethee, wsm_ahp, promethee_ahp, NAME)) %>%
pivot_longer(cols = c("promethee_topsis", "topsis_ahp", "wsm_topsis", "wsm_promethee", "wsm_ahp", "promethee_ahp"),
names_to = "variable",
values_to = "value") %>%
ggplot(aes(x = as.numeric(factor(variable, levels = my_sort)))) +
geom_half_violin(aes(x = as.numeric(factor(variable, levels = my_sort)) + 0.1,
y = value, fill = factor(variable, levels = my_sort)),
side = 'r', scale = "width", cex = 0.8, lwd=0.3) +
geom_boxplot(aes(x = as.numeric(factor(variable, levels = my_sort)) + 0.1,
y = value, fill = factor(variable, levels = my_sort)),
outlier.colour = "black", width = 0.1, cex = 0.8, lwd=0.3, outlier.size=0.6) +
geom_jitter(aes(x = as.numeric(factor(variable, levels = my_sort)) - 0.1,
y = value, color = factor(variable, levels = my_sort)),
width = 0.1, size = 0.2, stroke = 0.8) +
scale_fill_manual(values = custom_palette1) +
scale_color_manual(values = custom_palette1) +
labs(title = "Distribution of Differences in Rank Between Different Methods",
x = "Method",
y = "Difference") +
theme_bw()
theme(axis.text.x=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank(),
panel.border = element_blank(),
)
# my_sort <- c("topsis_promethee", "topsis_ahp", "wsm_topsis", "wsm_promethee", "wsm_ahp", "promethee_ahp")
ggsave("/Users/emzhou/Desktop/Paper/svg/violin.svg", temp, width = 10, height = 7)
```
```{r}
# map distribution of the criteria
final %>%
st_drop_geometry() %>%
dplyr::select(c(density, TSFCA, driving_pop, evse.nn, elec_cnt, parking.nn, policefire.nn, elect_use, zone_score)) %>%
pivot_longer(cols = c(density, TSFCA, driving_pop, evse.nn, elec_cnt, parking.nn, policefire.nn, elect_use, zone_score),
names_to = "variable",
values_to = "value") %>%
ggplot(aes(x = value)) +
geom_density(aes(fill = variable), alpha = 0.5) +
facet_wrap(~variable, scales = "free") +
labs(title = "Distribution of Criteria",
x = "Value",
y = "Density")
summary(final$elect_use)
```
```{r }
final_sankey <- final %>%
mutate(topsis_percentile = percent_rank(topsis_rank),
wsm_percentile = percent_rank(wsm_rank),
promethee_percentile = percent_rank(promethee_rank),
ahp_percentile = percent_rank(ahptopsis_rank)) %>%
mutate(
topsis_cat = cut(topsis_percentile, breaks = c(-1, 0.2, 0.4, 0.6, 0.8, 1.1), labels = c("0-20%", "20-40%", "40-60%", "60-80%", "80-100%")),
wsm_cat = cut(wsm_percentile, breaks = c(-1, 0.2, 0.4, 0.6, 0.8, 1.1), labels = c("0-20%", "20-40%", "40-60%", "60-80%", "80-100%")),
promethee_cat = cut(promethee_percentile, breaks = c(-1, 0.2, 0.4, 0.6, 0.8, 1.1), labels = c("0-20%", "20-40%", "40-60%", "60-80%", "80-100%")),
ahp_cat = cut(ahp_percentile, breaks = c(-1, 0.2, 0.4, 0.6, 0.8, 1.1), labels = c("0-20%", "20-40%", "40-60%", "60-80%", "80-100%"))
)
final_sankey %>%
dplyr::count(topsis_cat, wsm_cat, promethee_cat, ahp_cat) %>%
ggplot(., aes(axis1 = topsis_cat, axis2 = ahp_cat, axis3 = promethee_cat, axis4 = wsm_cat, y = n)) +
scale_x_discrete(limits = c("TOPSIS", "AHP", "PROMETHEE", "WSM"),
expand = c(.05, .5)) +
geom_alluvium(aes(fill = topsis_cat), alpha = 0.8) + # Fill based on initial ranking
geom_stratum(color = "grey") +
geom_text(stat = "stratum", aes(label = after_stat(stratum)), size = 3) +
scale_fill_manual(values = custom_palette) +
theme_bw() +
labs(title = "Rank Transitions Between Global and Local TOPSIS Methods",
x = "Ranking Method", y = "Grid Count")
```
```{r}
# percent of identical positions in different decision-making methods
final_sankey %>%
dplyr::select(topsis_cat, wsm_cat, promethee_cat, ahp_cat) %>%
#filter(promethee_cat == wsm_cat) %>%
#filter(ahp_cat == wsm_cat) %>%
# filter(promethee_cat == ahp_cat) %>%
#filter(topsis_cat == ahp_cat) %>%
#filter(topsis_cat == wsm_cat) %>%
#filter(topsis_cat == promethee_cat) %>%
filter(wsm_cat == ahp_cat & ahp_cat == promethee_cat)
```
Pct of identical positions between TOPSIS and WSM: 772 / 1212 = 63.7%
Pct of identical positions between TOPSIS and PROMETHEE: 750 / 1212 = 61.9%
Pct of identical positions between WSM and PROMETHEE: 848 / 1212 = 70.0%
Pct of identical positions between TOPSIS and AHP-Topsis: 805 / 1212 = 66.4%
Pct of identical positions between WSM and AHP-Topsis: 696 / 1212 = 57.4%
Pct of identical positions between PROMETHEE and AHP-Topsis: 654 / 1212 = 54.0%
Pct of identical positions between TOPSIS, AHP-TOPSIS, and WSM: 568 / 1212 = 46.9%
Pct of identical positions between TOPSIS, AHP-TOPSIS, and PROMETHEE: 548 / 121 = 45.2%
Pct of identical positions between WSM, AHP-TOPSIS, and PROMETHEE: 545 / 1212 = 45.0%
Pct of identical positions between all four methods: 472 / 1212 = 38.9%
## Visualize Spatial Rank Variability
```{r fig.height=7, fig.width=10}
custom_palette2 <- c("#e8623f", "white", "#57748d")
compare %>%
dplyr::select(c(uniqueID, promethee_topsis, topsis_ahp, wsm_topsis, wsm_promethee, wsm_ahp, promethee_ahp, NAME)) %>%
pivot_longer(cols = c("promethee_topsis", "wsm_topsis", "wsm_ahp", "promethee_ahp"),
names_to = "variable",
values_to = "value") %>%
# filter(variable == "promethee_topsis" | variable == "wsm_topsis") %>%
ggplot() +
geom_sf(aes(fill = value), color = "grey") +
labs(title = "Ranking Difference between TOPSIS and Other Approaches") +
facet_wrap(~ variable, labeller= labeller(variable = c(
`promethee_topsis` = "PROMETHEE vs. TOPSIS",
`topsis_ahp` = "TOPSIS vs. AHP",
`wsm_topsis` = "WSM vs. TOPSIS",
`wsm_promethee` = "WSM vs. PROMETHEE",
`wsm_ahp` = "WSM vs. AHP",
`promethee_ahp` = "PROMETHEE vs. AHP"))) +
scale_fill_gradientn(colors = custom_palette2,
name = "Rank Difference",
na.value = "grey50") +
theme(axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.ticks =element_blank(),
axis.title.x = element_blank(),
axis.title.y = element_blank(),
plot.subtitle = element_text(size = 9,face = "italic"),
plot.title = element_text(size = 12, face = "bold"),
panel.background = element_blank() )
```
```{r}
st_write(compare, here::here("data", "derived", "compare.geojson"), driver = "GeoJSON")
```
WSM: easy to understand and implement, but assumes that criteria are independent of each other and ranking is highly dependent on the weights
TOPSIS: easy to understand and implement and is more comprehensive than the simple WSM, but it also assumes that criteria are independent of each other, is sensitive to rank reveral issues, and requires additional input froms stakeholders to decide upon the positive and negative ideal scenario.
PROMETHEE: the most robust statistical mode, but requires careful selection of preference functions and preference function, indifference threshold
AHP: breaks complex decisions into manageable part, but pairwise comparison can be subjective and biased and that maintaining consistency in comparison can be challenging.
# Local MCDA Approach
First, we want to state the difference between global and local MCDA. Both of them are crucial to decision-making in various ways. Global MCDA applies the same criteria weights and decision rules uniformly across the entire study area. It assumes that all areas have the same priorities and conditions for EVSE placement. However, it ignores local variations in socio-economic factors, infrastructure, or mobility behavior.
Local MCDA, on the other hand, recognizes that different parts of the city have different needs, which is typical for decision-making in an urban context. It divides the city into meaningful clusters (based on urban form, population, mobility, etc.). Following this, it conducts MCDA within each cluster using localized weights or decision rules.