Available online at www.sciencedirect.com
ScienceDirect This Procedia space isComputer reserved for 108C the Procedia header, Science (2017) 2338–2342 This space is reserved for the Procedia header, This space is reserved for the Procedia header, This space is reserved for the Procedia header,
do do do do
not not not not
use use use use
it it it it
International Conference on Computational Science, ICCS 2017, 12-14 June 2017, Zurich, Switzerland
Path Planning for Groups on Graphs Path Planning for Groups on Graphs Path Planning for Groups 1 1,2 on Graphs JakubPath Szkandera , Ivana Kolingerov´ a , and Maˇ n´ak2 Planning for Groups on Martin Graphs Jakub Szkandera11 , Ivana Kolingerov´a1,2 n´ak22 1,2 , and Martin Maˇ
New New New New
Jakub Szkandera a1,2 ,Faculty and Martin Maˇ n´ak2 Department of Computer Science Kolingerov´ and Engineering, of Applied Sciences, 1 , Ivana Jakub Szkandera , Ivana Kolingerov´ ,Faculty and Martin Maˇ n´ak University of Bohemia, Univerzitni 8, CZa 30614 Plzen, Republic. Department of West Computer Science and Engineering, of Czech Applied Sciences, Department of Computer Science and Engineering, Faculty of Applied Sciences,
[email protected],
[email protected] University of West Bohemia, Univerzitni 8, CZ 30614 Plzen, Czech Republic. Department of West Computer Science and Engineering, Faculty of Applied Sciences, Universityfor of Bohemia, Univerzitni 8, CZ 30614 Plzen, Republic. Technologies the Information Society, Univerzitni 8, CZ 30614Czech Plzen, Czech Republic.
[email protected],
[email protected] University of West Bohemia,
[email protected] 8, CZ 30614 Plzen, Czech Republic.
[email protected], Technologies for the
[email protected] Society, Univerzitni 8, CZ 30614 Plzen, Czech Republic.
[email protected],
[email protected] Technologies for the
[email protected] Society, Univerzitni 8, CZ 30614 Plzen, Czech Republic. Technologies for the
[email protected] Society, Univerzitni 8, CZ 30614 Plzen, Czech Republic.
[email protected]
Abstract This paper introduces a new method of planning paths for crowds, applicable to environments Abstract Abstract described a graph. The main idea is group members the crowd by theirtocommon initial This paperbyintroduces a new method ofto planning paths forofcrowds, applicable environments Abstract This paperby introduces a new method ofpath planning paths forofcrowds, applicable tocommon environments and target positions and then plan the for one member of each group. If the crowd can be described a graph. The main idea is to group members the crowd by their initial This paperbyintroduces a new method ofto planning paths forofcrowds, applicable tocommon environments described afew graph. The main idea is group members the crowd by their initial divided into a groups this way, the proposed approach save a huge amount of computational and target positions and then plan the path for one member of each group. If the crowd can be described by a graph.and The main idea to group members of of theeach crowd by their common initial and target positions then plan theisproposed path for one member group. If the crowd can be and memory demands in dynamic environments. divided into a few groups this way, the approach save a huge amount of computational and target positions and then plan the the proposed path for one member of aeach group. If the crowd can be divided into a few groups this way, approach save huge amount of computational and memory in Agent dynamic environments. divided into ademands few groups way, the proposed approach save a huge amount of computational Keywords: Path planning, based model, Graph representation © 2017 The Authors. Published by Elsevier B.V. and memory demands in this dynamic environments. Peer-review under responsibility of the based scientific committee of the International Conference on Computational Science and memory demands in Agent dynamic environments. Keywords: Path planning, model, Graph representation Keywords: Path planning, Agent based model, Graph representation Keywords: Path planning, Agent based model, Graph representation
1 Introduction 1 Introduction 1 Introduction In agent-based models, crowds simulation has high memory demands because each agent re1 Introduction quires its own evaluation of the environment. Reduction is possible usingbecause an algorithm for static In agent-based models, crowds simulation has high memory demands each agent re-
In agent-based models, crowds simulation has high memory demands agent graphs, which needs one representation ofisthe environment soeach it saves a relot quires itse.g., own[2], evaluation of theonly environment. Reduction possible usingbecause anand algorithm for static In agent-based models, crowds simulation has high memory demands because each agent requires its own evaluation of the environment. Reduction is possible using an algorithm for static but it has to recompute all paths in case of a change in environment. Another possibility graphs, e.g., [2], which needs only one representation of the environment and so it saves a lot quires itse.g., own[2], evaluation of theonly environment. Reductionofisthe possible using anand algorithm for static graphs, whichfor needs one representation environment so it part saves a the lot is to use an algorithm dynamic graphs, e.g., [5]. It recomputes only the changed of but it has to recompute all paths in case of a change in the environment. Another possibility graphs, e.g., [2], which needs only in one representation of the environment and so it saves a lot but it has to recompute all paths case of a change in the environment. Another possibility path but does not handle a real-time simulation. is toituse forall dynamic graphs, [5]. It recomputes only the changed of the but hasan toalgorithm recompute paths in case ofe.g., a change in the environment. Another part possibility is toThe use an algorithm for dynamic graphs, e.g., [5]. Itand recomputes only the changed part of the proposed solution can reduce high memory computational demands. The idea is path but does not handle a real-time simulation. is to use an algorithm for dynamic graphs, e.g., [5]. It recomputes only the changed part of the path but does not handle a real-time simulation. to utilize path similarities between agents. The proposed solution can reduce high memory and computational demands. The idea is path butproposed does not solution handle acan real-time simulation. The reduce high memory and computational demands. The idea is to utilize path similarities between agents. The proposed solution between can reduce high memory and computational demands. The idea is to utilize path similarities agents. to utilize path similarities between agents. 2 Related Work
2 Related Work 2 Related Approaches for theWork simulation and planning paths of crowds are either continuum or agent2 Related Work based models. continuum and pathplanning planningpaths model suitable dense crowds where the Approaches for The the simulation of is crowds are for either continuum or agent-
Approaches the simulation paths crowds either ordensity agentmovement is for similar to the fluidand flowplanning [1]. Hughes [3] of describes aare crowd as continuum a continuous based models. The continuum path planning model is suitable for dense crowds where the Approaches for the simulation and planning paths of crowds are either continuum or agentbased models. The continuum path planning model is suitable for dense crowds where the field and introduces an evolving dynamic potential function. The sophisticated continuum movement is similar to the fluid flow [1]. Hughes [3] describes a crowd as a continuous density based models. The to continuum path planning model is suitable for dense crowds where the movement is similar the fluid flow [1]. Hughes [3] describes a crowd as a continuous density model [4] introduces naturally solves inherent collisions and [3] produces smooth of thecontinuum agents in field and anthe evolving dynamic potential function. Themovement sophisticated movement is similar to fluid flow [1]. Hughes describes a crowd as a continuous density field and introduces an The evolving dynamic potential function. Themovement sophisticated continuum a complex environment. continuum model disadvantage is that individual requirements of model [4] naturally solves inherent collisions and produces smooth of the agents in field and an evolving dynamic potential function. Themovement sophisticated model [4] introduces naturally solves inherent collisions and produces smooth of thecontinuum agents in crowd members are neglected. a complex environment. The continuum model disadvantage is that individual requirements of model [4] naturally solvesThe inherent collisions and produces smooth the agents in a complex environment. continuum model disadvantage is that movement individual of requirements of crowd members are neglected. a complex environment. The continuum model disadvantage is that individual requirements of crowd members are neglected. 1 crowd members are neglected. 1 1877-0509 © 2017 The Authors. Published by Elsevier B.V. 1 Peer-review under responsibility of the scientific committee of the International Conference on Computational Science 1 10.1016/j.procs.2017.05.040
Path Planning for Groups onJakub Graphs Szkandera, Kolingerov´ a, and Maˇ n´ ak Szkandera et al. / Procedia Computer Science 108C (2017) 2338–2342
The agent-based model is more natural for human beings as a path is planned for each agent separately. The individual requirements of the agents are respected. On the other hand, with an increasing number of agents, there are high computational and memory demands. Agent-based methods are local and global. Most of the local methods are focused on collision detections between agents and obstacles or between agents themselves [8]. Agent-based path planning algorithms often use the graph representation of the environment. In the case of a static environment, the A* algorithm [2], which uses a heuristics to choose the next vertices for processing, can be used. The D* algorithm [9] and its improvement D* Focused [10] are also applicable to dynamic graphs, where weights of vertices and edges may change over time. The backwards algorithm LPA* [6] - slightly worse than D* Focused - is the basis of the D* Lite [5], which may yield even better results than D* Focused. Anytime D* [7] belongs to the class of sub-optimal path planning algorithms.
3
Proposed Solution
The proposed path planning approach is suitable for many agents in an environment represented by an undirected graph. Let P = {p1 , p2 , . . . , pc } be a set of agents. Each pi ∈ P needs to individually rate vertices of an undirected graph. The graph represents the dynamic environment which can be interpreted as a set of pairs D = {(d1 , t1 ), (d2 , t2 ), . . . , (dr , tr )}, where di is a graph change and ti is a simulation time. Each vertex of the graph describes a point in R2 . Moreover, every agent pi has a starting vertex s(pi ) ∈ R2 and a destination vertex e(pi ) ∈ R2 .
3.1
Path Planning for Groups
Let g ⊆ P be a group of agents. The group has a leader pm ∈ g, the main agent that will be followed by others. Figure 1 illustrates the idea. First, the path between s(pm ) and e(pm ) for the leader pm is computed by any standard algorithm for path planning. After that, the path for each agent pi ∈ g \ {pm } is computed: First from s(pi ) to s(pm ), then the part of the path from s(pm ) to e(pm ) is reused, and finally the part from e(pm ) to e(pi ) is computed. The path may require further optimizations, which will be discussed next.
Figure 1: The idea of path planning for a group of agents. The agent pi can find the path of the leading agent pm (Figure 2a) before pi reaches s(pm ). The path of the agent pi will be longer because pi would have to visit s(pm ) and return back to the position where the path of pm was discovered. When the agent pi reaches the path of the leader pm , the path planning to the start position s(pm ) is stopped and the essential part of the path of the leader pm is used instead (Figure 2b) to handle that situation. Once the agent pi reaches the destination position e(pm ), path planning algorithm from the position e(pm ) to e(pi ) should be started. However, Figure 2c illustrates that a situation similar to Figure 2a may happen. The change of the path planning direction transforms this problem to the already solved problem (Figure 2b). 2
2339
2340
Path Planning for Groups onJakub Graphs Szkandera, Kolingerov´ a, and Maˇ n´ ak Szkandera et al. / Procedia Computer Science 108C (2017) 2338–2342
(a)
(b)
(c)
Figure 2: Group path planning problems and solutions (a) Problem near the start position, (b) Solution for the start position (c) Problem near the destination
3.2
Creating Groups
The groups of agents are created so that all agents in a group have similar starting positions and similar destinations. Let us have a list P of agents and a grouping parameter τ (threshold) as the input, the output is a set Gr = {g1 , g2 , . . . , gq } of non-empty distinct groups of agents. The algorithm also needs a path planning strategy implementing some of the classic path planning algorithms, e.g., A*, D* or D* Lite. The algorithm iterates over all agents and tries to insert them into already existing groups. For simplicity, the main agent pm for each group is the first agent having been added to the group. The positions s(pi ) and e(pi ) of each agent pi are compared with s(pm ) and e(pm ) for pm ∈ gj . If both distances are less than some τ2 , pi is added to gj and the cycle over groups is terminated. If the agent pi is not added to any existing group, a new group is created for the agent and added to Gr. The algorithm is output-sensitive and its worst-case time complexity is O(|P ||Gr|) or O(|P |2 ) if each group contains only one agent. In the rest of this section we will discuss two strategies for choosing this parameter. Using the same constant τ for all agents might produce bad results. For example, if τ = 200m and the path of the leader pm ∈ gj is 50m long, the path of the agent pi ∈ gj will have its length somewhere between 50m and 250m. Obviously the path of pi ∈ gj might be even 5 times longer than the minimal one which is not desirable. To fix this shortcoming, we use a dynamic τ specific to each group, approximating the maximal allowed error of the path length of the main agent. For example if τ = 10%, the final path is allowed to be approximately 1.1-times longer than the path of the main agent.
4
Experiments and Results
The proposed method was tested on the Open Street Map data ,the agents (pedestrians) were generated in random positions. The relative error dependency on the common path was tested on artificial data. The solution was implemented in C++ and all experiments were performed on CPU Intel Core i7-950 (8MB Cache, 3.07GHz) and 12GB 668MHz RAM. The experiments compare the computational time and the path correctness. The space highly depends on the chosen path planning method. The dynamic algorithms in comparison with static may save up to O(kn) space, where k is the number of the similar paths and n is the number of vertices.
4.1
Computational Time
Figure 3a shows the computational time of the A* algorithm and the A* with the proposed solution for the cases where |Gr| = |P |, |Gr| = |P2 | and |Gr| = 1. The proposed method is 3
Path Planning for Groups onJakub Graphs Szkandera, Kolingerov´ a, and Maˇ n´ ak Szkandera et al. / Procedia Computer Science 108C (2017) 2338–2342
completely inappropriate for the case |Gr| = |P | where the agents do not create the common groups at all and path of each agent has to computed independently (the top curve in Figure 3a). The computational time of the second case |Gr| = |P2 | is lower than that of the single A* algorithm. The computational time of the proposed method and the standard path planning algorithm is similar when 35-40% of agents belong to the group gi with another agent. The case with |Gr| = 1 is the fastest, as was expected, because all agents belong to the same group.
(a)
(b)
Figure 3: (a) Computational time of single A* and A* with groups approach, (b) Computational time of A* alone versus our approach for different values of the grouping parameter τ Figure 3b shows how the computational time of A* algorithm with the proposed method changes with different allowed relative error bound τ . When τ is set to 10% of the leader agent path, 74524 groups are created from 100k of agents. The 20% allowed error bound produced 59478 groups, 30% 48624 groups, 40% 41471 groups and 50% 32678 groups. Obviously the growing relative error bound produces a smaller number of the groups, because the groups have greater radius. With the growing bound the computational time decreases up to the milestone relative error δm . The 35% bound is the milestone relative error δm where the paths to and from the centre of the group start to be longer than the common path. Therefore, the proposed solution starts to slow down when δm is reached. The better agents data (a lot of intended groups) provides higher δm . Although Figure 3b shows that with less groups the path computation is faster, it is not always true. The proposed solution is faster until the milestone relative error δm is reached. When the value δm is crossed, the approach starts to slow down, because the paths to and from the centre of the group start to be longer than the common path.
4.2
Path Correctness
The path correctness shows the difference between the minimal path and the path found by the proposed solution. The correctness is measured by a relative error δ, computed as the difference between the length of the path found with the proposed solution and the minimal path, all divided by the minimal path length. Note that δ ≥ 0. Table 1 contains the number of groups and the minimal, average and maximal relative error for the allowed relative error. The minimal error is the smallest one higher than zero. The average and maximal relative error grow with the decreasing number of groups. Although the maximal relative error grows over the allowed boundary from the value 0.08, the overall average relative error is smaller than a half of the allowed threshold τ . Depending on the data two extreme cases may occur. In the first case every agent starts and ends at the same positions and the approach saves a huge amount of the computational 4
2341
2342
Path Planning for Groups onJakub Graphs Szkandera, Kolingerov´ a, and Maˇ n´ ak Szkandera et al. / Procedia Computer Science 108C (2017) 2338–2342
τ [%] 2 4 6 8 10
Relative error per cent Min Mean Max Groups 0.913 0.913 0.913 99500 0.913 1.634 2.694 99000 0.470 2.104 3.822 98300 0.248 2.837 9.092 96800 0.248 4.352 13.193 94500
τ [%] 12 14 16 18 20
Relative error per cent Min Mean Max Groups 0.470 4.934 17.916 92100 0.413 5.602 24.534 89900 0.161 7.192 24.534 86600 0.261 7.779 26.667 82100 0.044 8.924 41.353 78200
Table 1: The path inaccuracy with the proposed solution for increasing τ time and space. The second case is the worst possible situation, where none agent has a similar path with another agent. This kind of data is unsuitable for the proposed solution because the group computation would even slow down the computation.
5
Conclusion
In this paper we introduced a global path planning approach for many agents in an graphrepresented environment. The proposed approach saves a substantial part of the path planning computation at a price of suboptimality. Experiments acknowledged suitability for agents sharing 35 per cent and more of the paths.
Acknowledgement This work was supported by the Ministry of Education, Youth and Sports of the Czech Republic, the project SGS-2016-013 Advanced Graphical and Computing Systems.
References [1] C. J. Darken and R. G. Burgess. Realistic human path planning using fluid simulation. 2004. [2] P. E. Hart, N. J. Nilsson, and B. Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE transactions on Systems Science and Cybernetics, 4(2):100–107, 1968. [3] R. L. Hughes. The flow of human crowds. Annual review of fluid mechanics, 35(1):169–182, 2003. [4] H. Jiang, W. Xu, T. Mao, C. Li, S. Xia, and Z. Wang. Continuum crowd simulation in complex environments. Computers & Graphics, 34(5):537–544, 2010. [5] S. Koenig and M. Likhachev. D* lite. In AAAI/IAAI, pages 476–483, 2002. [6] S. Koenig, M. Likhachev, and D. Furcy. Lifelong planning A. Artificial Intelligence, 155(1):93–146, 2004. [7] M. Likhachev, D. I. Ferguson, G. J. Gordon, A. Stentz, and S. Thrun. Anytime dynamic A*: An anytime, replanning algorithm. In ICAPS, pages 262–271, 2005. [8] R. A. Metoyer and J. K. Hodgins. Reactive pedestrian path following from examples. The Visual Computer, 20(10):635–649, 2004. [9] A. Stentz. Optimal and efficient path planning for partially-known environments. In Proceedings of the 1994 IEEE International Conference on Robotics and Automation, pages 3310–3317, 1994. [10] A. Stentz. The focussed D* algorithm for real-time replanning. In IJCAI, volume 95, pages 1652–1659, 1995.
5