Keywords

1 Introduction

Hainan Island locates in the south end of China, north to Qiongzhou channel she looks each other with Guangdong, south to the widest South China Sea, she is the unique tropic Island province of China, involves the Hainan Island, the Xisha Islands, the Zhongsha Islands, the Nansha Islands and their reef and the sea field. Hainan Island is located between 18°10′–20°10′N and 108°37′–111°05′E, and its latitude is similar to that of Hawaii of USA. Hainan Island possesses beautiful scene and pleasant climate. In recent years, along with determination of the national strategic planning of construction international tourism Island, Hainan’s tourism industry is booming. Hainan Island attracts more and more domestic and foreign tourists coming to visit scenic spot here, such as the Tianyahaijiao, the Nanshan, and the Yalong Bay. But there are hundreds of scenic spots on Hainan Island, and therefore, how to set reasonable tourism scheme for tourists is a very worth problem to study. In this chapter, the travel route planning problem is studied, and tourism route planning model is established.

2 Programming Problem of Tour Route

Programming of tour route, which is the problem for several scenic spots, according to the target given beforehand, upbuilds the sequence to travel the scenic spots. The given targets may be the shortest path and time, or may be the lowest expenses. According to the statistics, the most part of tourists coming to Hainan Island will choose two kinds of touring model: one is to circle the Island, thus choosing several scenic spots which are distributed throughout the Island: setting out from A city, and after visiting all the scenic spots, coming back to A city; the other model is setting out from A city, and after visiting all the scenic spots, leaving the Island from B city. The first model uses the Hamilton loop problem in graph theory, and the second model uses modified Hamilton loop problem. Next, we will research those two models.

Model 1: Around the Island tour mode, in which the tourist starts from one of the chosen scenic spots A and after visiting all the scenic spots, the tourist comes back to A city; this mode can be summed up in Hamilton loop problem in graph theory. It is well known that Hamilton loop problem is an open problem, its optimal solution has not been solved yet, and researches of experts and scholars at home and abroad were all concentrated on seeking approximate optimal solution for this problem. Annotation [1] proposed the principle of one-by-one reversion of two sides to obtain the approximate optimum solution, but the traditional solving process of this principle was very complicated, especially in the case of many vertexes, almost unsolvable. Accordingly, annotation [2] puts forward the matrix turning method to realize the solution-seeking process of the principle of one-by-one reversion of two sides and the improved method is relatively easy in programming, concise and independent in procedures, and fast in computing; furthermore, it is suitable for the case of many vertexes. The following simple introduced this method.

3 Basic Conception

Assume that \( G = (V,\;E) \) is a weighted undirected graph, wherein \( V = \{ v_{1} ,\,v_{2} ,\, \ldots ,\,v_{n} \} \) is the set of vertexes and E is the set of edges. In graph G, each edge corresponds to a real number \( w(e) \), which is called the weight of this edge. If two arbitrarily vertexes in graph G were linked by an edge, the graph G is a complete graph.

Distance matrix: For undirected graph G, \( A = (a_{ij} )_{n \times n} \) is its distance matrix,wherein

$$ a_{ij} = a_{ji} = \left\{ {\begin{array}{*{20}l} {w_{ij} ,} & {{(}v_{i} ,v_{j} ) \in E} \\ {0,} & {i = j} \\ \end{array} } \right. $$

where \( w_{ij} \) be the weight between i and j.

Hamilton loop: Let \( G = (V,E) \) be a connected and undirected graph, and the circle which passes every point of G once and only once is called a Hamilton circle of G, called H circle for short.

Optimum H loop: In weighted graph \( G = (V,E) \), the Hamilton circle with minimum weight is called the optimum H loop.

4 The Principle of One-by-One Reversion of Two Sides

The principles of one-by-one reversion of two sides [1] are as follows:

  1. 1.

    Arbitrarily take the initial H loop: \( C_{0} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i} ,\, \ldots ,\,v_{p} ,\, \ldots ,\,v_{n} ,\,v_{1} \)

  2. 2.

    For all \( i,j \), \( 1 < i + 1 < j < n \), if \( w(v_{i} ,v_{j} ) + w(v_{i + 1} ,v_{j + 1} ) < w(v_{i} ,v_{i + 1} ) + w(v_{j} ,v_{j + 1} ) \), then delete edges \( w(v_{i} ,v_{j} ) \) and \( (v_{i + 1} ,v_{j + 1} ) \) in \( C_{0} \) and add new edges \( w(v_{i} ,v_{i + 1} ) \) and \( w(v_{j} ,v_{j + 1} ) \), to form a new H loop C, namely \( C = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i - 1} ,\,v_{j - 1} ,\, \ldots ,\,v_{i + 1} ,\,v_{j + 1} ,\, \ldots ,\,v_{n} ,\,v_{1} \)

  3. 3.

    Execute Step 2 repeatedly until condition cannot be satisfied. Then, the \( C \) obtained is the approximate optimum route.

