Algoritmo Antec Inter 4
Algoritmo Antec Inter 4
Abstract: Route generation task in a public transit network is a complex combinatorial problem
which cannot be manually solved. This paper presents a computer algorithm for the solution
of this problem. The presented algorithm has a novel initialization procedure. The algorithm is
implemented and tested on Mandl’s Swiss Road network [Mandl, 1979]. Extensive test runs of
the proposed algorithm on this network show that the proposed algorithm has better average
travel times in all cases except one and offers up to 23% cost savings compared to the most
recent work [Fan and Mumford, 2010].
1. INTRODUCTION and Mumford, 2010]. In the previous work, the initial route
set is generated either randomly (under some constraints)
Efficient public transportation service is indispensable for or under the guidance of the shortest paths of the net-
the survival of the modern societies. The quality of this work. However, both of these strategies do not consider
service has a direct impact on economy, education, health, the usage statistics of the edges, which can provide ex-
environment and all aspects of the social life [Desaulniers cellent guidance for the construction of initial solution.
and Hickman, 2007]. Main stake holders of public trans- This paper presents a meteheuristic algorithm that uses
portation systems are the passengers, operators and lo- this property to construct an efficient initial route set.
cal authorities. The efficiency of a public transportation The proposed algorithm also uses an improved solution-
service can be measured by its cost, demand coverage modification procedure which prevents being stuck in a
capacity and transfer time. However, the stake holders local optimum. The proposed algorithm is implemented
evaluate the efficiency of the service from their point of and tested on Mandl’s network, [Mandl, 1979]. The results
view. For example, for a passenger this means low ticket obtained by extensive runs are compared with the most
prices and short transfer times, while for an operator it recent work in the literature [Fan and Mumford, 2010]. The
means low operating costs and high profits. To balance rest of the paper is organized as follows: The second section
these contradictory demands, local authorities need the describes the route generation problem. The third section
support of efficient computational tools in their decision explains the proposed algorithm. The fourth section shows
making processes. the results, and the last section presents conclusions.
A public transportation network is a complex network
which contains many nodes and links. Efficient route gen-
eration on such a network requires a complex combinato- 2. PROBLEM DEFINITION
rial search, which cannot be solved by using exact mathe-
matical procedures in a practically useful time. Recent pre- A public transportation network can be modeled by using
vious work use heuristic and metahueristic methods [Baaj an undirected graph. Figure 1 shows an example of such
and Mahmassani, 1995]-[Fan and Mumford, 2010]. Meta- a graph, which consists of five nodes and six edges. This
heuristic methods generate better solutions the heuristic graph can be expressed as G = (V, E), where V is the
methods but they are more complicated and abstract than set of vertexes v1 , v2 , v3 , v4 , v5 and E is the set of edges
them. Metaheuristic algorithms use low level local search e(1, 4), e(1, 2), (2, 3), e(3, 4), e(3, 5), e(4, 5). Each vertex vi
algorithms but often the search algorithm has little impact in V represents a stop or another type of demand node
on the quality of the solution. The efficiency of these meth- and each edge e(i, j) in set E represents a weighted
ods, in the context of transit network route generation edge between stops i and j. A weight may represent the
task, briefly depends on three factors as stated in [Fan and distance or the travel time between nodes or it may be
Mumford, 2010]: (1) Representation (2) The quality of the a function of these parameters. In Figure 1, each edge
initial solution set. (3) Suitable modification procedures is associated with a positive integer weight. The travel
in order to explore a solution space. The representation demands on a transportation network are expressed by
methodology is chosen based on the algorithm. For exam- using a matrix called demand matrix, D. Each (i, j)th
ple, methods that use Genetic Algorithm encodes routes element of D represents the number of passengers traveling
as a binary string [Pattnaik et al., 1998], [Tom and Mohan, from node i to node j. Though the transportation demands
2003], [Agrawal and Mathew, 2004]. However, a simple are dynamic by nature, the elements of D are calculated
node representation is also quite popular [Chakroborty for a specific period within a day. A demand matrix for
and Dwivedi, 2002], [Mauttone and Urquhart, 2009], [Fan the example given in Figure 1 is given as
X
N X
N X
O1 = A P Hij + B W Hij + C EHr (1)
i,j=1 i,j=1 r in R
163
IFAC ACATTA 2013
September 16-17, 2013. Istanbul, Turkey
Algorithm 2 Initialize operation adds a node to one of the ends of the route
and extends it. Delete node operation removes a node
Require: (in G, D, NumRot, MinNode, MaxNode, out
from one of the ends of the route and shortens it. Both
SolutionList)
operations are commonly used in the literature. Insert
SP List ← Find all shortest paths in the graph
node procedure is inspired by the pair insertion algorithm
2: T otDemand ← Calculate total demand
presented [Mauttone and Urquhart, 2009] which inserts a
EdgeU sage ← Calculate edge usage rates
pair of nodes in a route. This operation randomly picks a
4: U sageP rob ← Compute probability distribution based
node which does not exist in the route and adds this node
on EdgeU sage and edge length
to the route if it produces a better score. Algorithm 3 gives
while i 6= N umRot do
the details of the insert node procedure. Node insertion is
6: N ewRoute ← Pick a random edge using
a fast way of covering all nodes and but it may overextend
U sageP rob distribution.
the route, when this occurs the procedure uses delete
N odeN umber ← A random value between MixN-
operation to shorten the route. This procedure works
ode and MaxNode
faster than the pair insertion procedure because it contains
8: while j 6=NodeNumber do
less overhead. A last comment on this routine is that it
N ewRoute ← ExtendRoute(N ewRoute)
may significantly modify the route, which is good since it
10: end while
reduces the risk of getting stuck in a local optimum.
SolutionList ← N ewRoute
12: end while
3.3 Hill Climbing Procedure
presented in Section 2. Solution Modification procedure
modifies CSS. IsProper procedure tests if the modified CSS HC algorithm is a local search algorithm which checks for
satisfies the crucial constraints explained in Section 2, if a better solution by iteratively changing a single element
this test is passed modified CSS is assigned as new solution of a solution [Russell and Norvig, 2003]. This modified
set, NSS, and the score, sn for NSS is calculated also using solution is called the neighbor of the current solution. If
O2. A five minutes penalty is added for each transfer for the neighbor solution is better than the current solution it
both score computations. Hill Climbing (HC) procedure replaces the current solution, otherwise another neighbor
picks the solution that has better score and assigns as CSS. is checked.
The while loop is repeated till the TargetScore is reached.
4. RESULTS
3.1 Initialize Procedure
The proposed algorithm is implemented using C# and
Proposed algorithm generates an initial route set based on tested on Mandl’s Swiss Road network [Mandl, 1979]. This
the edge usage statistics. To the best of our knowledge, this network has 15 nodes and 20 edges and total demand for
method has not been used in the literature. Algorithm 2 the network is 15.720. Though this network is a fairly small
presents the Initialize procedure. The statistics is obtained network, it is preferred to test the proposed algorithm,
by computing all the shortest paths in the graph then since most of the previous work are also tested on this
calculating a edge usage score based on the total traffic network. We performed 10.000 runs on a PC that has
passing over a single edge. Each edge score is weighted Intel Core i5-2540M (2,60 GHz, 3 MB L3 ) chip with 4
by the inverse length of the edge and normalized. The GB memory. We generate solution sets that contain 4,
normalized value is set as the discrete probability for the 6, 7, and 8 routes and compared our best results with
edge. ExtendRoute() function extends the route by adding Fan and Mumford’s best results presented in [Fan and
a new edge at the beginning or the at the end of the Mumford, 2010]. For fair comparison, the terms of the
route. The edge with the highest usage statistics among objective function are weighted equally and a 5 minutes
the candidate edges is selected as the new edge. penalty is added for each transfer as done in [Fan and
For each edge, this procedure considers the demand on Mumford, 2010]. Table 1 presents the comparison results.
both directions, which can be important in making the In this table, for each solution set, the transfer rows show
decision whether to include a given edge in the route con- the percentages of the satisfied demand for 0, 1 and 2
struction. This can be observed from the D matrix given transfers, respectively; the ATT row shows the average
in Section 2. For example, in this matrix the demands travel time for a passenger in terms of minutes; and the
between nodes 4 and 5 in two directions are given as Algorithm 3 InsertVertex
d(4, 5) = 7 and d(5, 4) = 56, any algorithm that observes
only the demand from node 4 to 5 is very likely to discard Require: (in CurrentRoute, out ModifiedRoute)
this edge even though the demand on the reverse direction M odif iedRoute ← CurrentRoute
2: u ← A random node, n, such that n 6∈ CurrentRoute
is quite large. The proposed procedure does not fall in this
trap by computing the usage of the edges by adding the for all node ∈ CurrentRoute do
demands in both directions. 4: N ewRoute ← insert u after node
if cost(N ewRoute) < cost(M odif iedRoute) then
3.2 Solution Modification Procedure 6: M odif iedRoute ← N ewRoute
end if
8: end for
Solution Modification Procedure chooses a random route
from the solution set and then again randomly applies one while |M odif iedRoute| > M axN ode do
of three modification operations. These operations are add 10: r′ ← Delete(ModifiedRoute)
node, delete node and insert node operations. Add node end while
164
IFAC ACATTA 2013
September 16-17, 2013. Istanbul, Turkey
Table 2. Routes in The Solution Sets the results of the test runs. The results show that the first
set of weights improves the transfer rate and ATT, but
Route Solution
Number List
significantly increases the total cost as expected, and the
second set of weights significantly worsens the transfer rate
4 12,10,9,7,5,2,1,0
and total cost but slightly improves ATT. The results for
1,4,3,5,7,9,10,11
9,6,14,5,2,1,3,4 the second set of weights are worse than the results for the
10,12,13,9,7,14,8 first set. This shows the necessity for a different objective
6 12,10,9,7,5,2,1,0
function. An objective function that aims more strongly on
12,13,9,7,5,3,11 decreasing transfer rates is more likely to generate better
6,14,7,5,2,1,4 results for the proposed algorithm.
8,14,5,3,11,10,12,13
11,10,9,7,5,3,1,2
12,10,9,6,14,5,3,4
5. CONCLUSION
7 0,1,3,5,7,9,10,11
12,13,9,10 This paper presented a route generation algorithm for
7,14,6,9,13,12,10,11 transit network design problem. The proposed algorithm
9,6,14,5,2,1,3,11 is tested on Mandl’s Swiss Road network to present the
8,14,6,9,7,5,2,1 effectiveness of our algorithm compared to the previous
12,10,9,7,5,2,1,0 work. We expect superior results in a larger network.
10,9,7,5,3,4,1,0 One advantage of the proposed algorithm is that the
8 13,12,10,9,6,14,8 solution set heavily depends on the most used roads in the
10,9,6 network. This information can help the decision makers
4,3,1,2,5,14,8 in planing tasks such as maintenance of the roads or the
10,9,6,14,5,3
control of the traffic in high demand links. The presented
12,10,9,7,5,3,11
13,9,6,14,7,5,2,1
initial route generation procedure generates efficient and
12,9,7,5,2,1,0 high quality solution set. The proposed algorithm can
6,9,7,5,3,4,1,0 give better results with different local search algorithms
such as simulated annealing and tabu search algorithms.
cost row shows the total cost of solution set in terms of Also, the procedures in the proposed algorithm can be
kilometres. The proposed algorithm has better ATT for 4, used to develop a Genetic Algorithm based version. The
6, and 7 route cases and offers up to 23% reduction in cost modification of the objective function used to evaluate our
while the 0 transfer percentages for both algorithms differ solutions may also improve results. Our future work will
in the range 0.58% to 1.42%. Table 2 presents routes sets focus on these issues.
generated by the proposed algorithm. Each route in the
table is shown as a sequence of nodes. For example, for the REFERENCES
8 route case, the first route in the solution starts with the
node 13 and stops at the node 8. To observe the effects of J. Agrawal and T.V. Mathew. Transit route network
changing weights of the terms in the objective function, we design using parallel genetic algorithm. Journal of
performed test runs for two extreme cases, where weights Computing in Civil Engineering, 18(3):248–256, 2004.
are set as A = 0, B = 1 and A = 1, B = 0. Table 3 presents cited By (since 1996)26.
165
IFAC ACATTA 2013
September 16-17, 2013. Istanbul, Turkey
166