# Model of Wagons’ Placing-In and Taking-Out Problem in a Railway Station and Its Heuristic Algorithm

Authors: Chuijiang Guo; Dingyou Lei
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Placing-in and taking-out wagons timely can decrease wagons’ dwell time in railway stations, improve the efficiency of railway transportation, and reduce the cost of goods transportation. We took the locomotive running times between goods operation sites as weights, so the wagons’ placing-in and taking-out problem could be regarded as a single machine scheduling problem,1pijCmax, which could be transformed into the shortest circle problem in a Hamilton graph whose relaxation problem was an assignment problem. We used a Hungarian algorithm to calculate the optimal solution of the assignment problem. Then we applied a broken circle and connection method, whose computational complexity was O(n2), to find the available satisfactory order of wagons’ placing-in and taking-out. Complex problems, such as placing-in and transferring combined, taking-out and transferring combined, placing-in and taking-out combined, or placing-in, transferring, and taking-out combined, could also be resolved with the extended algorithm. A representative instance was given to illustrate the reliability and efficiency of our results.


---

## Body

## 1. Introduction

After a wagon has been loaded in a loading station, it should be taken out from the goods yard (or railway siding) and coupled to its departure train by a shunting locomotive. When the train arrives at an unloading station, some wagons are removed and placed on their operation sites.The total time of the process of transporting a wagon from origin to destination can be split into three parts: time spent in the loading station and unloading station, transit time in the marshalling station, and time on the run. According to Chinese statistics, stay time in loading and unloading stations occupies more than 70 percent of the total time [1]. Therefore, organizing wagons’ placing-in and taking-out timely can decrease wagons’ dwell time in loading and unloading stations, improve the efficiency of railway transportation, and reduce the cost of goods transportation.The placing-in and taking-out problem has puzzled scholars since the 1950s, and a number of helpful studies have been published. Lei et al. [1] formulated a mathematical model of optimizing operation for placing-in and taking-out wagons in branch-shaped sidings and depicted it as a typical traveling salesman problem (TSP). A combination of a genetic algorithm and an ant colony algorithm called GACA was presented. Li and Du [2] built a graph and a scheduling theory model of the fetching and delivering wagon problem in a branch-shaped railway siding and suggested two fast and simple algorithms. Shi et al. [3] and Yu and Li [4] turned placing-in and taking-out on branch-shaped sidings into a searching Hamilton circle with minimum weights. Heuristic algorithms were used to resolve the problem. Du and Li [5] built a model of scheduling theory for fetching and delivering vehicles on radial sidings and provided a fast algorithm.Another related problem is TSP with pick-up and delivery, which includes the additional constraint that delivery customers must be visited before any pick-up customers. Nenad and colleagues presented a variable neighborhood search approach for solving the one-commodity pick-up and delivery traveling salesman problem. They adapted a collection of neighborhood structures,k-opt, double-bridge, and insertion operators, mainly used for solving the classical traveling salesman problem [6]. Renaud and colleagues proposed three mathematical models for the pick-up and delivery problem with shuttle routes and a branch-and-cut-and-price algorithm to solve it [7]. Rais and colleagues described mixed integer-programming formulations for the problem with and without time windows for services [8]. Another helpful research is cited in the reference list [9, 10].The published research on the placing-in and taking-out wagons problem mostly establishes its model on certain ideal conditions. For example, some scholars considered wagons’ placing-in and taking-out as two separate operations, which were difficult to apply to actual situations. In addition, the accuracy of the heuristic algorithms provided deserves further consideration. In this paper, we take the locomotive running time between goods operation sites as weights, regard the wagons’ placing-in and taking-out problem as a single machine scheduling problem1|pij|Cmax⁡, and transform it into the shortest circle problem in a Hamilton graph, whose relaxation problem is an assignment problem. We use a Hungarian algorithm to calculate the optimal solution of the assignment problem. Then, we use a broken circle and connection method to find a satisfactory order of wagons’ placing-in and taking-out. In addition, we study complex problems: placing-in and transferring combined or taking-out and transferring combined; placing-in and taking-out combined; and placing-in, transferring, and taking-out combined.The remainder of the paper is organized as follows. The problem description is shown in Section2. In Section 3, we provide a single machine scheduling problem for wagons’ placing-in separately operation and transform it into the shortest circle problems in a Hamilton graph, and a broken circle and connection method is used to resolve it. We extend our research to other operation patterns in Section 4. A representative numerical example is presented in Section 5. Section 6 concludes.


## 2. Problem Description

