<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>The Problem of Scheduling for the Linear Section of a Single-Track Railway with Independent Edges Orientations</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Elena N. Akimova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Damir N. Gainanov</string-name>
          <email>damir@dc.ru</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Oleg A. Golubev</string-name>
          <email>golubev.oa.66@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ilya D. Kolmogortsev</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anton V. Konygin</string-name>
          <email>konygin@dc.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IMM UB RAS</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ural Federal University</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>130</fpage>
      <lpage>136</lpage>
      <abstract>
        <p>The paper is devoted to the problem of scheduling for the linear section of a single-track railway: how to organize the ow in both directions in the most e cient way. In this paper, the authors propose an algorithm for scheduling with independent edges orientations, examine the properties of this algorithm and perform the computational experiments.</p>
      </abstract>
      <kwd-group>
        <kwd>scheduling</kwd>
        <kwd>track capacity graph algorithms</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In this paper, we continue a consideration of the problem of scheduling for the
linear section of a single-track railway started in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The schedule
optimization allows to increase a track capacity of the section using the same physical
resources and to simulate further modi cations of the section.
      </p>
      <p>
        This problem with di erent modi cations is well-known (see [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]). For
example, in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] the simulation of trains on the railway based on the
movingblock system and xed-block system was presented. The previous work was
devoted to the case, when all edges of a graph in every moment have similar
orientations. Now we consider more general situation: edges can be orientated
independently. For this case we get both theoretical results and experimental.
Numeric experiments based on algorithm, which is implemented in C++ using
the MPI+OpenMP hybrid technology.
      </p>
      <p>
        In this work we use notations proposed in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Let the linear section of a
single-track railway be given. Thus, we have a graph with the set of vertices
V = fvi j 1
i
ng
and the set of edges E (standard graph theory notations, see [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]). Furthermore,
we assume that the vertices are indexed in such a way that the edges look like
fvi; vi+1g.
      </p>
      <p>For each station vi we have a positive integer m(vi), being the number of
auxiliary railway tracks at this station. These tracks are the only places where
a train can stop. Each auxiliary track can hold only one train.</p>
      <p>Therefore, if all auxiliary tracks of the station are occupied then a train
cannot stop at this station.</p>
      <p>By l(e) we denote the length of the track corresponding to edge e from E.
Suppose all trains have equal speeds. It should be a nonnegative time interval
between two trains moving in same direction. Also, there is an isolated station
w 2 V such that every train passing this station is obliged to stay at it for
a nonnegative time due to technical reasons (the change of locomotive crew,
train inspection, etc.). Stations v1 and vn are sources and receivers of trains.
Thus, there are two directions of movement: from v1 to vn and from vn to v1
(these directions are denoted by v1 7! vn and vn 7! v1, respectively). We can
assume that each train does not change the direction and does not visit any
vertex twice. For passing each other when moving in di erent directions, one of
the trains waits another one on an auxiliary track.</p>
      <sec id="sec-1-1">
        <title>Problem statement</title>
        <p>Let = (V; E), m : V ! N0 and T | the whole time period. Since adding
new stations without auxiliary tracks, we get the same problem, we can suppose
that, without loss of generality, all edges have the same length 1:
l(fvi; vi+1g) = 1:
Also, we assume that trains pass one edge per the unit of time.</p>
        <p>The section corresponds to a single-track railway. So for every moment of
time trains can move on every edge only in one direction. Thus, if we have R
| a schedule of trains movement on , then we can de ne map sR : T E !
f 1; 1g, where sR(t; e) = 1, if there is a movement with direction v1 7! vn,
and sR(t; e) = 1 otherwise. Let R be a set of schedules such that there exist
partition the whole time interval T onto disjoint half-intervals with similar length</p>
        <p>T = [ik=0[ti; ti + );
where sR(ti; e) = sR(ti + 0; e) for all R 2 R, e 2 E and 0 0 &lt; .</p>
        <p>We need the following sets of schedules of trains movement.
1) Let A consists of all schedules R from R, such that for all t 2 T we have
sR(t; e) = sR(t; e0) for all e; e0 2 E. Thus, for R in A there are no trains moving
in opposite directions | in any moment of time trains move in xed direction
or stop on auxiliary tracks.
2) Let B consists of all schedules R from R with property, that there exist
functions m1 : V ! N0 and m2 : V ! N0 such that m1(vi) + m2(vi) = m(vi)
and, for each station vi, there are m1(vi) auxiliary tracks for the direction v1 7!
vn and m2(vi) auxiliary tracks for the direction vn 7! v1. Thus, we divide all
the auxiliary tracks into two sets for both directions. Now, the trains can use
auxiliary tracks corresponding to their directions and the whole task can be
divided into two independent subtasks for each direction.</p>
        <p>The problem is to construct and implement a scheduling algorithm to send as
