1 Introduction

The number of foreign travelers has rapidly increased during the last several years. Therefore, the economy in Japan should be considerably affected by their travel dynamics. For marketers in the tourism industry, for example, a global view of their travel patterns is expected to be an informative piece of information.

Human mobility data are distributed by several organizations, and an analysis of mobility patterns has been an important topic in this regard. During the past decade, in particular, datasets based on records of mobile devices (Hossmann et al. 2011; Isaacman et al. 2012; Ganti et al. 2013) and geo-located tags in social networks (Hawelka et al. 2014; Zagheni et al. 2014; Spyratos et al. 2019) have been actively studied. The target scale ranges from an intramural or urban scale to an international scale (e.g., migration). In this paper, we describe a network analysis of travel pathways by foreign travelers in Japan.

1.1 Dataset

The dataset analyzed is a set of travel records of foreign travelers in Japan that is distributed by the Ministry of Land, Infrastructure, and Transport, called the FF-data (Flow of Foreigners-Data) [7]. In this dataset, the traveler pathways, i.e., the locations the travelers visited in chronological order, are recorded based on survey responses of the travelers themselves. FF-data are separated into yearly datasets; currently, datasets from 2014 through 2017 are available. Although these datasets contain various attributes of foreign visitors, we focus on identifying the macroscopic features of the travel pathways. As an interesting characteristic of such travel pathways, because Japan is surrounded by water and because the FF-data contain only the records of foreign travelers, all pathways start and end at airports or seaports.

1.2 Travel data as a network and as a memory network

It is common to characterize travel data as a network (Barbosa et al. 2018). A naive way to characterize travel data as a network is to represent the locations of a departure and destination as nodes and a transition of a traveler between two nodes as a directed edge. The result is typically a multigraph (a graph with multiple edges between a pair of nodes) because numerous travelers travel between the same pairs of locations.

However, such a network representation has a crucial limitation as it can only encode pairwise information among the nodes. Although some travelers visit more than one destination during their visit, the pathways are broken down into independent transitions between each pair of locations and are encoded as edges. For example, although the pathway from Tokyo to Osaka, followed by Osaka to Kyoto, is quite popular, presumably for tourists, the transition from Osaka to Kyoto is recorded independent of the transition from Tokyo to Osaka.

Fig. 1
figure 1

Representative transitions of foreign travelers in identified modules. The details of this figure are described in Sect. 2.3

We instead conducted an analysis using a higher-order network representation called a memory network (Rosvall et al. 2014; Edler et al. 2017; Lambiotte et al. 2019) that incorporates the information of multiple transitions of each traveler. We identify densely connected components (sets of nodes) in a memory network and denote them as modules. A structure that consists of densely connected components is termed an assortative structure, and a method to identify an assortative structure is termed community detection.Footnote 1 Figure 1 shows a brief overview of the classified elements of traveler pathways. Note that the pathways are basically classified into modules of different regions. For example, however, because Tokyo is a hub for many different destinations, transitions containing Tokyo belong to many different modules. This is therefore an overlapping module structure.

Herein, we provide a brief introduction to a memory network; a formal definition of the memory network can be found in  Rosvall et al. (2014) and Edler et al. (2017) and in Appendix A. An mth-order Markov (memory) network consists of state nodes and the directed edges between them. A state node represents the destination as well as its recent \(m-1\) transitions. For example, in a second-order Markov network, when a traveler moves from Osaka to Kyoto, we have a state node that places Kyoto as the destination with the memory of Osaka as the previous location. If the traveler left Tokyo before arriving at Osaka, we also have a state node that has Osaka as the destination with the memory of Tokyo, and these two state nodes are connected by a directed edge. Because many travelers travel along similar pathways, a memory network is typically a multigraph. From the viewpoint of a memory network, a simple network representation is categorized as a first-order Markov network or a memoryless network. The actual locations are referred to as physical nodes in a memory network. The destination of a state node is regarded as a physical node to which a state node belongs. As a community detection algorithm for memory and memoryless networks, we employ the Infomap [12] that optimizes an objective function called the map equation (Rosvall and Bergstrom 2008, 2011) (see Appendix A for a brief introduction of the map equation).

Fig. 2
figure 2

Pathway examples (top) and the corresponding network elements in a second-order Markov network (bottom)

To better understand the community detection on memory networks, let us consider some specific pathways in second-order Markov networks. We denote a state node corresponding to a transition from location i to location j as \(\overrightarrow{ij}\). If a traveler moves from i to j and he/she moves back to i again (i.e., a backtracking pathway) as shown in Fig. 2a (top), we have a directed edge from \(\overrightarrow{ij}\) to \(\overrightarrow{ji}\) (Fig. 2a (bottom)). In contrast, when we have asymmetric pathways, as shown in Fig. 2b (top), the state nodes of opposite directions are not connected (Fig. 2b (bottom)). Note, however, that even when the backtracking pathway is absent and pathways are asymmetric, \(\overrightarrow{ij}\) and \(\overrightarrow{ji}\) can be (indirectly) connected; the pathways and the corresponding network element shown in Fig. 2c is such an example. When the pathways in Fig. 2a, c are popular, \(\overrightarrow{ij}\) and \(\overrightarrow{ji}\) are likely to belong to the same module.

