<!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>
      <journal-title-group>
        <journal-title>Workshop on Artificial Intelligence and Formal Verification, Logic, Automata, and Synthesis,
September</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Planning with Global State Constraints for Urban Traffic Control</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Franc Ivankovic</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Roveri</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Information Engineering and Computer Science - University of Trento</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2021</year>
      </pub-date>
      <volume>22</volume>
      <issue>2021</issue>
      <fpage>0000</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>Planning with global state constraints is an extension of classical planning in which some properties of each state are derived via a set of constraints. This approach allows us to apply planning techniques in domains involving interconnected physical systems. The crucial feature of such domains is that a single discrete action affects the state of the entire system in a way that is dependent on the global state. Urban Traffic Control refers to coordinating traffic signals over an area in order to reduce congestion and delays. Here we show how this domain can be modelled as a planning problem with global state constraints.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Urban traffic control</kwd>
        <kwd>Automated planning</kwd>
        <kwd>Global state constraints</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction and related work</title>
      <p>
        Urban Trafcfi Control (UTC) is the problem of managing and coordinating trafcfi signals over
an area in order to optimise trafcfi flows in a road network [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The UTC problem has been
traditionally approached either with complex mathematical models or with simple model of traffic
(see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for details). More recently, have been discussed approaches to solve UTC problems
leveraging on state-of-the-art planning and scheduling techniques. The work [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] provides a
detailed survey of the approaches of planning and scheduling for UTC. In [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ] it has been
discussed an approach based on PDDL+ [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]: continuous processes are used to control flows of
cars; and traffic light green phases are the control variables to be modified by actions to achieve
the goal of reducing congestions in specific roads. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] provides a pure PDDL [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] encoding where
each road is associated a discrete density level. Actions operate on the trafcfi lights to enable
lfows and change density levels.
      </p>
      <p>
        Planning with Global State Constraints (GSC) [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ] is an extension of classical planning
in which some properties of states are determined by a set of constraints common to all states.
This formalism is well suited for applying classical planning methods on domains that involve
a network of interconnected physical systems [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] controlled by discrete controllable variables
(noticeable examples are power networks). The crucial feature of such domains is that a single
discrete action (to change controllable variables), such as opening or closing a switch somewhere,
affects the entire network in a way that is dependent on the global state of the system.
      </p>
      <p>We make the following contributions. First, we observe several similarities between the power
network re-configurations problems and the UTC problem: actions like closing/opening of a road,
changing the duration of green light, or redirecting traffic, can potentially affect traffic flow rates
throughout the city in a complex way similarly to corresponding operations in a power network.
Second, we provide an encoding of the UTC problem into the framework of planning with GSC.
Third, we witness the feasibility of the approach by a preliminary experimentation on a small
UTC scenario.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Background</title>
      <p>
        Planning with global state constraints [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] allows us to model some properties of states as derived
from so called constraints. These can take a variety of forms depending on the modeled system,
e.g., logical axioms [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] or a system of equations and inequalities [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] This has been shown to
be well suited for domains that involve interconnected physical systems, such as power grids.
These domains are such that each discrete action can change the state of the whole network in a
way that depends on the entire current configuration (e.g., opening/closing a switch may change
power flow in all lines).
      </p>
      <p>
        Here we will briefly present a (somewhat simplified) formulation of planning with GSC. The
framework distinguishes primary variables that the planner has direct control over (such as
states of the switches) and secondary variables whose value is computed by so called switched
constraints. The former behave like in classical planning – their domains are finite and discrete,
their values are assigned in the initial state and they persist unless modified by action effects.
Secondary variables can be of any type (in this instance, they are real numbers), and their values
are recomputed in each state. Switched constraints have the form  →  where  is assignment to
a subset of the primary variables, and  is an expression over secondary variables. The assignment
to primary variables determines whether a switched constraint is active in a given state. For a state
to be valid, an assignment to secondary variables must exist such that the set of all  -parts of all
active switched constraints is satisfiable. A plan can only pass through valid states. Consequently,
to be able to apply an action in state  i. its preconditions must be satisfiable in  and ii. the
resulting state must be valid. For a thorough discussion of the framework refer to [
        <xref ref-type="bibr" rid="ref7 ref9">7, 9</xref>
        ]. In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
it has been shown how to combine GSCs constraints and state-dependent action costs (SDAC)
and how to incorporate them into pattern database (PDB) heuristics. In this framework the cost
of applying an action can be a function of all primary and secondary variables. For instance, in
the the power network reconfiguration domain SDAC account for the fact that it is preferable to
reduce the unsupplied load (consumers without power) over the total time span.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Traffic model and encoding in Planning with GSC</title>
      <p>We model the traffic network as a directed graph ⟨, ⟩, such that  =  ∪  ∪  and , , 