much as possible trains for period of time T in both directions (more speci cally
we are interested in the schedule at which the minimum number of trains in both
directions over a speci ed period of time is maximal, this number per time we
call track capacity of the section with given schedule).</p>
        <p>
          Properties of schedules from A and A\B were studied in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. In current paper
our aim is to analyze properties of schedules from B. We show, that with some
additional assumptions, the maximal track capacity for schedules from A \ B
equals to maximal track capacity for schedules from B. In addition, we have
numerical experiments, that con rm our conjecture, that this is true in common
case (without additional assumptions).
2
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Assessment of track capacity</title>
      <p>In this section we suppose, that</p>
      <p>= 0 and there are no isolated stations.</p>
      <p>Proposition 1. The maximal track capacity for schedules from R doesn't exceed
doubled maximal track capacity for schedules from A \ B.</p>
      <p>Proposition 2. Let R is a schedule from B and for every edge of total time,
when the edge is orientated in direction v1 7! vn equals time, when the edge is
orientated in direction vn 7! v1. Then there exist schedule R0 from A \ B such
that track capacity for schedule R0 doesn't exceed track capacity for R.</p>
      <p>The following propositions were obtained earlier.</p>
      <p>
        Proposition 3 ([
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], Theorem 1). Let R is a schedule from A \ B. Then the
track capacity for the section with schedule R doesn't exceed f , where
f =
1
      </p>
      <p>min
4 i</p>
      <p>
        X
i j i+
m(vi):
Proposition 4 ([
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], Corollary). Let R is a schedule from A \ B. Then there
exists schedule R0 from A \ B such that the track capacity of the section with
schedule R equals to track capacity of the section with schedule R0 and for R0 we
can assume
m1(vi) = m2(vi) =
jm1(vi)
m2(vi)j
m(vi) ; for even m(vi);
2
1; for odd m(vi) :
      </p>
      <p>Thus propositions 2, 3 and 4 make possible to determine a maximal track
capacity for schedules from B in case, when for every edge of total time,
when the edge is orientated in direction v1 7! vn equals time, when the edge
is orientated in direction vn 7! v1. In common case, rough estimations can be
obtained from proposition 1.</p>
      <p>We suppose that the following conjectures are correct.</p>
      <p>Conjecture 1. Track capacity for the section with schedule from B doesn't exceed
of track capacity of the section with some schedule from A \ B.
Conjecture 2. Track capacity for the section with schedule from R doesn't exceed
of track capacity of the section with some schedule from A \ B.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Numerical experiments</title>
      <p>Consider a mathematical model of linear section of a single-track railway with 65
stations and 2 of them are isolated with 1 = 80 and 2 = 135 (isolated station
w with described in Introduction).</p>
      <sec id="sec-3-1">
        <title>Algorithm</title>
        <p>For t 2 T
For from 60 to 720 minutes and for arbitrary independent edges orientation
lets nd the maximal track capacity. Below we give verbal description and
pseudocode of the algorithm.</p>
        <p>Pseudocode of the algorithm</p>
        <p>V_{i,t}:= []
V_{1,0}:= m_1(i,t)
V_{n,0}:= m_2(i,t)
for t in T
{
for i in (n..2)
{
if s_r(t, e_{i,i-1}) == -1
{
while m_1(i,t) &gt; 0
{
}</p>
        <p>}
}
while m_1(1, t+1) == 0
{
}
for i in (1..n-1)
{
create newTrain
add newTrain to V_{1, t+1}
if s_r(t, e_{i,i+1}) == 1
{
while m_2(i,t) &gt; 0
{
train &lt;- minNumberTrainOnStation(V_{i,t})
remove train from V_{i,t}
add train to V_{i-1,t+1}
train &lt;- minNumberTrainOnStation(V{i,t})
remove train from V_{i,t}
add train to V_{i+1,t+1}
}</p>
        <p>}
}
while m_2(n, t+1) == 0
{
create newTrain
add newTrain to V_{n, t+1}
}</p>
        <p>}</p>
        <p>
          The algorithm was implemented in C++ (we used standard data structures,
see [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]) using Intel Xeon Phi with o oad mode and MPI[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]). The data was
distributed between nodes of supercomputers and calculated on Intel Xeon Phi.
Each node processes its own prede ned set of time intervals. The communication
between nodes is minimal, therefore we have obtained almost linear speedup.
        </p>
        <p>For our experiments we use jT j = 14400 (equal to 10 days), cluster with 6
