Abstract
Excess commuting, which concerns the differences between the actual commute and the optimal (minimum) commute afforded by a given distribution of jobs and housing, i.e., urban form, has been extensively studied across disciplines. In the existing excess commuting framework, the optimal commute considers commuting efficiency but overlooks commuting equity, which is defined as the variation in commuting cost across workers before and after the optimisation. The framework also overlooks the variation in commuting frequency across workers for a period of interest, which also affects the overall commuting cost for the period. In this paper, we propose a novel excess commuting framework using a Greedy-Initialisation-based Genetic Algorithm, where the optimal commute accounts for commuting efficiency and equity and commuting-frequency variation simultaneously. We illustrate and calibrate the framework using one-month metro smart card data in Shanghai. Comparing with two other existing models, the Greedy-Initialisation-based Genetic Algorithm can generate a commuting pattern that balances commuting efficiency and commuting equity, which the existing commuting framework and corresponding algorithms cannot.
Introduction
Commuting, the recurrent trip between one’s residence and workplace, accounts for a significant share of daily trips among workers. For a given set of job and housing locations, referred to as a fixed urban form, there are numerous possible commuting patterns. For non-optimal commuting patterns where some commuting is ‘wasteful’ or ‘excessive’, many commuters may live unnecessarily far away from their workplaces even though there are housing opportunities nearer to their respective workplaces (Hamilton and Röell, 1982; White, 1988). This wasteful or excess commuting has contributed to some of the most salient urban problems of our times: traffic congestion, air pollution and even social inequality. Therefore, the framework or study of excess commuting remains an important issue for those concerned with the environmental sustainability and social equity implications of commuting (Niedzielski et al., 2013).
The excess commuting framework has been in existence for over three decades, which can be used to quantitatively examine issues ranging from the jobs/housing balance to commuting pattern optimisation or evolution (Hamilton and Röell, 1982; Horner, 2002; Yang and Ferreira Jr, 2008; Zhou et al., 2018b). Excess commuting measures the difference between the actual commute and the optimal (minimum) commute for a fixed/known spatial distribution of jobs and housing in a city or a region, i.e., a fixed urban form (Zhou and Long, 2016). To quantify excess commuting, the key is to calculate the optimal commute, i.e., to capture the potential of a city or a region in reducing its overall commuting costs for its existing urban form, assuming that jobs and workplaces are exchangeable among homogenous workers (Hu and Wang, 2015).
There are, however, two major issues in the existing excess framework or studies encapsulated above. First, the optimal commute is usually derived by minimising the system-wide daily overall commuting cost of workers. Such a cost can be measured by commuting distance or time, which reflects the spatial arrangement of the homes and workplaces of workers (i.e., the spatial domain). The framework overlooks the differences in commuting frequency over time (i.e., the temporal domain). Due to various benefits or concerns, there are many flexible work schedules besides the traditional five-day work arrangement (Zhang and Cheng, 2019). In countries like the United States, the United Kingdom, Australia and Canada, for instance, many employees work four 10-hour days (called ‘compressed workweeks’) in exchange for a week day off every fortnight and even to work part-time (e.g., two work days each week) continuously (Arbon et al., 2012). This results in different commuting trips or frequencies across weeks/months among workers. This has significant impacts on how we should define or quantify the optimal commute, which should account for (at least) variations in commuting trips across weeks.
Second, the optimal commute focuses on minimising the overall commuting cost but overlooks commuting equity, which concerns the gains or losses in commuting cost across different commuters before and after the commuting-pattern optimisation. If overlooking commuting equity, we may find an efficient but unequal commuting pattern after the optimisation, where many commuters suffer from extremely high losses in commuting cost. To avoid this undesirable outcome, it is important for us to simultaneously consider efficiency and equity when optimising commuting patterns.
In this paper, we propose a novel excess commuting framework to address the above two issues. Specifically, we propose a Greedy-Initialisation-based Genetic Algorithm (GI-GA) to compute the optimal commute that considers efficiency and equity simultaneously. The algorithm is also able to minimise the overall commuting cost that accounts for variations in both commuting frequency and in the daily commuting distance. To illustrate, we have conducted an empirical study of Shanghai, China using one month of local smart card data (SCD).
Literature review
In existing studies, excess commuting is one of the most frequently used concepts by scholars to quantify commuting efficiency. It was first introduced by Hamilton and Röell (1982), defined as the differences between the actual commute Tact and optimal commute Tmin. Hamilton and Röell (1982) calculated the Tmin using a monocentric model, which was based on the assumption that workers chose their residences to maximise utility by trading off commuting and housing costs. White (1988) relaxed the assumption of monocentricity and employed the ‘Transportation Problem’ algorithm, first proposed by Hitchcock (1941), to find the theoretical minimum commute Tmin. In this approach, the commuters’ jobs and houses by predefined zone were exchanged in a way that minimised the system-wide travel cost (distance or time) given that the total numbers of commuters and jobs in each zone remained the same.
Built on the foundational work done by White (1988), many scholars have attempted to advance the excess commuting framework. Horner (2002) introduced the maximum commute Tmax. He also termed the range between the Tmin and Tmax as the commute potential or carrying capacity. Charron (2007) suggested a ‘commuting possibilities’ framework to calculate the upper bound: Trand. About the same time, Yang and Ferreira Jr (2008) provided an alternative method to calculate the maximum commute, called proportionally matched commuting, which proves to be the same as Trand. Murphy and Killen (2011) found new utilities of Trand by proposing the normalised commuting economy to measure the commuting potential utilised. Jun et al. (2018) and Ha et al. (2018) investigated the relationship between urban form (or spatial structure) and excess commuting in a comparative fashion. Both of them basically adopted the existing excess commuting framework to quantify contributors to excess commuting at the zonal and regional levels. Yang and Zhang (2019) proposed a revised excess commuting framework, where commuting costs between jobs and workplaces can vary due to different transport policies (or policy sets) and workers can choose one out of several modes of travel. Different modes of travel provide workers with different commuting times between jobs and workplaces. Thus, their framework can be used to calculate the minimum commute across different transport policies, which advances the similar but simpler research by Zhou et al. (2018b). Zhou et al. (2018b) only dealt with excess commuting changes for bus commuters, where different transport policies are introduced. They also treated commuting costs between jobs and workplaces as variables under different policy scenarios. Unlike Zhou et al. (2018a), however, both Yang and Zhang (2019) and Zhou et al. (2018b) did not account for traffic congestion when calculating commuting costs for different policy scenarios.
Among all the above-mentioned studies, the dominant approach to deriving the optimal commute is the Transportation Problem of Linear Programming (TPLP), which was first introduced by White (1988) into the study of excess commuting. Later, it was adopted by many other researchers (Horner, 2002; Hu and Wang, 2015; Taaffe, 1973; Zhou and Long, 2016). In the TPLP, all commuters are considered as homogeneous and can be enticed to any jobs and/or residences without losing any utilities (Zhou and Long, 2016). Such a homogeneity assumption, of course, can be challenged and some scholars have done so. O'Kelly and Lee (2005) and Zhou et al. (2018c), for instance, disaggregated the commuters by job types when calculating various excess-commuting metrics mentioned above. Horner and Schleith (2012) considered the incomes of commuters to highlight the differences in people’s accessibility to jobs. Schleith et al. (2016) examined the job-housing balance of different categories of workers across 26 metropolitan regions in the United States. However, in all of the above-mentioned studies, the optimal commute based on the TPLP is to minimise the daily overall commuting cost given an urban form. To the best of our knowledge, no authors have considered the commuting frequency of different workers. The weekly commuting frequency implies ‘when’ commuting takes place during a week, which could vary considerably among workers. Hence, a worker’s weekly commuting cost depends on the commuting cost per trip/weekday as well as the commuting frequency. If we overlooked this, we would introduce biases and even errors in different excess-commuting metrics.
In the existing excess-commuting studies, commuting equity has also been overlooked. In this study, we define commuting equity as the variation in the commuting cost across all workers. One commuting pattern with such a variation is considered to be more equitable than the other. An ‘optimised’ commuting pattern simply based on the TPLP could significantly compromise commuting equity. In this regard, Zhou and Long (2016) proposed a concept of ‘losers’, those who suffer from longer commuting distances after the commuting patterns of all workers are optimised. However, what they were interested in was to examine the severity of the loss, the loss spatial patterns and influencing factors. They did not specifically consider commuting equity.
In light of the above, we contend that when optimising commute in the excess commuting framework, one needs to account for (a) the mean of, and variation in the commuting cost of all workers across weekdays and (b) the differences in workers’ commuting frequency within a week simultaneously. We formulate this optimisation problem as a dual response problem (DRP) as described in Costa (2010). DRP is a special case of the multi-objective optimisation problem. Compared to the TPLP, DRP is a non-linear programming problem. In most cases, the two objectives, the minimum mean and the minimum variation, are conflicting. Therefore, we need to find a ‘sweet spot’ between the two objectives, i.e., an acceptable solution that tolerates certain trade-offs between the two objectives. To solve DPR problems, evolutionary algorithms are often adopted, in particular, Genetic Algorithms (GAs; Konak et al., 2006). In this research, we also adopt a GA to find the acceptable solution.
Methodology
Problem reconceptualisation
In the existing studies, commuting pattern optimisation is usually formulated as a TPLP, where cities or regions are divided into zones and jobs and workplaces are considered as homogeneous and are aggregated at the zonal level (Charron, 2007; O'Kelly and Lee, 2005). However, the TPLP only minimises the total commuting cost of all commuters and overlooks the variation in commuting frequency across workers over time and the equity issues in commuting pattern optimisation. In this study, we aim to simultaneously optimise the mean (efficiency) and variation (equity) of commuting cost in commuting pattern optimisation.
These ideas are expressed in Figure 1. First, commuting frequency has been overlooked in the existing excess commuting framework. The overall commuting cost across a period of interest, e.g., a week, however, depends not only on the daily commuting distance over space but also the commuting frequency for the period. As shown in Figure 1(a), suppose there are two commuters

Optimal commuting pattern considering (a) commuting frequency and (b) commuting equity.
Greedy-Initialisation-based Genetic Algorithm
In this paper, optimising commuting patterns relies on the assumption that commuters can freely swap their workplaces and the commuting costs are the only utility that is considered, which have been widely adopted in the existing relevant literature (Ma and Banister, 2006; Zhou and Long, 2016). In this study, we assume that commuters can freely change their workplaces but live at fixed home locations. As mentioned above, we aim to decrease both the mean and variation of commuting cost simultaneously. To solve this problem, a GI-GA is proposed. The scope of application of the algorithm is not limited to this specific problem. It can, for instance, be used to find the optimal commute where there are workers of different occupations.
Figure 2 is the typical work flow of the GA. In operations research, a GA is an evolutionary algorithm inspired by the principle of ‘survival of the fittest’. A GA starts with a population of random chromosomes. Each individual among the population represents a point in a search space and a candidate solution (Step 1). Then the fitness of individuals can be evaluated according to an objective function (Step 2). Those individuals with higher fitness scores in ‘competition’ will have a higher possibility of being selected to produce offspring than those performing poorly (Step 3). Mutation occurs randomly with certain possibilities (Step 4). During the above processes, the successive generation will become more suited to the objective function. However, in different circumstances, the data structure of solutions and initialisation, objective function, crossover, and mutation operation should be customised for specific problems. In the following subsections, we will describe the customised processes and steps.

An overview of the process of a GA. GA: Genetic Algorithm.
For a given city, suppose there are N residential zones and M working zones, and the total population of commuters is P. The number of home locations and workplaces in each residential and working zone is
The origin-destination (OD) commuting cost matrix is denoted as
In a GA, the structure of a solution is a matrix
Similarly, the commuting frequency matrix for the N residential zones is denoted as
Greedy initialisation
In the existing studies, an initial solution to the TPLP is a two-dimensional matrix
Objective function and fitness evaluation
In our proposed excess-commuting framework, the objective is to simultaneously optimise the mean (efficiency) and variation (equity) of the daily commuting cost across workers. Such a problem is commonly referred to the DRP (Costa, 2010). To solve the DRP, a popular approach is to aggregate the mean and variation into a single function (Messac et al., 2000). Thus, we propose the following objective function for the GA
The value of the objective function is called the ‘fitness’. When considering different commuting frequencies, the objective can be calculated as follows. For the i-th residential zone, we expand the i-th row in the commuting frequency matrix C as an extended commuting frequency vector
After sorting, the total weekly commuting cost of commuters in the i-th residential zone is easy to calculate as
Crossover
Crossover is to make the candidate solutions vary from one generation to the next. In each generation, parent solutions are randomly selected by using the Roulette wheel selection method. Therefore, parent solutions with higher fitness can have a higher possibility of producing offspring than those that perform poorly. Assume that two potential solutions
The matrix DIV records the average value of the two parents and the matrix REM can track each value in
Mutation
The mutation is used to maintain genetic diversity from one generation to the next. Its operation on a Randomly select p rows and q columns from V and construct a Similarly, extract the corresponding Use the Greedy Initialisation method to reassign new values to the submatrix. Here, the three inputs should be
Performance metrics
Here we propose several performance metrics to quantitatively evaluate the model performance from the perspective of efficiency and equity, ignoring/considering distinct commuting frequency across workers, respectively.
Ignoring commuting frequency
1. • • • • 2. • • • • •
where
Considering different commuting frequencies
In this circumstance, if a commuter commutes t distances/minutes for f times per week, the average daily commuting cost is defined as tf/5 (a five-day work mode by default). Then, the second group of metrics is proposed to evaluate the performance of models considering commuters’ distinct commuting frequencies.
• • •
• • •
Case study
Study area and data
Shanghai, with a 24.26 million population, is one of the most populous cities in the world. In the case study, we focus on the metro commuters as metro is the most common public transit mode for daily commuting in Shanghai, and we only had access to the local SCD for metro trips. The Shanghai Metro System had 13 lines and 288 stations during the period of our data coverage.
SCD, collected by automatic fare collection systems, can provide detailed onboard/outboard transactions of massive transit riders and has been widely used for travel behaviour studies (Zhang et al., 2018). The SCD used here covers a one-month period in April 2015, provided by the Shanghai Open Data Apps (SODA) contest (see http://soda.datashanghai.gov.cn). The data set contains over 0.24 billion records made by about 11 million passengers. Trip records are extracted from the original data set via referring to Wang et al. (2017). After pre-processing, about 122.6 million trip records of 10.5 million passengers can be identified. Each trip record contains the anonymous user ID, start/end stations, start/end time, and trip cost.
Metro commuters in Shanghai
Commuters are detected using the method proposed by Long and Thill (2015). About 1.82 million commuters are identified from the local SCD. In our analysis, we use the commuting time as the proxy for commuting cost. The commuter flow between metro stations, the average commuting time and the commuting frequency of individuals can all be derived from the SCD.
Job-housing mismatch
Figure 3(a) shows the spatial distribution of job-housing ratio and Figure 3(b) displays the number of home locations versus the number of workplaces near each metro station. Together, they allow us to visualise the job-housing spatial mismatch and imbalance in Shanghai.

(a) Job-housing ratio distribution and (b) the scatter plot of metro commuters living/working near each station.
Commuting times and frequencies
The average and median commuting time of detected metro commuters is 34.60 and 32.18 minutes, respectively. A day is regarded as a commuting day if one or more commuting trips are detected from the SCD to eliminate interference of the before-work or after-work activities. For example, if parents need to send their children to school before going to work, the home-to-work trip cannot be found. After that, the maximum weekly commuting days during the study period are treated as a commuter’s weekly commuting frequency. This is because commuters may occasionally change their commuting mode (e.g., taxi) or sometimes the before- and after-work activities happen on the same day. Finally, commuters with different weekly commuting frequency is as follows: 0.18% (once), 4.67% (twice), 12.39% (three times), 23.33% (four times), 44.54% (five times), 11.40% (six times), 3.49% (seven times), respectively. Notably, the five-day work week is the most common work mode, accounting for about 45% of all commuters. However, other work modes and corresponding commuting patterns cannot be overlooked.
Optimisation results and comparisons
Parameter settings for the GI-GA
For the GI-GA model, we set 20 as the size of the initial population, in which each gene is a 288 × 288 matrix. We set the crossover rate and mutation rate to 0.9 and 0.8, respectively, the size of the submatrix in the mutation step was 50 × 50, and the maximum iteration was 1000 times. As mentioned previously, the parameter settings of the objective function have impacts on the trade-off between the mean and variation of the commuting time. Thus, we fix

The change in the mean and variation of the commuting time during optimisation by the GI-GA with different parameter settings: (a) EFF; (b) EQF; and (c) EES.
Comparisons of the model results
Here, we compare the optimised commuting pattern generated by our proposed model (GI-GA-MVF) with (a) those of three other models (TPLP, GI-GA-V and GI-GA-MV) and with (b) the existing commuting pattern (‘status quo’) in Shanghai. The description of each model is given below:
Model results ignoring commuting frequencies
Table 1 compares the model results by using the first group of metrics. Since the TPLP can generate the optimal solution only when the mean commuting time is considered, the TPLP performs the best for most of the efficiency metrics (NPCT, Avg). The excess commuting decreases from 63.73% to around 13% by using the three GI-GA models. However, after the optimisation, numerous commuters can work near home, even without using the metro since their workplace and home are located around the same metro station. On the other hand, the TPLP performs the worst in terms of Avg_PCT, which indicates that the TPLP produces more ‘survival’ commuters who need to travel longer as compared to the three GI-GA models.
Model results without considering commuting frequencies.
The last five rows of Table 1 compare the model results about commuting equity, which is measured by the variation in commuting time across workers before and after the optimisation. The variation can be reduced from 292.24 to about 200 when the TPLP or GI-GA-MVF were executed, and to around 175 when GI-GA-V or GI-GA-MV were executed. Interestingly, the Gini coefficient increases after the optimisation. The most exciting result is about ‘losers’ among the workers, where the loss is defined as the increased commuting time of a worker between the model result and the status quo. From Table 1, we can see the number of losers after the optimisation based on GI-GA-MVF is just about 3000 out of the 1.82 million commuters, far fewer than other models.
To further compare the results, Figure 5 visualises 1166 commuters living near Wuzhou Avenue Station in Shanghai before and after the TPLP and GI-GA-MVF optimisation. After re-allocating commuters’ workplaces by the TPLP, 359 commuters who currently work near those stations within the yellow circle in Figure 5(b) become the losers. Meanwhile, no losers were found after the GI-GA-MVF optimisation. In addition, AICTL and MICTL are used to examine the severity of the loss among all losers.

1166 commuters living near Wuzhou Avenue Station (a) before optimisation; (b) after TPLP optimisation (359 losers); and (c) after GI-GA-MVF optimisation (no losers).
Figure 6 compares the loss/loser distribution based on the TPLP and GI-GA-MVF models. AICTLs of the TPLP and GI-GA-MVF models are smaller than those of the other models. The GI-GA-MVF model performs the best for MICTL. This indicates even if there are still losers after the optimisation, the model could effectively limit the aggregated loss of the losers.

The histogram of loss of all the losers based on the TPLP and GI-GA-MVF models.
Model results considering commuting frequencies
Table 2 presents model results where commuting frequencies are considered. Compared to the TPLP result, the average commuting time produced by the GI-GA-MVF is slightly longer, but AvgF_PCT of the GI-GA-MVF is considerably better than that of the TPLP. As for the equity metrics, the GI-GA-MVF notably outperforms TPLP. It also outperforms the two GI-GA models for all the excess-commuting metrics we obtained. In summary, the proposed GI-GA framework can be used to derive excess-commuting metircs where both commuting frequency and commuting equity are considered. Table 2 results also show that the excess-commuting metrics for a day and for a week differ significantly when commuting frequency is accounted for. Thus, commuting frequency shall not be overlooked in the excess commuting framework.
Model results considering commuting frequency.
Figure 7 provides visual comparisons of the city-wide commuting patterns: the status quo, the optimised ones based on the TPLP and GI-GA-MVF. Compared with the status quo, the other two significantly reduce the randomness of commuting trips and place more commuting trips along fewer corridors. Comparing the TPLP and GI-GA-MVF patterns (Figure 7(b) and (c)) indicates that commuters who live extremely far away from the central area are more likely to be ‘losers’ after optimisation (e.g. areas within red-dashed circles). But the latter would allow more commuters to work near their homes (e.g., fewer commuters traveling along corridors in the southwest and in the north). This confirms that GI-GA can be used to improve commuting equity.

City-wide commuting patterns: (a) status quo, (b) TPLP, and (c) GI-GA-MVF. Note: Line width and bubble size are proportional to commuter flow volumes and the number of commuters living near each metro station, respectively.
Discussion and conclusions
Commuting accounts for a significant share of daily trips. Commuting pattern optimisation in cities remains an important public-policy concern. In this paper, we propose a novel excess commuting framework, in which a GI-GA approach is utilised to determine the optimal commute by minimising the mean and variation of the commuting costs simultaneously and accounts for both daily commuting costs and the varied commuting frequency across workers. The optimal commute based on the algorithm balances the efficiency and equity aspects of commuting, supplementing the existing excess commuting framework, which focuses on efficiency only and rarely considers the commuting frequency of a week (or a longer period). Our empirical study of Shanghai shows that the algorithm can effectively improve the equity when optimising commuting patterns.
However, there is still room for improvements in the future. First, in this study, commuters are assumed to be homogeneous in terms of their socioeconomic attributes and preferences. In the future, more complicated situations/scenarios should be examined/compared. We can, for instance, consider commuters with multiple jobs, different occupations, levels of income or travel modes (e.g. bus, bike and walking). One possible way to achieve such goals is to utilise traditional survey data to obtain more socioeconomic and preference information about workers. Thus, the workers’ characteristics and their variations can be reflected not only at the zonal level but also at the individual level (Hu and Wang, 2017). We can also take access to future job opportunities into account, i.e., the number of workplaces and the locations are no longer fixed as in the existing excess commuting framework. Moreover, to make the framework more relevant to situations in the real-world, we should find ways to factor worker’s residential choices with respect to both current and future job accessibility into the framework. In addition, commuting costs (time or distance) are the only utility we consider in this excess commuting framework. However, strictly speaking, the utility of commuting is not linear with commuting time and it cannot be combined by simple addition. Future work should include more elements to measure the utility of commuting. Finally, we can conduct enhanced comparative metrics, which can allow for analyses across different cities to identify global and local determinants or contributors for commuting efficiency and/or commuting equity (Ha et al., 2018; Jun et al., 2018).
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work is supported by the China Scholarship Council (Grant No. 201603170309 and 201508060122) and the Hui Oi Chow Trust Fund (Grant No. 201801172001 to JZ).