Railway sidings and freight yards are places where goods are loaded and unloaded. In this paper, we refer to them as goods operation sites. Depending on their layout in a railway station, we can divide them into three types: radial, branch-shaped, and mixed. In a radial station, after the shunting locomotive has sent a wagon-group to one goods operation site, it must go back to the railway station before running on to the next site. Accordingly, every wagon-group reaches its corresponding site at a different time and returns to the railway station at a different time too. For a branch-shaped station, the shunting locomotive does not need to return to the station before placing-in another wagon-group. That is to say, all groups’ arrival times are different, but their return times are the same. As regards the mixed goods operation site, the wagon operation shares some common features with the two types above.In the loading station or the unloading station, a shunting locomotive is assigned to certain tasks, which include placing-in wagons, taking-out wagons, and transferring wagons between the station or operation sites. Because of the diversity of assignment operations and several combinations, the pattern of placing-in and taking-out wagons is summarized as placing-in separately, taking-out separately, placing-in and taking-out combined, placing-in and transferring combined, taking-out and transferring combined, and placing-in, transferring, and taking-out combined.Considering that trains leave the station on time as much as possible, this paper discusses how the dispatcher optimizes the operation sequence of related sites to minimize the total running time of the locomotive. Only in this way can we reduce the possibility of train delay to a meaningful extent, decrease the cost of locomotive operation to a minimum, and cut down wagons’ dwell time in the station.


## 3. Wagons’ Placing-In Separately or Taking-Out Separately

Wagons’ placing-in separately means that a shunting locomotive couples all wagons, sends them to the operation sites one by one, puts the wagons in the right place, and then goes back to the station alone. Regardless of whether the wagons waiting to be sent are loaded or empty, the operation process of wagons placing-in separately comprises the following steps: selecting wagon-group, running to the sites, placing wagons, and returning the station. Taking-out separately means that the shunting locomotive goes to goods sites to retrieve the required wagons one by one and goes back to the railway station. The operational process of wagons’ taking-out separately comprises the following steps: running to the sites, taking-out wagons, returning the station. It can be concluded from the above that the two operational processes have some identical features, and, hence, we can unite them in one mathematical model.


### 3.1. Mathematical Model