nodes. A node con guration one can see in Table 1.</p>
        <p>The algorthim uses class Generator, which produces xed distribution of
movement direction for each edge with given time interval . All these
distributions are processed independently, so we have linear growth of speedup. After
the processing the algorithm chooses the best schedule.</p>
        <p>Tasks for nodes are distributed with MPI in a way that all cores of the
processor are used. Thus we create 24 threads with OpenMP for every node (2
processor with 12 cores per node).</p>
        <p>We using Intel Xeon Phi with o oad mode and create 240 threads with
OpenMP.</p>
        <p>Execution times, speedup and e ciency of the program for di erent con
gurations can be seen from Table 2 and Table 3. Table 2 describes speedup and
e ciency of the program compared with 1 node with 12 threads. In this paper
the speedup is the ratio of the execution time for 1 node with 12 threads to the
value of the Table 2. The e ciency is a ratio of speedup to number of devices
(number of nodes or number of Intel Xeon Phi).
Number of nodes and number of thread per node Times (minutes)
1 node x 12 threads 296
2 node x 12 threads 168
6 node x 12 threads 61
1 node x 1 mic 249
1 node x 2 mic 133
2 node x 1 mic 149
2 node x 2 mic 71
Number of node and number of thread per node speedup e ciency
2 node x 12 threads 1.761 0.88
6 node x 12 threads 4.852 0.8
1 node x 2 mic 1.87 0.93
2 node x 1 mic 1.67 0.83
2 node x 2 mic 3.5 0.82
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>Estimations of track capacity from B were obtained. The software, which
implements the algorithm using MPI and Intel Xeon Phi coprocessor, was created. The
numerical experiments were performed on the supercomputer with Intel Xeon
Phi. Thus we have obtained a numerical con rmation of Conjecture 1. In future
we are going to continue our research and check the correctness of Conjecture 2.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Akimova</surname>
            <given-names>E.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gainanov</surname>
            <given-names>D.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Golubev</surname>
            <given-names>O.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolmogortsev</surname>
            <given-names>I.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Konygin</surname>
            <given-names>A.V.</given-names>
          </string-name>
          :
          <article-title>The Problem of Scheduling for the Linear Section of a Single-Track Railway</article-title>
          . In: ICNAAM (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. KePing L., ZiYou G.,
          <string-name>
            <surname>Bin</surname>
            <given-names>N.</given-names>
          </string-name>
          :
          <article-title>Cellular automaton model for railway tra c</article-title>
          .
          <source>Journal of Computational Physics</source>
          , vol.
          <volume>209</volume>
          (
          <issue>1</issue>
          ),
          <volume>179</volume>
          {
          <fpage>192</fpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Harrod</surname>
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Optimal Scheduling of Mixed Speed Trains on a Single Track Line</article-title>
          , in http://citeseerx.ist.psu.edu/viewdoc/summary?doi
          <source>=10.1.1.85.5597</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Higgins</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kozan</surname>
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ferreira</surname>
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>Optimal Scheduling of Trains on a Single Line Track</article-title>
          .
          <source>In: Transpn. Res.-B.</source>
          , vol.
          <volume>30</volume>
          (
          <issue>2</issue>
          ),
          <volume>147</volume>
          {
          <fpage>161</fpage>
          (
          <year>1996</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Diestel</surname>
            <given-names>R.</given-names>
          </string-name>
          :
          <source>Graph Theory</source>
          . Springer-Verlag, New York (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Cormen</given-names>
            <surname>Th</surname>
          </string-name>
          .,
          <string-name>
            <given-names>Leiserson</given-names>
            <surname>Ch</surname>
          </string-name>
          .,
          <string-name>
            <surname>Rivest</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stein</surname>
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Introduction to Algorithms, third edition</article-title>
          . MIT Press (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Sedgewick</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wayne</surname>
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Algorithms, fourth edition</article-title>
          . Addison-Wesley (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Gropp</surname>
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lusk</surname>
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thakur</surname>
            <given-names>R.</given-names>
          </string-name>
          :
          <article-title>Using MPI-2 Advanced Features of the MessagePassing Interface</article-title>
          . MIT Press (
          <year>1999</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>