Abstract
Currently, state-of-the-art simultaneous localization and mapping methods are capable of generating large-scale and dense environmental maps. One primary reason may be the applications of map partitioning strategies. An efficient map partitioning method will decrease the time complexity of simultaneous localization and mapping algorithm and, more importantly, will make robots understand a place anthropomorphically. In this article, we propose a novel map segmentation algorithm based on quadtree and spectral clustering. The map is first organized hierarchically using quadtree, and then a user-friendly criterion is utilized to construct the corresponding Laplacian matrix for quadtree so that spectral clustering can be solved efficiently based on the sparse property of the matrix. In this article, we go further to provide a real-time, incremental, parallel algorithm that can be implemented on multi-core CPU/GPU to enhance the performance of the proposed basic algorithm. Our algorithms are verified under multiple environments including both simulation and real-world data, and the results reveal that the algorithm can provide a correct and user-friendly segmentation result in a short runtime.
Introduction
Simultaneous localization and mapping (SLAM) is a fundamental ability for robots which operate autonomously in unknown places. Some state-of-the-art SLAM methods are able to construct large-scale 1 or dense environmental maps with a laser range finder,2–4 monocular vision, 5 or an RGB-D sensor.6,7 Successful methods generally adopt a divide-and-conquer strategy 5 which aims to segment the whole map into several submaps to accelerate map construction from a computational perspective. 8
Currently, semantic SLAM is becoming a hot topic. In terms of environmental understanding, it is nature to segment a big environment into several small places with semantic functions. These semantic information helps robots to recognize places, 9 navigate, and interact with people anthropomorphically. 10 As semantic SLAM usually combines semantic and geometry information, 9 automatic map segmentation can add semantic “label” to robots’ working area and identify semantic boundaries of particular places. In this way, robots may act more like humans and be able to extract semantic information kitchen from the given command “Go to kitchen” and navigate to the corresponding segmented kitchen place.
In this article, we provide a novel autonomous map partitioning algorithm based on quadtree and spectral clustering. This algorithm intends to provide robots a human-like recognition which is able to segment indoor rooms from a constructed map. Considering both computational efficiency and recognition rationality, we present a criterion to generate a sparse Laplacian graph for spectral clustering. A corresponding parallel and online incremental map partitioning algorithm is also presented for a multi-core CPU/GPU processor to improve the computational speed.
The rest of the article is organized as follows: After a brief introduction on some related works in section “Related work,” two basic algorithms, quadtree and spectral clustering, are introduced in sections “Constructing a robot map with quaternary tree” and “Map partitioning based on spectral clustering.” The details and improvement of parallel incremental algorithm is discussed in section “Algorithm implementation.” Finally, some simulation and experimental results demonstrating the efficiency of precision of the proposed algorithm are presented.
A brief introduction to our algorithm is shown in Figure 1. The algorithm accepts raw laser data as input and generates segmented quadtree-based map representation. By optimizing the algorithm from many aspects, it can run dynamically when robots explore the world and generate real-time segmentation results.

Diagram of the proposed algorithm.
The symbols used in this article and their meanings are shown in Figure 2.