are pairwise disjoint set of nodes. Nodes  (for origin) being sources; nodes  (for destinations)
being sinks, and nodes  (for switches) being intersections. Each edge  ∈  ⊆  ×  ,
denotes a road (a two way road is modeled with two different edges with opposite directions).
For a node  ∈  we denote with () (resp. ()) the set of incoming (resp. outgoing)
roads.</p>
      <p>Each source generates some number of vehicles that
move towards different sinks. We denote with , ≥ 0
the flow of vehicles on road  with destination  . We
denote with , ≥ 0 the flow of vehicles generated by
source  with the destination .</p>
      <p>For instance, Fig. 1 shows a simple trafcfi network
with three sources (1, 2, 3), one sink (1), three Figure 1: A simple traffic network.
switches with traffic lights ( , , and ), and 8 roads
(1,...,5 and abusing notation 1,2, 3 to refer to the edges between the sources and the
switches).</p>
      <p>The values of traffic flows are determined by three types of constraints: i) capacity constraints
associated with roads and intersections, ii) flow conservation constraints, and iii) constraints
associated with different modes of operation of the intersections.</p>
      <sec id="sec-3-1">
        <title>3.1. Capacity constraints</title>
        <p>Each road  has a capacity  ≥ 0, and the sum  of all flows of vehicles through the road
cannot exceed its capacity, i.e.  = ∑︀∈ , ≤  . The total number  of vehicles
entering the destination  must be equal the number generated at all sources  = ∑︀∈ , .
The total number  of vehicles generated at source  must be equal the sum of the vehicles
generated at  for all the destinations, i.e.  = ∑︀∈ , .</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. Flow conservation constraints</title>
        <p>Every intersection has a set of flow conservation constraints – one for each incoming or one
outgoing road and for each destination. That is, for an outgoing road  at an intersection ℎ, we
have , = ∑︀∈(ℎ) ,, where ,, is the traffic flow moving from the road 
to the road  towards sink . (The constraints for incoming roads have the same form except
the sum is over (ℎ).)</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3. Intersection configurations</title>
        <p>The total flow , between roads  and  is the sum of the flows to all destinations,
, = ∑︀∈ ,, . This number is limited by the product of the total cycle length  ,
the portion ,, of the cycle during which the light between roads  and  is green under
configuration , and the capacity , of the switch. The value of ,, depends on the
configuration of the intersection ℎ which is modelled as a primary variable ℎ, with the domain
(ℎ) = [0 . . . ℎ] (with ℎ ≥ 0). Denoting the primary variable ℎ and the value  ∈ (ℎ)
the switched constraint is ℎ =  → , ≤ ,  ,,. For each of the configurations,
there is one such constraint associated with each pair of roads. (We remark that, that the values
of  and , are the same in all constraints.) When defining the configurations, we need to
make sure that the resulting combination of green/red lights or open/closed roads is compatible
(e.g. if trafcfi cannot flow between</p>
        <p>and  at the same time as between  and , then
, ≤  − , ).</p>
        <p>A complete assignment to the different secondary variables , , , and , , defined
above satisfying the different respective constraints, represents one possible traffic situation of
the traffic network at a given time instant.</p>
      </sec>
      <sec id="sec-3-4">
        <title>3.4. Actions, initial condition, goal and the plan cost</title>
        <p>Actions change the configurations of intersections by assigning values to primary variables. For
each intersections ℎ ∈  and for each  ∈ (ℎ) we have an action switch_Lh_to_k
whose only effect is to enforce ℎ = . Such actions therefore activate/de-activate a subset of the
switched constraints.</p>
        <p>The initial state is an assignment to the primary variables only (that in turn activate respective
switched constraints). The goal in this domain is typically to remove a congestion on a given
road. As such it might have the form of  ≤ , where  is some value of the vehicle flow that we
want to achieve.</p>
        <p>
          If we employ state-dependent action costs, we can also assign additional costs to having
congested roads. The cost of every action becomes  = ∑︀∈ max ( − , 0), where  is
some traffic congestion threshold for road . (This is similar to previous work on applying
planning to UTC [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] that adds penalties for road congestions.)
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Experimental evaluation</title>
      <p>
        In order to show the feasibility of the proposed encoding we encoded the simple traffic network
illustrated in Figure 1 in the specification language of the GSC Planner [
        <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
        ] available from
https://github.com/patrikhaslum/gscplanner, configured to leverage on the Gurobi ® (https://www.
gurobi.com/) optimization solver to deal with the GSC constraints. We run the GSC Planner on a
Linux Laptop equipped with an Intel i5 processor and 16Gb of RAM. The GSC Planner was able
to solve this small instance in less than a second.
      </p>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusions and Future Work</title>
      <p>In this paper we have shown how to encode the UTC problem in the framework of planning with
global constraints. The encoding has been experimented on a simple traffic network witnessing
the feasibility of the approach.</p>
      <p>
        We envision several possible directions for future work. First, we intend to carry out a more