The principle of one-by-one reversion of two sides is concise and easy to understand, and it implements more convenient, but in the case of more vertexes, it implements more complicated, even unsolvable. Annotation [2] puts forward the matrix turning method to realize the solution-seeking process of the principle of one-by-one reversion of two sides, and the improved method is relatively easy in programming, concise and independent in procedures, and fast in computing; the following simply introduced the step for seeking optimum H loop by the matrix turning method.

  1. Step 1:

    Construct an initial fictitious H circle in a complete weighted graph: \( C_{0} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i} ,\, \ldots ,\,v_{p} ,\, \ldots ,\,v_{n} ,\,v_{1} \), wherein \( v_{1} \) is the starting point, \( v_{n} \) is the leaving point, and the sequence of points in between is arbitrary. According to the sequence of those points, we get a distance matrix \( A = (a_{ij} )_{n + 1,n + 1} \), wherein

    $$ a_{ij} = a_{ji} = \left\{ {\begin{array}{*{20}c} {w_{ij} ,} & {\left( {v_{i} ,v_{j} } \right) \in E} \\ {0,} & {i = j} \\ \end{array} } \right. $$

    where \( w_{ij} \) be the weight between i and j.

  2. Step 2:

    Create a permutation sequence frame for points above the first row of A and under the last row of A; meanwhile, add a zero rank before the first rank and after the last rank each. Then, we get matrix A, and the total weight of \( C_{0} \) is \( \sum\nolimits_{i = 2}^{n - 2} {A(i,i + 1)} \).

  3. Step 3:

    In matrix A, for all i, j, \( 2 < i + 1 < j < n - 2 \), if \( A(i,j) + A(i + 1,j + 1) < A(i,\,i + 1) + A(j,\,j + 1) \), we turn rows from (i + 1) to j and those from (i + 1) to j, thus forming a new distance matrix. The sequence of points in A changes to \( C = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i - 1} ,\,v_{j - 1} ,\, \ldots ,\,v_{i + 1} ,\,v_{j + 1} ,\, \ldots ,\,v_{n} \).

  4. Step 4:

    Execute Step 3 repeatedly until condition \( A(i,j) + A(i + 1,j + 1) < A(i,i + 1) + A(j,j + 1) \) cannot be satisfied. Then, the C obtained is the approximate optimum route.

This process can be realized by computer, and the MATLAB program is as follows:

Program: seek for optimum H circle function [a, b] = h(e) % e is distance matrix with points sequence frame of initial H circle.

  • n = size(e); % compute the dimension of distance matrix.

    • for i = 2: n − 2;

    • for j = i + 1: n − 2; % circulation for 2 to n − 2.

    • if e(i, j) + e(i + 1, j + 1) < e(i, i + 1) + e(j, j + 1);

    • a = horzcat(e(:, 1: i), e(:, j:−1: i + 1), e(:, j + 1: n)); % turn from the (i + 1)th rank to the jth rank of e.

      • b = vertcat(a (1: i, :), a(j:−1: i + 1, :), a(j + 1: n, :)); % turn from the (i + 1)th row to the jth row of a.

      • e = b;

      •                    end

      •          end

      • end

      • s = 0;

      • for i = 2: n − 2;

      • s = s + e(i, i + 1); % calculates total weight of H circle after optimization.

      • end

      • e

      • s