In this paper, we will discuss the wagons’ placing-in problem in a branch-shaped railway station. To fit the actual circumstance of a railway station, the following conditions below are set.(1)
There is only one shunting locomotive in the railway station. The locomotive should send wagons to relevant operation sites, visit every site only once, and return to the railway station after its work has been accomplished.(2)
Numbers of the wagons waiting for placing-in (or taking-out) are known beforehand.(3)
The locomotive running times between all sites are obtained from actual data.(4)
The number of wagons coupled by the locomotive has no influence on the locomotive running times between operation sites.In what follows, we describe a series of tasks involving four goods sites in a railway station. Several wagon-groups should be sent to corresponding goods sites.In Figure1, point v0 is considered as the railway station and points v1,v2,v3,v4 are related goods sites. v1′,v2′,v3′ are representations of turnout between rail lines. Notations a~g refer to locomotive running times between points (operation sites, turnouts, or the station), which can be gained from actual measurement data. Although there is a slight time discrepancy between the times the locomotive runs back and forth on the same line, we regard them as the same for the sake of simplicity.Figure 1
Layout station with branch-shaped goods operation sites.If we think of the shunting locomotive as a machine, the operation of placing-in wagon-groups to the sitei as processing workpiece Ji and wagons placing-in completion is considered to be workpiece Ji processing accomplishment; the wagons’ placing-in problem can be regarded as a single machine scheduling problem 1|pij|Cmax⁡. If workpiece Ji is the predecessor of workpiece Jj, then the processing time of Jj is tij (i≠j,i,j=0,1,2,3,4). Accordingly, i=0 means that there is no predecessor workpiece. In other words, the shunting locomotive starts from the station en route to its first operation site. Our objective is to optimize the shunting locomotive operation to achieve minimum operation time after it has accomplished all its tasks. Therefore, the problem of wagons’ placing-in separately can be regarded as a single machine scheduling problem 1|pij|Cmax⁡. pij is machine processing time, which corresponds to tij in this paper. Cmax⁡ is completed time of the last workpiece, which is the time in which the shunting locomotive returns to the railway station. Scheduling problem 1|pij|Cmax⁡ can be solved by transforming it into the well-known problem of the shortest circle in a Hamilton graph.We can convert wagons’ placing-in separately into the problem of the shortest circle in a Hamilton graphG=[V,A,C]. In the Hamilton graph G shown in Figure 2, V signifies the point set {v0,v1,…,v4}, A is presentation of edge set {(vi,vj)∣vi,vj∈V}, and C expresses shunting locomotive running time set {tij∣i,j≠0,1,…,4}.Figure 2
Hamilton graph.We regard vertexv0 as the railway station, which is the starting vertex of Hamilton graph G. We consider related operation sites of a series of tasks, which should be visited only once by the locomotive, as vertices of Hamilton. If we can find a circle which goes through all related operation sites only once and its origin and destination are v0, a Hamilton circle will be achieved. Shunting locomotive running time between any two sites is shown in Figure 1. Corresponding weights of Hamilton circle are the aggregation of locomotive running time on the lines. For example, v0→v1→v3→v4→v2→v0 is a Hamilton circle which has path length of 2a+4b+4c+2d+2e+2f+2g.Since all vertices of Hamilton graphG in Figure 2 are connected, it is a complete graph. On the other hand, it is an undirected graph on condition that the time the locomotive spends running back and forth between two sites is considered to be the same. A Hamilton graph composed of N goods operation sites (including the station) has (N-1)! Hamilton circles. It is obvious that it is not easy to obtain the optimal solution with the enumeration method. Hence, it is essential to choose a simple method to select the optimal scheme from the many schemes available.The problem of the shortest circle in a Hamilton graph is a classic NP-complete combinatorial problem and therefore there is no known polynomial time algorithm (unlessP = NP) that is able to solve all instances of the problem. Consequently, heuristic algorithms are used to provide solutions that are of high quality but not necessarily optimal. Since the 1990s, various approaches have been proposed to solve the problem, such as branch-and-bound, cutting planes, 2-opt, simulated annealing, neural network, and tabu search. Some of these methods are exact algorithms and the others are near-optimal or approximate algorithms [11–17]. In this paper, we provide a broken circle and connection method to find a satisfactory circle in a Hamilton graph easily, that is, the satisfactory available order of wagons’ placing-in and taking-out.In a Hamilton circle, as seen in Figure2, an arrow’s head connects with another arrow’s tail. In other words, a vertex is the starting-point of one arrow and the end-point of another. Some characteristics of assignment problem in integer programming problems afflict the Hamilton circle. Assigning vi to vj as its source point is equivalent to task i being assigned to worker j to do. Accordingly, the weights of edge correspond to the quantity of resource costs.Introduce the variablexij and define it as follows:
(1)xij={1,ifviisassignedtovjasitssourcepoint0,otherwise.
According to the above analysis, the Hamilton graph of wagons’ placing-in separately can be relaxed as an assignment problem, and its linear model is shown as follows:
(2)min⁡⁡z=∑i=0n∑j=0ntijcij,(3)s.t.∑i=0nxij=1,j∈V,(4)∑j=0nxij=1,i∈V,(5)xij=0or1,i,j∈V.
Equation (2) is the objective function which indicates that we want to minimize the whole locomotive running time of a series of placing-in wagon operations. Constraints (3) and (4) signify that the shunting locomotive goes forward to an operation site and returns only once, respectively. Constraint (5) denotes that xij is a binary variable.The transformed time coefficient of Hamilton graphG in Figure 2 is shown in Table 1. All vertices of graph G lack a ring. On the other hand, because the shortest circle problem is a minimization problem, we suppose that cij (i=j) is equal to M (M is a sufficient positive number), in order to ensure that no vertex can be assigned to itself as source point.Table 1
Time coefficient of assignment problem.
Start-point
End-point
v
0
v
1
v
2
v
3
v
4
v
0
M
a
+
b
+
c
+
d
a
+
b
+
c
+
e
a
+
b
+
f
a
+
g
v
1
a
+
b
+
c
+
d
M
d
+
e
c
+
d
+
f
b
+
c
+
d
+
g
v
2
a
+
b
+
c
+
e
d
+
e
M
c
+
e
+
f
b
+
c
+
e
+
g
v
3
a
+
b
+
f
c
+
d
+
f
c
+
e
+
f
M
b
+
f
+
g
v
4
a
+
g
b
+
c
+
d
+
g
b
+
c
+
e
+
g
b
+
f
+
g
MThe assignment problem, which should be pointed out, is only a relaxation problem of the Hamilton graph discussed. The shortest circle in a Hamilton graph must be a connected graph which requires all arrows’ heads and tails to be connected rather than divided. Therefore, the complete form of the Hamilton graph model should include the following two constraints too:(6)∑i,j∈Vxij≤|S|-1,S⊂V,2≤|S|≤n-2,
where S in the above constraints is a proper subset of set V. |S| denotes the number of elements. Constraints (6) are subtour elimination constraints which prohibit the formation of subtours, that is, tour subsets of fewer than n vertices.


### 3.2. Solving Method

Solving the model of wagons’ placing-in separately in the railway station should be performed in two steps. First, a classical algorithm of the assignment problem, the Hungarian algorithm, is used to calculate the lower boundz*. Second, with the help of a broken circle and connection method, we can obtain a satisfactory circle in a Hamilton graph, which corresponds to the satisfactory wagons’ placing-in order for related operation sites.


#### 3.2.1. Assignment Problem Method

As a classical algorithm of assignment problems, the Hungarian algorithm can obtain a global optimal solution. With an increasing coefficient matrix dimension, the algorithm’s running time becomes a little longer, but it can reduce computational efforts much more than any enumeration method. In this paper, the Hungarian algorithm is selected to resolve the relaxation problem of wagons’ placing-in separately—the assignment problem.


#### 3.2.2. Broken Circle and Connection Method

The solution obtained with the Hungarian algorithm, which should be pointed out, is only a solution to the relaxation problem. If it has formed a Hamilton circle, the optimal solution regarding the shortest cycle of the Hamilton graph is obtained. If it is still aN(N>1) bipartite graph, then we break the circles and connect them as follows.Assuming that the point set of one bipartite graph isU={u1,u2,…,ui,uj,…,um} and that of another is V={v1,v2,…,vk,vl,…,vm}, we select randomly two point pairs (ui,uj) and (vk,vl) and exchange their heads and tails. Corresponding weight increments can be computed as follows:
(7)Δt=til+tkj-tij-tkl.
Compare weight increments of all point pairs, select the point pairs which have minimal increments, and connect them together. In this case, an N bipartite graph is transformed into an N-1 bipartite graph. If this process continues, we gradually obtain a connected graph. Finally, a satisfactory circle of a Hamilton graph can be obtained.


#### 3.2.3. Solution Procedure

According to the analysis above, we perform a computational procedure for the wagons’ placing-in separately problem as follows.Step 1.
Transform wagons’ placing-in order problem in the railway station into the shortest circle in Hamilton graphG.Step 2.
Compute the relaxation problem to obtain the optimal solution with the Hungarian method. If a connected graph is obtained, go to Step5. Otherwise, go to Step 3.Step 3.
Randomly select two parts from theN bipartite graph. Choose a point pair from the two selected parts (ui,uj) and (vk,vl). Find other point pairs and calculate their corresponding values Δt.Step 4.
Compare allΔt values of point pairs. Select the minimum pairs and exchange their heads and tails. Then, N∶=N-1. If N=1, go to Step 5. If N>1, go to Step 3.Step 5.
Output optimal order of wagons’ placing-in to goods operation sites. The computation ends.Wagons’ taking-out separately operation has some same characters with wagons’ placing-in separately. Therefore, the model and algorithm of wagons’ placing-in separately are also suitable for the problem of wagons’ taking-out separately.


#### 3.2.4. Complexity Analysis

If there aren vertices in the Hamilton graph, there are n/2 subcycles in the worst case. We should execute a broken circle (n/2)-1 times to form only one circle. We should make comparisons n/2 times and similarly each circle has n/2 vertices at most. Therefore, the complexity of the algorithm in this paper is o(n2).


## 3.1. Mathematical Model

In this paper, we will discuss the wagons’ placing-in problem in a branch-shaped railway station. To fit the actual circumstance of a railway station, the following conditions below are set.(1)
There is only one shunting locomotive in the railway station. The locomotive should send wagons to relevant operation sites, visit every site only once, and return to the railway station after its work has been accomplished.(2)
Numbers of the wagons waiting for placing-in (or taking-out) are known beforehand.(3)
The locomotive running times between all sites are obtained from actual data.(4)
The number of wagons coupled by the locomotive has no influence on the locomotive running times between operation sites.In what follows, we describe a series of tasks involving four goods sites in a railway station. Several wagon-groups should be sent to corresponding goods sites.In Figure1, point v0 is considered as the railway station and points v1,v2,v3,v4 are related goods sites. v1′,v2′,v3′ are representations of turnout between rail lines. Notations a~g refer to locomotive running times between points (operation sites, turnouts, or the station), which can be gained from actual measurement data. Although there is a slight time discrepancy between the times the locomotive runs back and forth on the same line, we regard them as the same for the sake of simplicity.Figure 1
Layout station with branch-shaped goods operation sites.If we think of the shunting locomotive as a machine, the operation of placing-in wagon-groups to the sitei as processing workpiece Ji and wagons placing-in completion is considered to be workpiece Ji processing accomplishment; the wagons’ placing-in problem can be regarded as a single machine scheduling problem 1|pij|Cmax⁡. If workpiece Ji is the predecessor of workpiece Jj, then the processing time of Jj is tij (i≠j,i,j=0,1,2,3,4). Accordingly, i=0 means that there is no predecessor workpiece. In other words, the shunting locomotive starts from the station en route to its first operation site. Our objective is to optimize the shunting locomotive operation to achieve minimum operation time after it has accomplished all its tasks. Therefore, the problem of wagons’ placing-in separately can be regarded as a single machine scheduling problem 1|pij|Cmax⁡. pij is machine processing time, which corresponds to tij in this paper. Cmax⁡ is completed time of the last workpiece, which is the time in which the shunting locomotive returns to the railway station. Scheduling problem 1|pij|Cmax⁡ can be solved by transforming it into the well-known problem of the shortest circle in a Hamilton graph.We can convert wagons’ placing-in separately into the problem of the shortest circle in a Hamilton graphG=[V,A,C]. In the Hamilton graph G shown in Figure 2, V signifies the point set {v0,v1,…,v4}, A is presentation of edge set {(vi,vj)∣vi,vj∈V}, and C expresses shunting locomotive running time set {tij∣i,j≠0,1,…,4}.Figure 2
Hamilton graph.We regard vertexv0 as the railway station, which is the starting vertex of Hamilton graph G. We consider related operation sites of a series of tasks, which should be visited only once by the locomotive, as vertices of Hamilton. If we can find a circle which goes through all related operation sites only once and its origin and destination are v0, a Hamilton circle will be achieved. Shunting locomotive running time between any two sites is shown in Figure 1. Corresponding weights of Hamilton circle are the aggregation of locomotive running time on the lines. For example, v0→v1→v3→v4→v2→v0 is a Hamilton circle which has path length of 2a+4b+4c+2d+2e+2f+2g.Since all vertices of Hamilton graphG in Figure 2 are connected, it is a complete graph. On the other hand, it is an undirected graph on condition that the time the locomotive spends running back and forth between two sites is considered to be the same. A Hamilton graph composed of N goods operation sites (including the station) has (N-1)! Hamilton circles. It is obvious that it is not easy to obtain the optimal solution with the enumeration method. Hence, it is essential to choose a simple method to select the optimal scheme from the many schemes available.The problem of the shortest circle in a Hamilton graph is a classic NP-complete combinatorial problem and therefore there is no known polynomial time algorithm (unlessP = NP) that is able to solve all instances of the problem. Consequently, heuristic algorithms are used to provide solutions that are of high quality but not necessarily optimal. Since the 1990s, various approaches have been proposed to solve the problem, such as branch-and-bound, cutting planes, 2-opt, simulated annealing, neural network, and tabu search. Some of these methods are exact algorithms and the others are near-optimal or approximate algorithms [11–17]. In this paper, we provide a broken circle and connection method to find a satisfactory circle in a Hamilton graph easily, that is, the satisfactory available order of wagons’ placing-in and taking-out.In a Hamilton circle, as seen in Figure2, an arrow’s head connects with another arrow’s tail. In other words, a vertex is the starting-point of one arrow and the end-point of another. Some characteristics of assignment problem in integer programming problems afflict the Hamilton circle. Assigning vi to vj as its source point is equivalent to task i being assigned to worker j to do. Accordingly, the weights of edge correspond to the quantity of resource costs.Introduce the variablexij and define it as follows:
(1)xij={1,ifviisassignedtovjasitssourcepoint0,otherwise.
According to the above analysis, the Hamilton graph of wagons’ placing-in separately can be relaxed as an assignment problem, and its linear model is shown as follows:
(2)min⁡⁡z=∑i=0n∑j=0ntijcij,(3)s.t.∑i=0nxij=1,j∈V,(4)∑j=0nxij=1,i∈V,(5)xij=0or1,i,j∈V.
Equation (2) is the objective function which indicates that we want to minimize the whole locomotive running time of a series of placing-in wagon operations. Constraints (3) and (4) signify that the shunting locomotive goes forward to an operation site and returns only once, respectively. Constraint (5) denotes that xij is a binary variable.The transformed time coefficient of Hamilton graphG in Figure 2 is shown in Table 1. All vertices of graph G lack a ring. On the other hand, because the shortest circle problem is a minimization problem, we suppose that cij (i=j) is equal to M (M is a sufficient positive number), in order to ensure that no vertex can be assigned to itself as source point.Table 1
Time coefficient of assignment problem.
Start-point
End-point
v
0
v
1
v
2
v
3
v
4
v
0
M
a
+
b
+
c
+
d
a
+
b
+
c
+
e
a
+
b
+
f
a
+
g
v
1
a
+
b
+
c
+
d
M
d
+
e
c
+
d
+
f
b
+
c
+
d
+
g
v
2
a
+
b
+
c
+
e
d
+
e
M
c
+
e
+
f
b
+
c
+
e
+
g
v
3
a
+
b
+
f
c
+
d
+
f
c
+
e
+
f
M
b
+
f
+
g
v
4
a
+
g
b
+
c
+
d
+
g
b
+
c
+
e
+
g
b
+
f
+
g
MThe assignment problem, which should be pointed out, is only a relaxation problem of the Hamilton graph discussed. The shortest circle in a Hamilton graph must be a connected graph which requires all arrows’ heads and tails to be connected rather than divided. Therefore, the complete form of the Hamilton graph model should include the following two constraints too:(6)∑i,j∈Vxij≤|S|-1,S⊂V,2≤|S|≤n-2,
where S in the above constraints is a proper subset of set V. |S| denotes the number of elements. Constraints (6) are subtour elimination constraints which prohibit the formation of subtours, that is, tour subsets of fewer than n vertices.


## 3.2. Solving Method

Solving the model of wagons’ placing-in separately in the railway station should be performed in two steps. First, a classical algorithm of the assignment problem, the Hungarian algorithm, is used to calculate the lower boundz*. Second, with the help of a broken circle and connection method, we can obtain a satisfactory circle in a Hamilton graph, which corresponds to the satisfactory wagons’ placing-in order for related operation sites.


### 3.2.1. Assignment Problem Method

As a classical algorithm of assignment problems, the Hungarian algorithm can obtain a global optimal solution. With an increasing coefficient matrix dimension, the algorithm’s running time becomes a little longer, but it can reduce computational efforts much more than any enumeration method. In this paper, the Hungarian algorithm is selected to resolve the relaxation problem of wagons’ placing-in separately—the assignment problem.


### 3.2.2. Broken Circle and Connection Method

The solution obtained with the Hungarian algorithm, which should be pointed out, is only a solution to the relaxation problem. If it has formed a Hamilton circle, the optimal solution regarding the shortest cycle of the Hamilton graph is obtained. If it is still aN(N>1) bipartite graph, then we break the circles and connect them as follows.Assuming that the point set of one bipartite graph isU={u1,u2,…,ui,uj,…,um} and that of another is V={v1,v2,…,vk,vl,…,vm}, we select randomly two point pairs (ui,uj) and (vk,vl) and exchange their heads and tails. Corresponding weight increments can be computed as follows:
(7)Δt=til+tkj-tij-tkl.
Compare weight increments of all point pairs, select the point pairs which have minimal increments, and connect them together. In this case, an N bipartite graph is transformed into an N-1 bipartite graph. If this process continues, we gradually obtain a connected graph. Finally, a satisfactory circle of a Hamilton graph can be obtained.


### 3.2.3. Solution Procedure

According to the analysis above, we perform a computational procedure for the wagons’ placing-in separately problem as follows.Step 1.
Transform wagons’ placing-in order problem in the railway station into the shortest circle in Hamilton graphG.Step 2.
Compute the relaxation problem to obtain the optimal solution with the Hungarian method. If a connected graph is obtained, go to Step5. Otherwise, go to Step 3.Step 3.
Randomly select two parts from theN bipartite graph. Choose a point pair from the two selected parts (ui,uj) and (vk,vl). Find other point pairs and calculate their corresponding values Δt.Step 4.
Compare allΔt values of point pairs. Select the minimum pairs and exchange their heads and tails. Then, N∶=N-1. If N=1, go to Step 5. If N>1, go to Step 3.Step 5.
Output optimal order of wagons’ placing-in to goods operation sites. The computation ends.Wagons’ taking-out separately operation has some same characters with wagons’ placing-in separately. Therefore, the model and algorithm of wagons’ placing-in separately are also suitable for the problem of wagons’ taking-out separately.


### 3.2.4. Complexity Analysis

If there aren vertices in the Hamilton graph, there are n/2 subcycles in the worst case. We should execute a broken circle (n/2)-1 times to form only one circle. We should make comparisons n/2 times and similarly each circle has n/2 vertices at most. Therefore, the complexity of the algorithm in this paper is o(n2).


## 3.2.1. Assignment Problem Method

As a classical algorithm of assignment problems, the Hungarian algorithm can obtain a global optimal solution. With an increasing coefficient matrix dimension, the algorithm’s running time becomes a little longer, but it can reduce computational efforts much more than any enumeration method. In this paper, the Hungarian algorithm is selected to resolve the relaxation problem of wagons’ placing-in separately—the assignment problem.


## 3.2.2. Broken Circle and Connection Method

The solution obtained with the Hungarian algorithm, which should be pointed out, is only a solution to the relaxation problem. If it has formed a Hamilton circle, the optimal solution regarding the shortest cycle of the Hamilton graph is obtained. If it is still aN(N>1) bipartite graph, then we break the circles and connect them as follows.Assuming that the point set of one bipartite graph isU={u1,u2,…,ui,uj,…,um} and that of another is V={v1,v2,…,vk,vl,…,vm}, we select randomly two point pairs (ui,uj) and (vk,vl) and exchange their heads and tails. Corresponding weight increments can be computed as follows:
(7)Δt=til+tkj-tij-tkl.
Compare weight increments of all point pairs, select the point pairs which have minimal increments, and connect them together. In this case, an N bipartite graph is transformed into an N-1 bipartite graph. If this process continues, we gradually obtain a connected graph. Finally, a satisfactory circle of a Hamilton graph can be obtained.


## 3.2.3. Solution Procedure

According to the analysis above, we perform a computational procedure for the wagons’ placing-in separately problem as follows.Step 1.
Transform wagons’ placing-in order problem in the railway station into the shortest circle in Hamilton graphG.Step 2.
Compute the relaxation problem to obtain the optimal solution with the Hungarian method. If a connected graph is obtained, go to Step5. Otherwise, go to Step 3.Step 3.
Randomly select two parts from theN bipartite graph. Choose a point pair from the two selected parts (ui,uj) and (vk,vl). Find other point pairs and calculate their corresponding values Δt.Step 4.
Compare allΔt values of point pairs. Select the minimum pairs and exchange their heads and tails. Then, N∶=N-1. If N=1, go to Step 5. If N>1, go to Step 3.Step 5.
Output optimal order of wagons’ placing-in to goods operation sites. The computation ends.Wagons’ taking-out separately operation has some same characters with wagons’ placing-in separately. Therefore, the model and algorithm of wagons’ placing-in separately are also suitable for the problem of wagons’ taking-out separately.


## 3.2.4. Complexity Analysis

If there aren vertices in the Hamilton graph, there are n/2 subcycles in the worst case. We should execute a broken circle (n/2)-1 times to form only one circle. We should make comparisons n/2 times and similarly each circle has n/2 vertices at most. Therefore, the complexity of the algorithm in this paper is o(n2).


## 4. Complex Problems

### 4.1. Placing-In and Transferring Combined and Taking-Out and Transferring Combined

Placing-in and transferring combined means that the shunting locomotive transfers wagons during the process of placing-in wagons and then returns to the railway station. The subprocedures are choosing wagon-groups, running to goods sites, aligning wagon location, gathering wagons, transferring wagons, and turning back.One transferring operation can be regarded as a combination of one taking-out operation and one placing-in operation. Transferring operations can reduce the computational complexity of the algorithm to some extent. Placing-in and transferring combined and taking-out and transferring combined could be considered as the shortest circle problems in a Hamilton graph with visiting priority.For instance, if we transfer wagons from unloading sitevk to loading site vl, the shunting locomotive should visit unloading site vk beforehand, and then it can visit site vl at some other time. That is to say, site vk has visiting priority over site vl, that is, vk≻vl (≻ signifies priority).The placing-in and transferring combined operation is composed of placing-in operations and transferring operations. Assuming that there is a point set which comprises all placing-in sites, the station, and placing-in sites of all transferring operations, with the broken circle and connection method above we can obtain a satisfactory wagons’ placing-in circle for the point set.Then insert taking-out site of transferring operation into the segments which is behind its placing-in operation site in the circle. For example, we need to transfer wagons from unloading sitevk to loading site vl. It is assumed that we have already obtained the placing-in order v0v1⋯vivj⋯vl⋯vnv0. If we insert taking-out site vk of the transferring operation in segment (vi,vj), its corresponding route length is increased by Δt′=tik+tkj-tij. We select the circle with minimum increment. Then, a satisfactory placing-in and transferring combined order is obtained.The taking-out and transferring combined operation consists of taking-out operation and transferring operation. Similarly, we form a point set including all taking-out operation sites, the station, and all taking-out operation sites of transferring operations. We can obtain a satisfactory taking-out circle with the broken circle and connection method for the point set. Then we insert the placing-in site of the transferring operation between the end-points of each segment in front of its taking-out operation site in the circle. We select the circle with minimum increment in terms of route length. Then we can obtain a satisfactory taking-out and transferring combined operation order.


### 4.2. Placing-In and Taking-Out Combined and Placing-In, Transferring, and Taking-Out Combined

For placing-in and taking-out combined operations, we first formulate a placing-in circle and a taking-out circle, respectively, and transform them into a circle with the broken circle and connection method above. Then a satisfactory operation order of placing-in and taking-out combined operation can be obtained. The placing-in and taking-out operation order gained is relatively centralized, but it can reduce extra shunting work. Although it may prolong running time for the locomotive, it fits with the actual work rather better.For the placing-in, transferring, and taking-out combined operation, we form a set which includes all taking-out sites and all taking-out sites of transferring operations. On the other hand, we formulate another set which comprises all placing-in sites and all placing-in sites of transferring operations. Then we can obtain a satisfactory placing-in circle and a satisfactory taking-out circle with the broken circle and connection method above. Then we use the method once again. As a result, only one circle is gained in the end. During the process of the last broken circle and connection, we only need to exchange the segments, which are behind the taking-out sites in the taking-out circle, with the segments in the placing-in circle. This ensures a visiting priority relation in which the transferring operation requires and reduces the computational effort. For instance, there is an assignment of transferring some wagons from unloading operation sitevk to loading site vl. On condition that a taking-out circle v0v1⋯vkvivj⋯vnv0 has been gained, we only need to exchange segments of section vkvivj⋯vnv0 for segments of the placing-in circle.


## 4.1. Placing-In and Transferring Combined and Taking-Out and Transferring Combined

Placing-in and transferring combined means that the shunting locomotive transfers wagons during the process of placing-in wagons and then returns to the railway station. The subprocedures are choosing wagon-groups, running to goods sites, aligning wagon location, gathering wagons, transferring wagons, and turning back.One transferring operation can be regarded as a combination of one taking-out operation and one placing-in operation. Transferring operations can reduce the computational complexity of the algorithm to some extent. Placing-in and transferring combined and taking-out and transferring combined could be considered as the shortest circle problems in a Hamilton graph with visiting priority.For instance, if we transfer wagons from unloading sitevk to loading site vl, the shunting locomotive should visit unloading site vk beforehand, and then it can visit site vl at some other time. That is to say, site vk has visiting priority over site vl, that is, vk≻vl (≻ signifies priority).The placing-in and transferring combined operation is composed of placing-in operations and transferring operations. Assuming that there is a point set which comprises all placing-in sites, the station, and placing-in sites of all transferring operations, with the broken circle and connection method above we can obtain a satisfactory wagons’ placing-in circle for the point set.Then insert taking-out site of transferring operation into the segments which is behind its placing-in operation site in the circle. For example, we need to transfer wagons from unloading sitevk to loading site vl. It is assumed that we have already obtained the placing-in order v0v1⋯vivj⋯vl⋯vnv0. If we insert taking-out site vk of the transferring operation in segment (vi,vj), its corresponding route length is increased by Δt′=tik+tkj-tij. We select the circle with minimum increment. Then, a satisfactory placing-in and transferring combined order is obtained.The taking-out and transferring combined operation consists of taking-out operation and transferring operation. Similarly, we form a point set including all taking-out operation sites, the station, and all taking-out operation sites of transferring operations. We can obtain a satisfactory taking-out circle with the broken circle and connection method for the point set. Then we insert the placing-in site of the transferring operation between the end-points of each segment in front of its taking-out operation site in the circle. We select the circle with minimum increment in terms of route length. Then we can obtain a satisfactory taking-out and transferring combined operation order.


## 4.2. Placing-In and Taking-Out Combined and Placing-In, Transferring, and Taking-Out Combined

For placing-in and taking-out combined operations, we first formulate a placing-in circle and a taking-out circle, respectively, and transform them into a circle with the broken circle and connection method above. Then a satisfactory operation order of placing-in and taking-out combined operation can be obtained. The placing-in and taking-out operation order gained is relatively centralized, but it can reduce extra shunting work. Although it may prolong running time for the locomotive, it fits with the actual work rather better.For the placing-in, transferring, and taking-out combined operation, we form a set which includes all taking-out sites and all taking-out sites of transferring operations. On the other hand, we formulate another set which comprises all placing-in sites and all placing-in sites of transferring operations. Then we can obtain a satisfactory placing-in circle and a satisfactory taking-out circle with the broken circle and connection method above. Then we use the method once again. As a result, only one circle is gained in the end. During the process of the last broken circle and connection, we only need to exchange the segments, which are behind the taking-out sites in the taking-out circle, with the segments in the placing-in circle. This ensures a visiting priority relation in which the transferring operation requires and reduces the computational effort. For instance, there is an assignment of transferring some wagons from unloading operation sitevk to loading site vl. On condition that a taking-out circle v0v1⋯vkvivj⋯vnv0 has been gained, we only need to exchange segments of section vkvivj⋯vnv0 for segments of the placing-in circle.


## 5. Numerical Example

The layout of a railway station is shown in Figure3. The station is equipped with a shunting locomotive to deliver wagons. There are several tasks in terms of wagons’ placing-in and taking-out to do. The tasks are listed in Table 2. The corresponding running times in every line are marked in Figure 3. Now it is necessary to gain the operation order of the shunting locomotive within the least possible time.Table 2
Tasks of the shunting locomotive.
Serial number
Operation sites
Operation contents
1
v
1
Placing-in two wagons
2
v
2
Taking-out two empty wagons and transferring them to sitev4
3
v
3
Taking-out three wagons
4
v
4
Receiving two empty wagons from sitev2
5
v
5
Placing-in one wagon
6
v
6
Taking-out two wagons
7
v
7
Taking-out three empty wagons and transferring them to sitev10
8
v
8
Placing-in two wagons
9
v
9
Taking-out three wagons
10
v
10
Receiving three empty wagons from sitev7Figure 3
Layout of a railway station.All operation sites (including the station) are divided into two groups: placing-in operation site set{v1,v4,v5,v8,v10} and taking-out operation site set {v0,v2,v3,v6,v7,v9}. The priority relations required are v2≻v4 and v7≻v10.Time coefficients for all sites in the railway station are calculated and shown in Table3, where we set M=80. According to the computational procedure of the Hungarian algorithm, we can obtain the optimal solution to the assignment problem (relaxation problem of the shortest circle in the Hamilton graph): x110=1, x45=1, x54=1, x81=1, x108=1, x09=1, x23=1, x32=1, x67=1, x76=1, and x90=1. The total weight is 316. The corresponding graph of the result is shown in Figure 4.Table 3
Time coefficients for all sites in railway station.
Origins destinations
v
0
v
1
v
2
v
3
v
4
v
5
v
6
v
7
v
8
v
9
v
10
v
0
80
43
47
41
48
49
52
56
42
41
35
v
1
43
80
20
32
55
56
59
63
49
48
42
v
2
47
20
80
36
59
60
63
67
53
52
46
v
3
41
32
36
80
53
54
57
61
47
46
40
v
4
48
55
59
53
80
21
42
46
48
47
41
v
5
49
56
60
54
21
80
43
47
49
48
42
v
6
52
59
63
57
42
43
80
30
52
51
45
v
7
56
63
67
61
46
47
30
80
56
55
49
v
8
42
49
53
47
48
49
52
56
80
15
21
v
9
41
48
52
46
47
48
51
55
15
80
20
v
10
35
42
46
40
41
42
45
49
21
20
80Figure 4
Optimal result of assignment problem.After the broken circle and connection process has been executed three times, we can obtain a placing-in circle and a taking-out circle and they are shown in Figure5. Then we execute the last broken circle and connection procedure and compare the total weights of all circles. Exchanging edges (v2,v3) and (v8,v1), we can obtain a circle with minimum weights, as shown in Figure 6. Hence, the satisfactory wagons’ placing-in and taking-out order is v0→v9→v6→v7→v2→v1→v10→v4→v5→v8→v3→v0, which has total weights of 450.Figure 5
Placing-in circle and taking-out circle (bold lines denote placing-in circle and thin lines denote taking-out circle).Figure 6
Satisfactory order of wagons’ placing-in and taking-out.


## 6. Conclusion

Taking the locomotive running times as weights, the problem of wagons’ placing-in or taking-out separately can be regarded as a single machine scheduling problem,1|pij|Cmax⁡, which can be transformed into the shortest circle problem in a Hamilton graph. The Hungarian algorithm was applied to obtain the optimal solution to the assignment problem. The broken circle and connection method was applied to find a satisfactory order of wagons’ placing-in and taking-out. We estimated the computational complexity of the algorithm to be o(n2).We extended the model to other operation patterns: placing-in and transferring combined, taking-out and transferring combined, placing-in and taking-out combined, and placing-in, transferring, and taking-out combined. All these were regarded as the shortest circle problems in a Hamilton graph with visiting priority and could be solved with the extended algorithm provided.Many experiments also proved that the model and algorithm were feasible on condition that other layouts (radial and mixed goods operation sites) had been converted into branch-shaped form.The research also provides a new method for solving the problem of the shortest circle in a Hamilton graph. We gained a satisfactory solution with the designed algorithm.



---

*Source: 493809-2014-07-23.xml*