Symbols and their meanings.
Related work
Most of the map segmentation works focus on the feature-based map representation. Leonard and Feder 1 proposed an early algorithm called decoupled stochastic mapping. This algorithm was designed to balance the time complexity and precision in robot state estimation. And Pinies et al. 11 provide another method called CI-Graph. This method can efficiently solve complex trajectories with low computation and memory cost.
Another way to segment the map is to divide robot workspace into many atomic map units and re-cluster those units. There are many ways to make such segmentation:
Occupancy grid map representation,
Voronoi graph 4 ,
Spatial search tree (quadtree, KD-Tree, Octree).
Most SLAM algorithms use occupancy grid map representation. However, this representation may create too many map units and may lead to some difficulty in the next clustering process. Voronoi graph is an excellent and widely used algorithm. It creates less map units than quadtree and gives a more human-like map representation 4 based on Voronoi graph to divide map into parts. Based on this work, Sjöö 3 provides a method without using topological graph and transformed the map segmentation method into an energy function optimization problem. But the main disadvantage of Voronoi graph is that the scale and position of each unit are irregular. Finding the belonging triangle of a specific point in Delaunay triangle mesh is not as fast as in spatial search tree, which will bring additional time complexity of indexing and clustering operations.
KD-Tree, which is similar to quadtree, utilizes the variance and mean value of the sample to balance the tree. In this way, KD-Tree based algorithms reduces their mean time complexity. When robot tried to update map, the whole tree will be reconstructed because the samples’ median and variance changed. As KD-Tree is a particular kind of balanced binary tree, it has less efficiency in construction and operation. quadtree map does not need to reconstruct the whole tree every time. In most cases, only a small subtree will be reconstructed. Figure 13 presents the performance advantage.
Similar to Voronoi graph, each KD-Tree leaf’s scale is irregular. This brings additional difficulty in algorithm design. So quadtree is a better choice in most cases. But in some extreme situations, for example, if the distribution of obstacles concentrates on a small area, quadtree will degenerate and lose its resolution. And KD-Tree, as it is a balanced binary tree, may have advantage in performance.
quadtree, as a widely used spatial search tree, can construct maps dynamically with multiple resolutions. And such a layered spatial representation provides great convenience for scan matching and robot localization. 12 Kraetzschmar et al. 13 proposed a method called probabilistic quadtree, which is commonly implemented in robot mapping with high accuracy and low computational resource occupation. 14 And such data structure also presents great convenience for robot navigation (trajectory planning). 15
Furthermore, Octree, 7 similar to quadtree, is widely used in three-dimensional (3D) reconstruction and map construction. Einhorn et al. 16 provide an improved Octree algorithm called ND-Tree. This algorithm can build topological maps in adaptive scale.
Topological graph partitioning is a well-studied problem. Shi and Malik 17 and Von Luxburg 18 provide an excellent introduction to the spectral clustering algorithm, which gives the minimum cut of an undirected graph. And based on this algorithm, Vazquez-Martin et al.5,19 propose a map segmentation method. On the other side, Tian et al. 2 provide an incremental map segmentation algorithm to improve performance and they also proposes some suggestive criteria to construct a similarity matrix.
Finman et al. 8 produced an incremental map segmentation method of RGB-D map. As objects (e.g. table, chairs, and computer) are a part of RGB-D map, they demonstrate the potential that map segmentation can not only apply to semantic SLAM and trajectory planning, but also in object recognition area.
This article is based on our previous research. 2 The method proposed in Tian et al. 2 leaves an unsolved problem that the result of map segmentation relies on the trajectory (and the key frame) of robots. Instead of feature-based map representation, we use quadtree-based map representation to reduce the computational cost. This method not only improves the performance but also solves the above problem. quadtree-based map segmentation algorithm can generate a robot state–independent, consistent map representation. And the incremental algorithm framework is inherited by Tian et al.; 2 in this way, we stabilized the computational resource occupation.
Constructing a robot map with quaternary tree
Quaternary tree (quadtree) is a data structure of spatial indexing. quadtree map can provide a hierarchical representation with different resolutions. In this way, quadtree can reduce the space complexity while remaining necessary details of the workspace. And algorithms based on quadtree still have an excellent time complexity. For example, time complexity of indexing and deleting operations in quaternary tree is
A demonstration of how quadtree splits the space is shown in Figure 3. Figure 3(a) presents a simple quadtree with three small obstacles in the space. The