Model 2: Setting out from A city and, after visit all of the scenic spots, leave from B city. This mode is not the problem of circle route, to which the Hamilton loop problem is not applicable. At present, the second model is rarely researched on by scholars, and, through analogy, we find that it can be solved easily by slightly improving the principle of one-by-one reversion of two sides. The improved method is illustrated as follows:

  1. Step 1:

    Construct an initial fictitious H circle in a complete weighted graph \( C_{0} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i} ,\, \ldots ,\,v_{p} ,\, \ldots ,\,v_{n} ,\,v_{1} \), wherein \( v_{1} \) is the starting point, \( v_{n} \) is the leaving point, the sequence of points in between is arbitrary, and edge \( v_{n} ,v_{1} \) is fictitious. Note that in the whole computing process, this fictitious side is kept unchanged, and the real route is \( {{C_{0}}^{\prime }} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i} ,\, \ldots ,\,v_{p} ,\, \ldots ,\,v_{n} \). According to the sequence of those points, we get a distance matrix \( A = (a_{ij} )_{n + 1,n + 1} \), wherein

    $$ a_{ij} = a_{ji} = \left\{ {\begin{array}{*{20}c} {w_{ij} ,} & {\text{(}v_{i} ,v_{j} ) \in E} \\ {0,} & {i = j} \\ \end{array} } \right. $$

    where \( w_{ij} \) be the weight between i and j.

  2. Step 2:

    Create a permutation sequence frame for points above the first row of A and under the last row of A; meanwhile, add a zero rank before the first rank and after the last rank each. Then, we get matrix \( A^{{\prime }} \), and the total weight of \( {{C_{0}}^{\prime }} \) is \( \sum\nolimits_{i = 2}^{n - 3} {A^{{\prime }} (i,\,i + 1)} \).

  3. Step 3:

    In matrix \( A^{{\prime }} \), for all i, j, \( 2 < i + 1 < j < n - 3 \), if \( A^{{\prime }} (i,\,j) + A^{{\prime }} (i + 1,\,j + 1) < A^{{\prime }} (i,\,i + 1) + A^{{\prime }} (j,j + 1) \), we turn rows from (i + 1) to j and those from (i + 1) to jth, thus forming a new distance matrix. The sequence of points in \( A^{{\prime }} \) changes to \( C^{{\prime }} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{i - 1} ,\,v_{j - 1} ,\, \ldots ,\,v_{i + 1} ,\,v_{j + 1} ,\, \ldots ,\,v_{n} \).

  4. Step 4:

    Execute Step 3 repeatedly until condition \( A^{{\prime }} (i,\,j) + A^{{\prime }} (i + 1,j + 1)\; < \;A^{{\prime }} (i,\,i + 1) + A^{{\prime }} (j,\,j + 1) \) cannot be satisfied. Then, the \( C^{{\prime }} \) obtained is the approximate optimum route. This process also can be realized by computer, and it only has to do little change to a parameter of the loop mode program, which we omit here.

5 Practical Application

Case: Among the two travelers visiting Hainan Island, one plans to circle travel the Island, starting from Haikou city and then coming back to Haikou and finally leaving the Island from Haikou after a circle traveling; the another traveler plans to start from Haikou city and depart the Island from Sanya city after traveling all over the scenic spots chosen. Both travelers choose the following seven scenic spots, which are the typical of Hainan Island: the Volcanic Vent Geology Park (\( v_{1} \)), Seven Fairy Mountain (\( v_{2} \)), Boao Thousand Boats Bay (\( v_{3} \)), Stone Flower Water Tunnel (\( v_{4} \)), Xinglong Tropic Botanic Garden (\( v_{5} \)), Five Fingers Mountain (\( v_{6} \)), and Ends of the Earth (\( v_{7} \)).\( v_{i} ,\,i = 1,\,2,\, \ldots ,\,7 \) stands for those seven scenic spots, respectively. Suppose that there is a path connecting every two scenic spots, Table 1 shows the distance between every two spots (unit: km).

Table 1 Distance between every two spots (unit: km)

Please design a reasonable travel route for those two travelers.

Since the seven scenic spots scattered in different cities or counties of Hainan Island, Table 2 lists the cities or counties where the scenic spots belong to.

Table 2 Cities or counties where the scenic spots belong to

For the first traveler, his choice is circle travel, namely the model one mentioned above. As the Volcanic Vent Geology Park belongs to Haikou city, we can set up the initial circle \( C_{0} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{7} ,\,v_{1} \). The corresponding distance matrix after edging A is as follows:

$$ A = \left[ {\begin{array}{*{20}l} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 1 & 0 \\ 0 & 0 & {258.8} & {124.6} & {153} & {182.2} & {319} & {287.2} & 0 & 0 \\ 0 & {258.8} & 0 & {162.5} & {178.1} & {99.4} & {69.8} & {97.2} & {258.8} & 0 \\ 0 & {124.6} & {162.5} & 0 & {227} & {87.4} & {222.6} & {191.8} & {124.6} & 0 \\ 0 & {153} & {178.1} & {227} & 0 & {334} & {134} & {230.4} & {153} & 0 \\ 0 & {182.2} & {99.4} & {87.4} & {334} & 0 & {159.5} & {128.1} & {182.2} & 0 \\ 0 & {319} & {69.8} & {222.6} & {134} & {159.5} & 0 & {133.2} & {319} & 0 \\ 0 & {287.2} & {97.2} & {191.8} & {230.4} & {128.1} & {133.2} & 0 & {287.2} & 0 \\ 0 & 0 & {258.8} & {123.6} & {153} & {182.2} & {319} & {287.2} & 0 & 0 \\ 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 1 & 0 \\ \end{array} } \right] $$

Deploying the MATLAB program, we can get the approximate optimum H circle \( C = v_{1} ,\,v_{4} ,\,v_{6} ,\,v_{2} ,\,v_{7} ,\,v_{5} ,\,v_{3} ,\,v_{1} \) and the travel route is as follows: Volcanic Vent Geology Park (\( v_{1} \)) → Stone Flower Water Tunnel (\( v_{4} \)) → Five Fingers Mountain (\( v_{6} \)) → Seven Fairy Mountain (\( v_{2} \)) → the Ends of the Earth (\( v_{7} \)) → Xinglong Tropic Botanic Garden (\( v_{5} \)) → Boao Thousand Boats Bay (\( v_{3} \)) → Volcanic Vent Geology Park (\( v_{1} \)). The total mileage is 794.1 km. Through analyzing the computing result and the traffic net of Hainan Island, we know that this travel route is an optimized scheme for circle travel indeed.

For the other traveler, he chooses model 2, starting from Haikou city and then depart from Sanya city after traveling over the scenic spots. As the Volcanic Vent Geology Park is located in Haikou, we can start from Volcanic Vent Geology Park and finally depart from the Ends of the Earth in Sanya. Set up the initial fictitious circle \( {{C_{0}}^{\prime }} = v_{1} ,\,v_{2} ,\, \ldots ,\,v_{7} ,\,v_{1} \), wherein the fictitious edge \( v_{7} ,\,v_{1} \) stands for the fractious edge between Sanya and Haikou, which maintains unchanged in the whole computing process. The order of other edges can be adjusted with the principle of one-by-one reversion of two sides before finally determining the approximate optimum route. We can also employ the MATLAB program to obtain the approximate optimum fictitious H circle \( C^{{\prime }} = v_{1} ,\,v_{4} ,\,v_{6} ,\,v_{2} ,\,v_{3} ,\,v_{5} ,\,v_{7} ,\,v_{1} \). The real route is \( C = v_{1} ,\,v_{4} ,\,v_{6} ,\,v_{2} ,\,v_{3} ,\,v_{5} ,\,v_{7} \), Volcanic Vent Geology Park (\( v_{1} \)) → Stone Flower Water Tunnel (\( v_{4} \)) → Five Fingers Mountain (\( v_{6} \)) → Seven Fairy Mountain (\( v_{2} \)) → Boao Thousand Boats Bay (\( v_{3} \)) → Xinglong Tropic Botanic Garden (\( v_{5} \)) → the Ends of the Earth (\( v_{7} \)). The total mileage is 734.8 km. It is a reasonable route.

6 Conclusion

This intelligent travel route programming model boasts widely application, which is verified with the example quoted in this chapter. Besides, if the weight of the weighted graph of scenic spots changes to time, then this model can be used to solve the problem of optimum traveling timetable. If the weight changes to charge, then this model can be applied to solve the problem of optimum traveling cost as well.