thorough experimental evaluation considering large networks and possibly different encodings.
The previous experience in solving power network domains (that have many similarities with
the UTC problem) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] suggest that the approach may scale up to larger instances. We want also
investigate how to enrich this encoding to integrate additional constraints and state-dependent
action costs [
        <xref ref-type="bibr" rid="ref11 ref9">9, 11</xref>
        ]. Finally, we also intend to carry out a more thorough comparison with the
approaches based on PDDL+ [
        <xref ref-type="bibr" rid="ref1 ref11 ref3">1, 3, 11</xref>
        ].
This work is partially funded by the grant MOSES, Bando interno 2020 Università di Trento
"Covid 19".
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Chrpa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Magazzeni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>McCabe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. L.</given-names>
            <surname>McCluskey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Vallati</surname>
          </string-name>
          ,
          <article-title>Automated planning for urban traffic control: Strategic vehicle routing to respect air quality limitations</article-title>
          ,
          <source>Intelligenza Artificiale</source>
          <volume>10</volume>
          (
          <year>2016</year>
          )
          <fpage>113</fpage>
          -
          <lpage>128</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>I.</given-names>
            <surname>Cenamor</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Chrpa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Jimoh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>McCluskey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Vallati</surname>
          </string-name>
          ,
          <article-title>Planning &amp; scheduling applications in urban traffic management, The UK Planning</article-title>
          and Scheduling Special Interest Group (UK PlanSIG),
          <year>2014</year>
          . http://eprints.hud.ac.uk/id/eprint/22801/.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>T. L.</given-names>
            <surname>McCluskey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Vallati</surname>
          </string-name>
          ,
          <article-title>Embedding automated planning within urban traffic management operations</article-title>
          ,
          <source>in: ICAPS</source>
          <year>2017</year>
          , AAAI Press,
          <year>2017</year>
          , pp.
          <fpage>391</fpage>
          -
          <lpage>399</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M.</given-names>
            <surname>Fox</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Long</surname>
          </string-name>
          ,
          <article-title>Modelling mixed discrete-continuous domains for planning</article-title>
          ,
          <source>J. Artif. Intell. Res</source>
          .
          <volume>27</volume>
          (
          <year>2006</year>
          )
          <fpage>235</fpage>
          -
          <lpage>297</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Pozanco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Fernández</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Borrajo</surname>
          </string-name>
          ,
          <article-title>Urban traffic control assisted by AI planning and relational learning</article-title>
          , in: A. L.
          <string-name>
            <surname>C. Bazzan</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Klügl</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Ossowski</surname>
          </string-name>
          , G. Vizzari (Eds.),
          <source>Agents in Trafcfi and Transportation (ATT</source>
          <year>2016</year>
          ), volume
          <volume>1678</volume>
          <source>of CEUR Workshop Proceedings, CEUR-WS.org</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D. V.</given-names>
            <surname>McDermott</surname>
          </string-name>
          ,
          <article-title>The 1998 AI planning systems competition</article-title>
          ,
          <source>AI Mag</source>
          .
          <volume>21</volume>
          (
          <year>2000</year>
          )
          <fpage>35</fpage>
          -
          <lpage>55</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>F.</given-names>
            <surname>Ivankovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Haslum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Thiébaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Shivashankar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Nau</surname>
          </string-name>
          ,
          <article-title>Optimal planning with global numerical state constraints</article-title>
          ,
          <source>in: ICAPS</source>
          <year>2014</year>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>P.</given-names>
            <surname>Haslum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Ivankovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ramírez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Gordon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Thiébaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Shivashankar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Nau</surname>
          </string-name>
          ,
          <article-title>Extending classical planning with state constraints: Heuristics and search for optimal planning</article-title>
          ,
          <source>J. Artif. Intell. Res</source>
          .
          <volume>62</volume>
          (
          <year>2018</year>
          )
          <fpage>373</fpage>
          -
          <lpage>431</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>F.</given-names>
            <surname>Ivankovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Gordon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Haslum</surname>
          </string-name>
          ,
          <article-title>Planning with global state constraints and statedependent action costs</article-title>
          ,
          <source>in: ICAPS</source>
          <year>2018</year>
          , AAAI Press,
          <year>2019</year>
          , pp.
          <fpage>232</fpage>
          -
          <lpage>236</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Thiébaux</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hoffmann</surname>
          </string-name>
          , B. Nebel, In defense of PDDL axioms,
          <source>Artif. Intell</source>
          .
          <volume>168</volume>
          (
          <year>2005</year>
          )
          <fpage>38</fpage>
          -
          <lpage>69</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Vallati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Scala</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Chrpa</surname>
          </string-name>
          ,
          <article-title>A hybrid automated planning approach for urban realtime routing of connected vehicles</article-title>
          ,
          <source>in: 24th IEEE International Conference on Intelligent Transportation - ITSC2021</source>
          , IEEE,
          <year>2021</year>
          . To appear.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>