Demonstration of a quadtree in a simple map with three obstacles.
The robot construction process of quadtree map can be described as in Algorithm 1, and an incremental version of this algorithm can be described in section “Incremental map construction/segmentation method.”
Set the scale
Read observation data from the sensor and calculate
Build the quadtree map with
If the properties of the quadtree map reach the termination condition, stop reconstruction and perform the following operations: Eliminate the node which presents undetected area. Check the connectedness of each node. (This step is easy if the corresponding topological graph Eliminate the small connected component which is unconnected with the main branch. There are two simple methods to do this, which have been discussed in section “Algorithm implementation.”
Resolution of quadtree map is related to the map’s scale
Experimental results show that the higher resolution needed in map construction process, the more advantage over the occupancy grid map. Figure 4 shows the performance analysis between quadtree and the occupancy grid map. Figure 4(a) shows the map construction time of several datasets. And Figure 4(b) shows the memory occupancy of quadtree and grid map. Figure 4(c) presents the indexing time of quadtree and grid map (10,000 times random indexing). Dataset d1 represents the test dataset shown in Figure 11 and dataset d2 represents the MIT-Csail-3rd dataset shown in Figure 11. Dataset d3 represents the Intel-Lab dataset 20 shown in Figure 18. By contrast, the dataset O represents the occupancy grid map’s average performance.

Performance comparison between quadtree and grid map: (a) running time, (b) node amount, and (c) indexing time.
Map partitioning based on spectral clustering
The next step of autonomous map segmentation is to cluster the leaf node of the pre-constructed quadtree into submaps. Spectral clustering is an excellent algorithm proposed by Shi and Malik. 17 As this algorithm not only vectorized deeply but can also be solved efficiently on a computer, it outperformed in poorly distributed datasets. These features make spectral clustering an excellent algorithm for robot working environment segmentation task.
In order to obtain a consistent segmentation result between human and robot, the cluster criterion has to be similar to the way human recognizes the environment. Humans tend to regard some connective space as a whole area and separate different areas (unlike in function, privacy, and so on) with obstacles like walls and tables. In this article, we provide two criteria to cluster map units (nodes in
Two map units are connected if there are no obstacles in the line segment formed by the two units’ center.
Weight of the connection relies on the map unit’s layer. The higher the map unit’s layer (root node has the highest layer), the higher the connection’s weight. In other words, the larger node dominates the graph and the smaller node add some details. As shown in Figure 3, a node may establish edges to a far node if it has a higher hierarchy. The weight of
Define a weighted undirected graph

A sample of the corresponding topological graph
In order to make
In this way, a quadtree segmentation problem is transformed to a weighted undirected topological graph’s segmentation problem. Spectral clustering is an excellent solution to the graph division problem. A brief example of such a graph is shown in Figure 5. This method can be solved efficiently and often outperforms the traditional methods like
If
Regard each row of matrix
In most cases, the value of
For sample
Algorithm implementation
In this section, some details of the algorithm implementation will be introduced. These details are conducted to reduce the time and space complexity of the algorithm. Through the runtime analysis, we figured out that the performance bottleneck lies in the following aspects:
In the construction process of graph
Space complexity of the graph
Calculating the eigenvalues and eigenvectors of a huge Laplacian matrix will take a lot time (even only calculate the first
For the aspects 1 and 2, this article introduces three additional criteria to reduce the computational complexity of this algorithm. Instead of the traditional matrix representation, DIA sparse matrix storage scheme (sparse matrix with diagonal storage) 23 is used to decrease the space complexity of the algorithm. Furthermore, the corresponding matrix construction process has a strong parallelism. So the task can be assigned to several CPU/GPU cores. In this way, the advantage of high-performance process on robots can be fully taken. As a last resort, this article produces an incremental version of map segmentation algorithm. This algorithm can restrain the growth of computational complexity efficiently. By combining the map segmentation and robot exploring process, the redundant computational resources can be fully utilized.
Sparse matrix representation
Because every map unit is a leaf node in quadtree, the corresponding matrix construction process can be regarded as a breadth first search (BFS) traversal of the quadtree
Each node has max relevance in itself (to avoid singularity).
For each node
For the node

Comparison between the dense matrix and the filtered sparse matrix.
Storing the corresponding matrix with normal schema will occupy a lot of memory space. However, if the definition of distance is well enough so that the matrix is sparse enough, DIA sparse storage schema (diagonal storage) will decrease the memory to 1% or less.
COO sparse matrix storage schema (coordinate storage) use three vectors
The corresponding matrix construction algorithm is shown as follows:
Parallel algorithm
In the process of generating the corresponding matrix, most computational resources were occupied when calculating the relevance between map units. Actually, those calculations are independent. That means calculating the relevance of a pair of nodes needs nothing more than the quadtree
First, give the quadtree
For each pair of nodes
Count the number of tuples in the waiting queue and divide them into
Make a deep copy of the quadtree
Initiate subprocesses. Pass the quadtree
In each subprocess, calculate the relevance of each pair of nodes in the subqueue. And remove pairs if its relevance value is zero.
Combine the results of each subprocess in the main process.

A chart of how multiprocessing improves the performance. This figure has been enlarged and transformed to a vector graph.
The value of
Incremental map construction/segmentation method
The algorithm mentioned above works effectively in the experiment. But there is always some problem. When the number of nodes increases with the robot exploring the workspace, the runtime of this algorithm is unstable and increases with the number of nodes. (Although the scale of the map is given, with the increase of the number of obstacles, the number of leaf nodes in the quadtree also rises. In the worst case, the number of leaf nodes is the same as that in an occupancy grid map.) Accordingly, this article presents an incremental map construction/segmentation method to stabilize the computational resource occupancy.
The incremental map construction/segmentation method involves the three components described below. The roles of these components while the robot is exploring the environment are shown in Figure 8.
Dynamic construction of the quadtree
Generation of the graph
Division and fusion between submaps.

Types of nodes in the quadtree. When the robot is exploring the environment, different types of nodes are processed by different operations. Each operation corresponds to a subsection below. This figure has been enlarged and transformed to a vector graph.
Dynamic construction of quadtree
Dynamic quadtree construction problem can be explained as follows:
Given the root node
In this article, we provide an algorithm defined as follows:
Define
Traverse
The subtree includes nodes which is out of the sensor’s range.
The subtree includes nodes which contains obstacles in
If
If there are still some obstacles remaining in
The observation range of
The reason for deleting the subtree recursively in step 2 is that if the node
The effect of such optimization is shown in Figure 13. From this figure, in most of the time this method reduces the computational resources to
Local corresponding matrix generation
The algorithm above is designed to reduce the time complexity of updating the quadtree map. However, finding
Define the relevance between submaps as follows: The submap
An incremental map segmentation framework can be described as shown in Figure 9 from our previous paper: 2 At the beginning, let the robot explore the workspace until it stores enough information to make the first map segmentation. Then the robot continues exploring the new area (sometimes reviewing the old part) of workspace and use the incremental (online) version of the segmentation algorithm.

Online incremental map segmentation method framework. The offline part in this chart can be found in our previous paper. 2 This figure has been modified to a standardized form.
Assume that the robot has pre-segmented submaps
A disadvantage of the above spectral clustering algorithm is that, each time the map updates, the graph

The relevant topological graph of submaps. The graph
The incremental version of the algorithm can be described as follows:
Combine
Generate the local corresponding matrix
Calculate the relevance between
For observation Put Delete
After traversing all observation results, combine all the submaps in the temporary list into an auxiliary graph
Perform spectral clustering of the graph
Combine such new submaps and all the remaining submaps. As the result of incremental map segmentation algorithm.
After constructing the corresponding graph
If
Division and fusion between submaps
If the segmentation result is still far away from ideal, then, by presetting the threshold of an ideal scale of submaps, small submaps can be combined and a large submap and a too large submap will be divided again. And by defining the relevance between submaps, submap hierarchy corresponding to map
The larger the
Besides, the criteria about when a submap will divide can be taken as the maximum route length
Simulation and real-world experiment
Simulation
This article first simulates the algorithm in a well-structured workplace. Then, such algorithms are tested on the MIT-Csail-3rd dataset and the Intel-Lab dataset from Radish. 20 The algorithm was implemented in a computer with an i7-4700MQ CPU with 8GB memory without any GPU acceleration. The algorithm was implemented in Python 2.7 with the third-party libraries SciPy and NetworkX, and run on windows 7 platform. The experimental result shows the correctness of the algorithm. And the computational resource occupation is excellent. The advantage of this algorithm over occupancy grid map is shown in Figure 4.
Simulation in a test environment
Figure 11 shows the main process of the map segmentation algorithm in a test environment. Figure 11(a) presents the raw laser observation results obtained by a laser range finder and the inertial measurement unit (IMU) of the robot. Figure 11(b) and (c) shows the corresponding topological graph

quadtree map construction and map segmentation in a well-structured workspace.
Figure 12 shows the dynamic map construction and segmentation process. As shown in the figure, with the robot exploring its workspace (blue line represents its trajectory), the quadtree is constructed dynamically. And the submaps are divided and then combined by algorithm. Finally, the result is similar to the result shown in Figure 11. The clustering result may have some differences because the

Process of incremental map construction and segmentation.
In Figure 12, an additional step is introduced in the algorithm. For each submap divided by the algorithm, judge if the submap intersects with the robot’s trajectory. If the submap does not intersect with the trajectory, then this submap is invalid. This is an easy way to define the interior and exterior of the map.
When executing dynamically the quadtree construction algorithm, the robot will reconstruct only a part of the quadtree instead of rebuilding the whole tree. Define the performance saving ratio
It can be observed from Figure 13 that the performance saving ratio

The chart of performance saving ratio.
Figure 14 shows the performance between the basic algorithm and the incremental algorithm. In this graph, the performance is evaluated by the size of the corresponding matrix of the graph

Performance comparison between the basic algorithm and the incremental algorithm.
Simulation on MIT-Csail-3rd dataset
Figures 15–17 show the map construction and segmentation results on the MIT-Csail-3rd dataset from Radish.
20
Figure 15 presents the quadtree

quadtree

Topological graph

Autonomous map segmentation result from Figure 16.
Simulation on Intel-Lab dataset
The result of map segmentation on the Intel-Lab dataset is shown on Figure 18. Compared to the above dataset, this one is more complicates and sounder in structure. Because the Intel-Lab and MIT-Csail-3rd datasets were recorded from a real environment, the segmentation results can represent the performance in a real environment. And the result shows the correctness of the algorithm. Although more than 17,300 ms is needed to make a segmentation of the whole map, it takes a little time to make a local segmentation. When the local corresponding graph has an average of 150 nodes, it takes only 43 ms to make a segmentation. So the robot can maintain a segmented map in real time and adjust the segment result in free time.

Another map segmentation on Intel-Lab dataset. 20
Real-world experiment
Finally, the algorithm was tested on a real robot. The map was constructed by a PeopleBot-SH mobile robot. And the sensor we used is a Hokuyo UST-10LX laser range finder. The environment comes from the 3rd floor of State Key Laboratory of Robotics and System, Harbin Institute of Technology. The environment is shown in Figure 19. And the corresponding quadtree map is shown in Figure 20. Figure 21 presents a dynamic, temporary map segmentation result when the robot explored nearly half of the environment. This figure includes four submaps which are very similar to the final segmentation result.


quadtree map built by the PeopleBot-SH robot in a real environment.

A temporary segmentation result built by the robot when exploring the environment.
Result of map segmentation is shown in Figure 22. Although the complexity of this environment is very high and there are a lot of noises on the map, our algorithm can adapt the environment very well. The laboratory was divided by lattice room, debris, and partition. And the result of map segmentation fit in the structure of the room.

Map segmentation experiment in the same environment shown in Figure 21.
Discussion
The experiment above shows the correctness and efficiency of our algorithm. The algorithm can work not only under simple environments but also under several complex environments. Compared to the feature-based map segmentation method, our method does not rely on specific feature extraction method or environment consumption. Compared to occupancy grid map, our method provides a better efficiency, as shown in Figure 4. Other clustering methods, such as
Another advantage of the spectral clustering algorithm is that it keeps a balance between each cluster’s shape. That means even the input data contain some noise like that shown in Figure 21 and some isolated small connected components; the algorithm still gives a good enough result and ignore the noise.
However, this algorithm is still not perfect. The border between the submaps is not certain. In Figure 18, the segmentation of a corridor is not determined by its semantic meaning but the size of the room it connects to. And the border between the submaps is rough, which does not agree with human recognition.
Moreover, as the algorithm only receives laser data, it cannot determine the “soft” obstacles like chairs and “hard” obstacles like walls. (A fast algorithm for obstacle detection (line and rectangle intersection) can be found in Tilove. 24 ) As shown in Figure 22, if there are some tables and chairs in a room, the algorithm will consider them as walls and segment the room into several submaps. There is still a long way to go before semantic map segmentation.
Conclusion and future work
This article provides a quadtree-based map segmentation algorithm. Depending on the problem occurred in testing, this article proposes an incremental, parallel version of the algorithm. By testing this algorithm in multiple environments, the map segmentation algorithm shows its correctness and rapidity.
The future work will be focused on the consistency of segmentation results and the conditional independence between submaps. By researching such independence, the algorithm can do reasoning on submap hierarchy. In this way, the computational cost of loop closure, localization, and navigation algorithm can be reduced significantly.
Besides, this algorithm is a bottom-level part of the robot’s environment recognition system. Our further research on environment reasoning and understanding will take a pre-segmented map rather than the whole map as the input to enhance the performance. Meanwhile, by taking the morphology and connectivity of rooms into account, it is possiable to do some high-level reasonings. As the state-of-the-art research attention to the concrete object classification, our research might solve the problem of organizing those objects in room hierarchy.
Footnotes
Acknowledgements
The datasets used in this study were obtained from the Robotics Data Set Repository (Radish). Thanks go to Cyrill Stachniss and Dieter Fox for providing data.
Handling Editor: Fei Chen
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Nature Science Foundation of China (Grant Nos 61673136 and 61473103) and the Natural Science Foundation of Heilongjiang Province (Grant No. QC2014C072).