It should be noted that, although representing a dataset using a memoryless network can incur a significant loss of information, it is occasionally sufficient, depending on the dataset and purpose of the analysis. Furthermore, even when a record of multiple transitions is not explicitly encoded in a network, it may be possible to infer similarities among nodes in some sense from such a simple network. For example, when every pair of nodes is connected by a considerably large number of edges within a certain node set, we can trivially conclude that those nodes are similar to each other. Therefore, before moving on to an analysis of a second-order Markov network, we first investigate the basic statistics and a first-order Markov network of the FF-data to determine whether a higher-order network representation is necessary for an extraction of a module structure.

2 Network analysis of travel pathways

2.1 Basic statistics

Let us first look at the basic statistics of the FF-data. In Table 1, we summarized the numbers of destinations (including the airport and seaport first visited), travelers, unique pathways (i.e., itineraries), and unique edges (first and second order, respectively), as well as the median, lower and upper quartiles of the pathway lengths (number of steps of transitions), and weights. The distributions of the pathway lengths and weights are shown in Fig. 3. We define the weight of a pathway as the number of travelers who traveled along exactly the same pathway. (This should not be confused with the weight of a memory network, which is defined as the number of transitions occurring between two state nodes.) It is confirmed that both distributions are heavily tailed and a considerable number of travelers travel to more than two destinations. This observation implies that there is no evident cutoff length and weight of the pathways or a characteristic scale of the length and weight that we should consider. In other words, apparently, multiple pathway lengths significantly contribute on pathway structures. Therefore, the first-order Markov network may be inadequate for a correct understanding of travel pathways because it only takes into account the one-step transitions.

Table 1 Basic statistics of travel pathway in the FF-data for each year. Each triple in the pathway lengths and weights represent the 25% quantile, median, and 75% quantile, respectively
Fig. 3
figure 3

Histograms of a the pathway lengths (normal scale) and b pathway weights (log–log scale) of the FF-data in 2017. In panel b, the frequencies of the pathway weights are counted based on logarithmic binning

2.2 First-order Markov network

Fig. 4
figure 4

Results of community detection on a memoryless network using the Infomap: (Main part) Classification on the map figure (the upper-left part represents Okinawa islands) and (Lower-right part) adjacency matrix of the network sorted according to the module indices. In the map figure, the pin icons indicate the locations of airports and seaports in the dataset

We then consider the community detection of the first-order Markov network. Here, we focus on the dataset of 2017. Figure 4 shows the partitioning of 47 prefectures, 33 airports, and 4 seaports in Japan. The corresponding adjacency matrix is shown at the bottom right; each element is a node pair, and the color depth indicates the weight of an edge. Note that the FF-data includes transitions within a prefecture, indicating self-loops in the first-order Markov network. The order of the node labels is sorted based on the modules identified using the Infomap and each module is specified by a blue box. It is confirmed that the Infomap identifies an assortative module structure on the first-order Markov network. The modules apparently correspond to the geographical regions in Japan: Hokkaido, Tohoku, Chyuetsu, Kanto, Chubu, Kansai, Chugoku, Shikoku, Northern Kyushu, and Southern Kyusyu with Okinawa regions.

Although the present results may sound reasonable, there is an important concern. Notice that all airports and seaports belong to the module of the region where the airport or seaport is located. This observation implies that the present result is simply dominated by the transition from-to airports and seaports. If this is the case, then the result may not reflect any informative travel patterns. This is further confirmed because the result of community detection is considerably varied by removing the airport and seaport nodes. Moreover, we have also confirmed that the module boundaries of the first-order Markov network can be reproduced with high accuracy by a simple label aggregation based on the module labels of the airport nodes. These results are shown in Appendix B. Based on this, we move to an analysis of the second-order Markov networks.

2.3 Second-order Markov network

Fig. 5
figure 5

Adjacency matrix of the second-order Markov network. Each element represents a state node, and the color depth indicates the weight of an edge in the network. The gray elements represent the forbidden edges. The order of node labels is sorted based on the module assignments, and the identified modules are specified by blue boxes

Here, we classify the state nodes of the second-order Markov networks into modules using the Infomap, which can be directly applied to higher-order Markov networks. Figure 5 shows the adjacency matrix of a subgraph in the second-order Markov network corresponding to the dataset in 2017. The state nodes in the subgraph are extracted such that each state node belongs to one of the eight largest modules and has a total edge weight to other state nodes (i.e., degree) larger than 300. The matrix elements are sorted based on the module assignments.

Note that there are forbidden edges in the second-order Markov networks. For example, when an edge is present from state node \(\alpha\) to state node \(\beta\), an edge in the opposite direction is prohibited because such an edge does not constitute a pathway, e.g., for \(\alpha = \mathrm {Tokyo}\rightarrow \mathrm {Osaka}\) and \(\beta = \mathrm {Osaka}\rightarrow \mathrm {Kyoto}\), \(\beta\) to \(\alpha\) is not possible because a traveler cannot be at Kyoto and Tokyo at the same time. Analogously, the edges of both directions are prohibited when neither of them constitutes a pathway. The elements corresponding to the forbidden edges are indicated in gray in Fig. 5.

It is confirmed that the Infomap identifies an assortative structure on top of the constraint of the forbidden edges. Larger-sized modules exhibit assortative structures, even though the edges to different modules are not strictly prohibited. In contrast, the modules of a relatively smaller size are identified owing to a severe constraint of the forbidden edges.

Let us then explore the identified module structure in more detail. Figure 1 shows popular transitions that appear in the four largest modules. The arrows of the same color represent transitions within the same module. The color depth of an arrow distinguishes the prior (lighter color) and destination (deeper color) physical nodes. The thickness of each arrow reflects the weight of a transition measured based on the flow (PageRank) in the outcome of the Infomap.

We show the Sankey diagrams of the four largest modules in Fig. 6. The locations on the left-hand side of each diagram represent the physical nodes visited before arriving at the (physical) destination nodes; we refer to them as prior nodes. Conversely, the locations on the right-hand side of each diagram represent the destination nodes. It is confirmed that, for example, the transition from Kyoto to Tokyo appears in Module 1, while the transition from Tokyo to Kyoto appears in Module 2 (see Fig. 2 and the corresponding part in Sect. 1.2 for the implication). It is also confirmed that the prior nodes and the destination nodes are strongly asymmetric in Module 3. In contrast, the prior nodes and destination nodes in Modules 2 and 4 are relatively symmetric. These observations imply that the visits of locations in Module 3 are direction-sensitive, while those in Modules 2 and 4 are less direction-sensitive.

Fig. 6
figure 6

Sankey diagrams of the four largest modules in the second-order Markov network. The size of a strip of each location corresponds to the relative amount of flow from-to the location in the memory network

3 Stationarity of the modules

The readers may wonder if the identified modules in the second-order Markov network are “significant”. It should be noted here that in this study, we did not perform community detection as a task of statistical inference. That is, we only used the Infomap as a tool to propose several informative node sets that exhibit an assortative structure.

Fig. 7
figure 7

Sankey diagram comparing the modules identified in the second-order Markov networks of successive years

However, we still need to assess which of the identified modules are informative. For example, a number of small modules are identified as a result of the Infomap (although we only show large modules in this paper), and it is doubtful whether they are worth further consideration. These small modules might have appeared because of the algorithmic infeasibility of the optimization algorithm, or they might have emerged because of the random nature of the network. In fact, by comparing the randomness assumed in the map equation (Smiljanić et al. 2019), a statistical assessment of significance should be possible. However, we should also note that, because the memory network of the FF-data must be strongly affected by the geographic constraint and the use of airports, the plausibility of the statistical model is also a considerable issue.

Therefore, instead of assessing the statistical significance, we assess the significance of the identified modules based on the consistency (Kawamoto and Kabashima 2018). By using the Sankey diagram,Footnote 2 we assess whether the modules are stationary in the FF-data across different years. Because it is unlikely that the module structures largely differ in reality, if it happens, we should conclude that the modules are simply identified out of noises. Figure 7 indicates that, for larger modules among the ones focused upon in Sect. 2.3, nearly the same modules are indeed identified in all datasets. From these observations, we conclude that the large modules considered in Sect. 2.3 are informative.Footnote 3

4 Conclusion

Based on the observation that the FF-data apparently have structures that cannot be explained by a simple network representation, we revealed the module structure of the travel pathways of foreign visitors using the framework of the memory network and the map equation (and the Infomap as the specific algorithm).

The results herein offer a better understanding of the travel patterns of foreign visitors. When travel patterns are utilized for deciding government policies or marketing research in the tourism industry, it is important to recognize whether a travel to/from a particular location is considerably conditioned on the location visited previously/later. It would be difficult to identify such a feature by skimming through the raw FF-data. Moreover, for the pathways that are highly correlated, the results of memoryless network approaches are not very reliable. The present analysis based on the second-order Markov networks successfully revealed dependencies on the previously/later visited locations.

We expect that the results described herein will be even more useful by relating the identified modules with regional factors. For example, it is interesting to investigate how the modules are correlated to the amount of consumption by tourists and the degree of development of public transportation in each prefecture.

It is difficult to forecast whether the structures we found will exist in the future, particularly during an era in which the way people live and travel is drastically changing. In any case, however, we expect that our results will serve as a reference for future data analysis of traveling patterns.