## Abstract

The objective of the traveling salesperson problem (TSP) is to find a shortest tour through all nodes in a graph. Euclidean TSPs are traditionally represented with “cities” placed on a 2D plane. When straight line obstacles are added to the plane, a tour has to visit all cities while going around obstacles. The resulting problem with obstacles remains metric, but is not Euclidean because the shortest paths are no longer straight lines. We first revise a previous version of multiresolution graph pyramid by modifying the hierarchical clustering stage. Next, we describe two new experiments with human subjects. In the first experiment, the effect of the length of obstacles on the quality of tours produced by subjects was tested with three problem sizes. Long obstacles affect the tours to a greater degree than short obstacles, but long obstacles create obvious clusters and limit the ways in which the tours can be produced. In the second experiment we evaluated the degree to which Multidimensional Scaling (MDS) can compensate for the presence of obstacles. The results show that although MDS approximation can compensate to a large degree for the presence of obstacles, it cannot fully account for human performance. This fact suggests that mental representation of a TSP with obstacles is not Euclidean. Instead, it is likely to be based on hierarchical clustering in which pairwise distances represent the shortest paths around obstacles.

## Introduction and Prior Work

The objective of the traveling salesperson problem (TSP) is to find a shortest tour through all nodes in a graph. A valid solution to a TSP is a closed tour in the graph with every node visited once. Euclidean TSPs (E-TSP) are traditionally represented with “cities” placed on a 2D plane. TSP has been systematically used in human problem solving studies since 1996 (Macgregor & Ormerod, 1996). The existing results suggest the following: (i) human subjects produce near-optimal tours in E-TSP in time that is a linear function of the number of cities (Dry et al., 2006); (ii) the tours produced by subjects are only a few percent longer than the shortest tours (Graham et al., 2000; Pizlo et al., 2006), although the errors go up when larger problems are used (Dry et al., 2006); (iii) E-TSP is treated as a visual perception problem and the tours produced by the subjects can be explained by perceptual mechanisms (Graham et al., 2000; van Rooij et al., 2006); (iv) it was suggested by Graham et al. (2000) and Kong and Schunn (2007) that the visual system begins with extracting spatially global characteristics of E-TSP, which are used to guide the decisions about spatially local characteristics. More specifically, it is the multiresolution/multiscale pyramid structure of the visual system, which is fundamental to how E-TSP is solved by humans. This suggestion is consistent with the established fact that the visual system processes stimuli in a coarse to fine direction (Watt, 1987); and (v) humans rarely produce self-intersecting tours (Vickers et al., 2003; van Rooij et al., 2003). E-TSP is TSP in a special case of metric spaces, and so, one should ask whether human subjects can solve TSP problems whose metric is not Euclidean. Most spatial environments in which humans operate, such as grocery stores, cities and terrain that includes hills and valleys, are characterized by distances or costs that do not satisfy the Euclidean metric. How well can subjects solve such problems? There are only a few studies trying to address these questions.

In this paper we test human subjects and a computational model using TSP with obstacles (TSP-O). The obstacles are line segments randomly placed among the points representing TSP cities. When subjects produce tours, they have to go around obstacles. Specifically, subjects presented with a visual stimulus like Fig. 1a are allowed to include obstacle endpoints in the tour they construct when an obstacle blocks the straight line path between two cities they wish to visit consecutively. (We assume throughout that all cities must belong to the same connected component, thus valid tours exist.) Fig. 1b shows one such tour produced by a subject. Saalweachter and Pizlo (2008) performed a preliminary experiment of this kind. They did use line segments as obstacles, but they tested only small TSP problems having 20 cities. They showed that the errors of subjects were comparable to errors in E-TSP reported in previous papers (Graham et al., 2000; Pizlo et al., 2006).

Most important for our present study is the pyramid model that they used. Saalweachter and Pizlo used what is called an image pyramid, elaborating a previous model by Pizlo et al. (2006). In an image pyramid, the TSP is treated as a continuous distribution of intensity, with cities represented by sharp peaks of intensity and background represented by intensity value of zero. By blurring this image multiple times, a multiresolution representation is produced. Cities that are close to each other are blurred and merged into one peak of intensity. When more and more blurring is used, the intensity distribution has fewer and fewer peaks. Saalweachter and Pizlo used the center of gravity of each intensity peak as representing this peak (cluster). This process was done by ignoring obstacles. Now, came the step of including information about obstacles. This was done at the stage of tour formation (their Model 1), or earlier, when the parent-child assignment was modified based on the lengths of shortest paths around obstacles (Model 2). Both models were able to emulate the results of the subjects. Specifically, the errors produced by the models were similar to the errors produced by the subjects. However, for each problem and for each subject these models tried (i) all cities as starting points, (ii) both clockwise and counterclockwise directions and (iii) the number of nodes included in solving the cheapest insertion problem was varied between 0 and 16. These three searches (starting point, direction of the tour and the extent of cheapest insertion) were used to produce the best fit to the errors in individual problems. In our present study we eliminated these three searches. But the critical modification was by using a graph pyramid, rather than an image pyramid. This modification was made in order to remedy the following problem. Imagine a configuration of 3 line segments (obstacles) forming a closed triangle. In such a configuration, the region inside the triangle does not have any possible connection with outside. Even if no city is inside the triangle, there may be a problem on higher levels of the pyramid. Imagine 3 cities outside this triangle but close to its vertices. The shortest paths between pairs of these cities will have to go around the triangle. This is not a problem, yet. But if the models described by Saalweachter and Pizlo blur the image without obstacles and assign the center of gravity to represent a cluster, the center of gravity of the three cities is likely to be inside the triangle and isolated from the rest of the nodes. Neither of their two models would be able to deal with this problem (this problem, however, never occurred in their experiments). We eliminated this problem by using a graph pyramid described in the next section. Our graph pyramid was designed for E-TSP without obstacles. In order to apply our pyramid model to TSP-O, we used a Multidimensional Scaling (MDS) as the front-end. MDS uses, as input, the lengths of the shortest paths between pairs of cities and produces a 2D Euclidean approximation without obstacles (see Fig. 4b).

## Pyramid Model

### Hierarchical Clustering and Tour Refinement

A number of studies have demonstrated that pyramid models inspired by the structure of the visual system provide a good approximation to human performance in 2D and 3D TSPs (Graham et al., 2000; Pizlo et al., 2006; Haxhimusa et al., 2009, 2011). These models may be classified into two broad categories: *image* and *graph* pyramids. Image pyramids segment an image representing the problem into clusters using an intensity distribution at various degrees of Gaussian blurring. Graph pyramids, on the other hand, perform some form of agglomerative clustering on a problem represented by a set of points with a Euclidean distance metric defined on them. Pizlo et al. (2006) described an image pyramid which matched human performance on TSPs with the number of cities between 6 and 50, when performance was evaluated by tour error and proportion of optimal tours (Pizlo et al., 2006). Tour error is conventionally measured by how much longer the tour produced by a subject or a model is, compared to the shortest tour. Haxhimusa et al. (2009) described a graph pyramid which, when compared with the performance of subjects from Pizlo et al.’s study, approaches but does not match the performance of human subjects (Haxhimusa et al., 2009). More specifically, performance of the best subject was systematically better than performance of the graph pyramid. In the present paper, we describe an implementation of a graph pyramid algorithm similar to the one presented by Haxhimusa et al., which does as well as the best human subject in Pizlo et al. (2006).

Our algorithm, which we call Pyramid-1, takes as input a set of *N* points with a Euclidean distance metric defined on them, and thus can be applied to TSPs in any Euclidean space. (Note that the Pyramid-1 algorithm we describe now is defined for E-TSP, and not TSP-O, although we describe a generalization to TSP-O below which we call Pyramid-2.) It produces a multiresolution pyramid *G*, and a near-optimal tour *τ*.

Given a set of coordinates \(\mathcal {P}\) with the corresponding distance matrix *P*, an integer parameter *k* ≥ 2 specifying maximum cluster size, and an integer parameter *s* ≥ 0 specifying the width of cheapest insertion search, we define two procedures: *hierarchical clustering* and *iterative refinement*.

The hierarchical clustering procedure begins by initializing a forest *G*_{0} such that every point (city) in \(\mathcal {P}\) resides in its own set. This is the “bottom” of the pyramid. The next level of the pyramid *G*_{n+ 1} is generated by first performing one iteration of Borůvka’s algorithm on *G*_{n}, producing the forest \(G_{n}^{\prime }\) of sets of cardinality at least 2 (Nešetřil et al., 2001). For all sets in \(G_{n}^{\prime }\) with cardinality > *k*, recursively bifurcate them according to a procedure inspired by Kropatsch et al. (2005a) until all sets have cardinality ≤ *k*. Specifically, a subtree of the Minimum Spanning Tree (MST) with *n* > *k* vertices is split into two subtrees by removing one of its *n* − 1 edges such that the two resulting subtrees have as similar diameter as possible. The diameter of a tree is the longest of all shortest paths between two vertices in that tree.^{Footnote 1} This process is recursively repeated until all subtrees of the MST in \(G_{n}^{\prime }\) have cardinality ≤ *k*. Then, *G*_{n+ 1} is the forest created by assigning the centers of gravity of each set in \(G_{n}^{\prime }\) to a singleton in *G*_{n+ 1}. This process is repeated until for some *m*, |*G*_{m}|≤ *k*. *G*_{m} is then the “top” of the pyramid. This process is restated in Algorithm 1.

Because at a given level of the pyramid it is possible that some clusters contain only 1 child (due to the bifurcation procedure to ensure an upper bound on cluster size), the height of the pyramid may not be a logarithmic function of the number of cities, a characteristic usually present in computer vision applications. The possible presence of singleton clusters and the resulting theoretical imbalance in the pyramid introduces a trade-off which prevents points very distant from all other points from being joined to clusters relatively distant from them. See Kropatsch et al. (2005b) for a discussion of the provability of the height of pyramids.

The iterative refinement procedure now works from the top of the pyramid down, building an approximate solution using breadth-first cheapest insertion. It begins by producing a shortest tour *τ*_{m} of the nodes in *G*_{m}. Then, for each *n* < *m* counting down to 0, it produces *τ*_{n} by traversing the tour in *τ*_{n+ 1}, expanding each node, and performing cheapest insertion on at-most *k* of its children and at-most the *s* most-recently inserted nodes in *τ*_{n}. This process is specified more precisely in Algorithm 2. *τ*_{0} is a near-optimal solution to the original TSP. Figure 2 illustrates the entire process of clustering and tour refinement in a 50-city TSP.

This process of building *τ*_{0} by constructing a family of self-similar tours *τ*_{n} is different from the one used in the pyramid algorithm published by Haxhimusa et al. (2009). There, the authors imitated the human visual fovea by performing a depth-first cheapest insertion, in which a node *ν*_{0} in *G*_{m}, followed by its children, down to its descendants in *G*_{0} were all expanded and inserted, before moving to the next node *ν*_{1} in *G*_{m}. In that case, the final tour *τ* is constructed in one pass. As we describe below, our results are consistent with theirs, so we think that the process of refinement does not matter to the global structure of the final tour, and does not introduce relevant dissimilarities with human tours.

Figure 3 shows the performance of our model with parameters *k* = 2,*s* = 5 on randomly generated 6, 10, 20, and 50-city problems (100 random problems generated for each condition). Superimposed are results of subject OSK from Pizlo et al. (2006). Note that with k = 2 and s = 5, the model is holding 9 items in its memory and manipulating 7 items at a time. Miller (1956) gives 7 ± 2 as the maximum size of human short-term memory, and here we observe empirically that humans are doing no better than our model does with a 9-item memory. Additionally, the cluster size *k* = 2 matches the reduction ratio of the image pyramid described by Graham et al. (2000) and Pizlo et al. (2006).^{Footnote 2}

### Modified Pyramid Algorithm for TSP-O

Pyramid-2 was designed to work with TSP-O. Pyramid-2 is essentially identical to Pyramid-1, except that it uses shortest paths around obstacles to establish clusters. The centroid of each cluster with 2 nodes is the midpoint of the shortest path. Clearly, Pyramid-2 is a generalization of Pyramid-1. If Pyramid-2 is applied to E-TSP, its computations are indistinguishable from the computations of Pyramid-1. There is one aspect that must be highlighted, here. Pyramid-2 is based on the assumption that the clusters have at most 2 nodes. If more than 2 nodes are allowed, there may be a problem with the decision about the centroid of clusters. But as we have just seen, Pyramid-1 has comparable performance to humans on E-TSPs when cluster size is 2.

### MDS Approximation

The preliminary study by Saalweachter and Pizlo (2008) showed that their subjects produced very good tours when geometrically simple obstacles, namely line segments, as well as obstacles in the form of letters L and C, were used. When the shortest path between pair of points has to go around obstacles, the resulting path lengths are not Euclidean distances, although they satisfy metric axioms. In order to produce a Euclidean representation of TSP-O we apply a multidimensional scaling (MDS) procedure to the shortest paths between all pairs of cities (Borg & Groenen, 2005). The resulting E-TSP is then solved by our pyramid model as described above.

A Euclidean approximation to a TSP-O is generated from a matrix *P* populated with the lengths of the shortest paths between all pairs of points (computed taking obstacles into account with Dijkstra’s algorithm (Dijkstra, 1959)). *P* is the dissimilarity matrix which is the input to metric MDS. MDS will then produce a Euclidean approximation of the original problem in a specified number of dimensions *d*.^{Footnote 3} It does this by finding coordinates \((x_{1},x_{2},\dots ,x_{N})\) for each city which minimize the following formula:

Simply put, MDS returns the coordinates of cities in a Euclidean space. Once this Euclidean approximation has been generated, the pyramid model, Pyramid-1, described in “Hierarchical Clustering and Tour Refinement” section is applied to produce a tour. The tour is represented by a list of cities in the order they were visited. A tour in this Euclidean representation is then “copied” to the original TSP-O by connecting the cities in the same order, using the shortest paths when obstacles are encountered. Specifically, whenever a straight line between the successive cities intersects one or more obstacles, the shortest path is used instead. This leads to a valid tour in the TSP-O. To see that this is the case, consider that, as just described, the algorithm will produce a closed tour in the fully connected graph defined with the nodes corresponding to cities in the original problem and edges corresponding to the geodesics between cities when obstacles are taken into account. By our definition given at the outset, all such tours are valid solutions to the TSP-O, although other valid solutions will also exist (e.g., those which navigate the obstacles inefficiently).

Figure 4 illustrates a TSP-O, its MDS approximation for *d* = 2, the pyramid solution for the MDS approximation, and the resulting tour in the original problem.

The application of an MDS to shortest paths resembles the concept of Isomap (Tenenbaum et al., 2000). Our problem, however, is simpler than the problem that Isomap solves. In TSP-O the shortest paths are computed around obstacles that are explicitly present, but in the problems described by Tenenbaum et al. the obstacles are implicit and they are inferred by Isomap. The key step in producing Isomap refers to estimating distances (dissimilarities) between pairs of points that are on different patches of the underlying low-dimensional manifold. Instead of using a Euclidean, straight line, distance between such points, Isomap sums the distances within and between local neighborhoods. The resulting path is an approximation to a geodesic that resides within the manifold.

An MDS approximation is not guaranteed to be perfect. Even in cases in which a collection of Euclidean coordinates perfectly reproduces the metric given in the distance matrix, the algorithm may still end up in local optima. “Stress” is typically used to measure the quality of the MDS approximation. When the dimensionality *d* increases, stress decreases. It is known that stress is not guaranteed to become zero even if the dimensionality of the approximation is infinitely high. The reason for this is that the axioms of a Euclidean metric are a special case of metric axioms. Specifically, while the metric distances in a TSP-O satisfy the triangle inequality, they may not satisfy its generalization to *d*-dimensional space. For a *d*-simplex in *d* − 1 Euclidean space, each of its *d* − 1-facets must have hypervolume which is at most the sum of the hypervolumes of all other facets.^{Footnote 4} So, it is not the case that MDS can always guarantee a precise Euclidean reconstruction of a TSP-O.

Very little prior work has been done on TSP in conjunction with MDS. One notable exception is White and Sweeney (1980), in which the authors argue that applying non-metric MDS to a scheduling problem results in a visual task that can be treated as a TSP. This may allow humans to produce and evaluate the quality of solutions to the original scheduling problem more quickly and intuitively. Their study does not address the question of human performance in TSPs, but represents what is likely the first application of MDS to problems in Operations Research.

### Evaluating the Role of MDS in Human Performance in TSP-O

Our subjects were tested in three types of TSP problems in Experiment 2 (see below). Let TSPo(*h*) represent the subject *h*’s tour error on TSP-O. This error is computed as the difference between the length of the subject’s tour and the length of a shortest tour, normalized to the latter. Next, the subject will be tested using the same cities, but after the obstacles are removed (E-TSP). The order in which the cities are visited will be superimposed on the corresponding TSP-O as illustrated in Fig. 4. Whenever a straight connection from one city to another intersects an obstacle, the shortest path around the obstacle will be used. So, the resulting tour will be a valid tour in TSP-O, although this tour is likely to be highly suboptimal. The resulting error TSPe(*h*) will be computed as in TSP-O. Specifically, the length of the tour in E-TSP, after the shortest paths are incorporated, will be compared to the length of a shortest tour in TSP-O. Finally, the subject will be tested on the 2D MDS approximation (TSP-MDS) to the TSP-O and the resulting order of cities will be again superimposed on the corresponding TSP-O. The error of this tour will be denoted as TSPm(*h*).

The difference (TSPe −TSPo) represents the degree to which E-TSP is modified by putting obstacles. If obstacles do not affect the order in which cities are visited, TSPe = TSPo. If the MDS approximation fully compensates for the presence of obstacles, TSPm = TSPo. If this compensation is less than perfect, TSPm will be greater than TSPo. In order to evaluate the degree to which MDS compensates for the presence of obstacles, we will use the following ratio:

When ME is close to 1, solving TSP-MDS is equivalent to solving TSP-O. In other words, the order in which the cities are visited is the same in both. When ME is close to 0, the MDS approximation does not change the order in which the cities are visited, compared to E-TSP, which is the TSP after the obstacles are removed. ME will provide a measure of the quality of MDS approximation that can be used to evaluate the hypothesis that human subjects solve TSP-O by producing an MDS approximation to TSP-O. As will be shown, we will conclude that this hypothesis should be rejected because the human solution of TSP-O is better than what MDS approximation suggests.

## Experiments

### Experiment 1

Our first experiment was designed to document performance of the subjects in TSP-O for three problem sizes and three obstacle lengths. It will also provide statistical information about what kind of TSP-Os will be most diagnostic in assessing the effect of MDS approximation in Experiment 2.

### Subjects

Two of the authors (S1 and S2) were tested in TSP-O. Both subjects were familiar with both TSP and the computational model described in “Hierarchical Clustering and Tour Refinement’. Optimal tours were produced using the Concorde algorithm (Applegate et al., 2006).

### Stimuli

Three problem sizes were used: 16, 32, and 48 cities. Each problem size was tested with one of three obstacle lengths — 2/8, 3/8, and 4/8 of the window in which the cities were generated. This resulted in 9 conditions. Figure 5 shows 16-city problems with the three lengths of obstacles. Both subjects ran the same set of problems in a random order. 25 problems were used for each of the nine conditions. Each problem had 10 straight line obstacles. The positions and orientations of the obstacles were random, as were the positions of the cities. Specifically, obstacles were chosen such that their midpoints must lie within the visual window in which the problem was presented, and their orientations were uniformly sampled. (It is universally assumed in this paper that valid tours cannot pass outside of the visual window, even if some obstacle endpoints do.) Cities could not be located close enough to obstacle endpoints or to each other such that their overlap would produce visual ambiguity. No city was allowed to be enclosed by obstacles in such a way as to make it impossible to visit it.

### Procedure

Problems were presented to a subject on a 2048 × 2048 pixel square in the center of a large Windows Surface tablet. Subjects produced the tour by tapping the stylus on the cities and on the endpoints of obstacles to indicate how they decided to go around the obstacles. At every step, the interface highlighted cities and obstacle endpoints which were accessible by straight line connection from the node the subject had last visited.

### Analysis

Subjects’ errors for the 9 conditions of TSP-O are shown in Fig. 6. Also, for each of the nine conditions, optimal tours were produced on three variations of each problem: TSP-O, E-TSP and TSP-MDS. We used MDS approximation in a 2D Euclidean plane. The average errors TSPe and TSPm of the optimal problem solver (Concorde) were computed and used to compute the values of ME for the optimal solver.

### Results

Figure 6 shows errors using cumulative distributions. The errors tended to be larger for larger problem sizes. But the obstacle length did not lead to a systematic effect. When you insert obstacles of length 0 (a regular E-TSP), we know that tour errors of human subjects are small. From there it is easy to see that obstacles with small positive lengths will not disrupt the geometry of the problem significantly. Thus, we would expect that errors would remain small for shorter obstacles. Longer obstacles (i) change the resulting tour substantially, but they also (ii) produce clear clusters and they (iii) limit the space through which the tour can go. As a result, the errors are not systematically larger for longer obstacles. The question is whether MDS approximation will be able to account for these 3 factors.

Table 1 shows TSPe as well as ME for Concorde. It can be seen that TSPe is greater than 0.10 only for three of the nine conditions. These are the conditions where obstacles change the resulting tours substantially. Specifically, the order in which the cities are visited is different in TSP-O and in E-TSP. From these three problems, both TSPe and ME are largest for 48 city problem with the longest obstacles. This is the condition that will be tested in Experiment 2.

### Experiment 2

In this experiment, three subjects were tested on the three different types of TSP problems that Concorde was tested on in Experiment 1. Furthermore, Pyramid-1 was tested as well.

### Subjects

One author (S3) and two graduate students (S4, S5) were tested. Note that S3 is a different individual from S1 and S2. S3 was familiar with both TSP and the pyramid model. S4 and S5 were naive to both TSP and the pyramid model at the time they participated.

### Stimuli

There were three experimental conditions. The first condition used 25 TSP-Os with 48 cities (newly generated), and obstacles whose length was 1/2 of the window size (the longest obstacle from Experiment 1). The second condition used the same problems with obstacles removed (E-TSP). The third condition (TSP-MDS) used a 2D MDS approximation to TSP-O, followed by Procrustes transformation to bring the TSP-MDS as close as possible to the size and orientation of TSP-O.

### Procedure

Each subject ran the three conditions in a different, randomly selected order.

### Results

The MDS effect (ME) for subjects and Concorde are shown in Table 2. ME was computed from average errors TSPo, TSPe and TSPm. The subjects’ MEs are similar to that of Concorde. The Table shows that a 2D MDS approximation compensates for the presence of obstacles by about 0.80. This degree of compensation is not far from perfect, but the question is whether we can conclude that a pyramid algorithm designed for Euclidean TSP, applied to an MDS Euclidean approximation explains how humans solve TSP with obstacles. This question will be discussed next.

Figure 7 shows that the tours the subjects produced for a 2D MDS approximation of a TSP-O are systematically longer (larger error) than their tours for TSP-O. So, a 2D MDS approximation is not good enough. Is it possible that the human visual system uses an MDS approximation in a 3D space or even a space with greater number of dimensions? Human subjects could be tested in a 3D TSP (see Haxhimusa et al., 2011), but testing subjects with spaces whose dimensionality is greater than 3 is not possible. So, we applied our Pyramid-1, whose performance on E-TSP is as good as performance of the subjects, to MDS approximations in spaces with dimensionality 2–5. It can be seen in Fig. 8(a) that when Pyramid-1 is applied to an MDS approximation in 4D, it produces better performance than with MDS approximation in lower dimensions (2D or 3D), but performance in 4D is still systematically worse than human performance on TSP-O and increasing the dimensionality of MDS approximation beyond 4D does not improve performance. This result suggests that the combined model — Pyramid-1 applied to an MDS approximation — is not good enough as a model of human performance on TSP-O. Considering the fact that Pyramid-1 is acceptable as a model of human performance on E-TSP, we can conclude that MDS approximation is not what the human visual system does. This conclusion was surprising to us and should be further tested in future experiments.

Figure 8(b) shows TSP-O performance of a new model, Pyramid-2, superimposed on the results of the three subjects on TSP-O. Pyramid-2 is described in “Modified Pyramid Algorithm for TSP-O’. It is a modification of Pyramid-1 to accommodate obstacles in the clustering process for the special case when cluster size is 2. The curve representing the performance of Pyramid-2 is quite close to the curves of the three subjects. This demonstrates that Pyramid-2, which solves TSP-O without the intermediate stage of the MDS approximation, is a better model of human performance than a pyramid algorithm which solves the E-TSP produced by the MDS approximation.

## Discussion and Conclusion

Following the introduction of Fourier Analysis as a description of early mechanisms in human vision (Campbell & Robson, 1968), multiresolution pyramids have been accepted as an effective computational architecture in computer vision, and later as adequate explanations of early human vision (Jolion & Rosenfeld, 1994; Adelson et al., 1984). Both these types of analysis (Fourier Analysis and pyramids) captured the multiresolution and multiscale processing and both assumed that the visual input can be characterized as a 2D Euclidean plane. The bottom layer of a vision pyramid is the retinal image and the higher areas in the visual system represent higher layers of the pyramid (Pizlo et al., 1995). The fact that human subjects can produce near-optimal tours not only for E-TSP but also for TSP-O raises a question of how the metric that is not Euclidean is handled by the visual system. It seemed natural to us to assume that the visual system begins analyzing TSP-O by producing Euclidean approximations of the problem. Such approximations can be produced by an MDS. This suggestion was motivated by the universal use of MDS in cognitive literature where mental representations are studied. If a Euclidean representation of a TSP-O was produced by an MDS, the visual system could follow with forming an image (Euclidean) pyramid of the TSP, the kind of pyramid described by Tanimoto and Pavlidis (1975). But a graph pyramid based on hierarchical clustering is a possible alternative. Clustering in a graph pyramid is based on distances represented by shortest paths. So, a graph pyramid is similar to, but more general than an image (Euclidean) pyramid.

We compared these two general representations in TSP tasks: (i) graph pyramid with distances that are not necessarily Euclidean (Pyramid-2), and (ii) Euclidean pyramid with an MDS as the front-end (Pyramid-1). The fact that human subjects produce near-optimal tours reliably with small individual variability allowed us to make quantitative comparisons of these two representations. The results reported in this paper are better explained by a model in which the human mind handles TSP-O by using a graph pyramid based on shortest paths that may or may not be Euclidean distances and may even violate metric axioms (see Sajedinia et al. (2019) who tested humans subjects with non-metric TSP).

Our suggestion that a graph pyramid is a valid alternative to an MDS representation is similar to Shepard’s (1972, 1980) analysis. He pointed out that a hierarchical clustering represented by a tree structure may be better than MDS in some tasks. In fact, he did show an example where he superimposed a hierarchical clustering result on the MDS approximation, producing something very similar to a graph pyramid. Shepard suggested that different representations may apply to different tasks. Our results show that a graph pyramid is better than MDS in TSP-O. The reason is related to the fact that graph pyramid is not necessarily based on a Euclidean metric. Furthermore, global distances in a graph pyramid do not affect local clusters. In MDS approximation, however, all distances are equally important and, as a result, approximating long distances will affect local clusters. Finally, we would like to point out that a top-down clustering is likely to be more sensitive to spatially global obstacles than the bottom-up clustering used in this paper. If the obstacles resemble a maze, it may be impossible to form a few large clusters before analyzing shortest paths for all pairs of cities. This feature, namely, the effect of spatially global obstacles, is likely to prove decisive in testing the two types of hierarchical clustering: bottom-up vs. top-down. Future experiments on problems with more complex obstacles would be able to determine this.

## Data Availability

The datasets generated during the current study are available in the following GitHub repository, indexed by commit hash: https://github.com/jackvandrunen/tsp-o-dataset/tree/540cf418150501b8399316fc3cc9521bdf057013.

## Code Availability

The library used to run experiments is available at the following GitHub repository: https://github.com/jackvandrunen/tsp. Code for reproducing the reported results and figures can be found along with the dataset at https://github.com/jackvandrunen/tsp-o-dataset/tree/540cf418150501b8399316fc3cc9521bdf057013.

## Notes

Haxhimusa et al. (2009) suggest the equal-diameter constraint, which can be done in

*O*(*d*^{2}) for a tree with*d*nodes. But in their implementation they opt for the*O*(*d*) procedure of removing the longest edge of the tree instead. More work is needed to determine the trade-off between increased complexity and quality of solutions.The breadth-first refinement makes fewer assumptions about the limited memory (in contrast to Pizlo and Stefanov, 2013), and thus would have less difficulty with problems with more complex obstacles (such as mazes), which humans have significant problems with (Saalweachter & Pizlo, 2008). Additionally, this model — like the model proposed by Haxhimusa et al. — does bottom-up clustering, but Pizlo & Stefanov suggest that humans perform top-down clustering. One could in principle do top-down clustering using an MST (by, e.g., removing longest edges). Both of these are design choices made for convenience, and are a good target for exploration in future work.

For this, we used the scikit-learn library in Python 3.

When a collection of points satisfies the triangle inequality this does not guarantee that a

*Euclidean*representation exists. By way of illustration, consider an equilateral triangle with side lengths 7. Now, consider adding a point with distance 4 from each corner of the triangle. All four points satisfy the triangle inequality, but there is no representation of these points on a Euclidean plane. It is also clear that placing the fourth point above the plane of the triangle will not help.

## References

Adelson, E.H., Anderson, C.H., Bergen, J.R., Burt, P.J., & Ogden, J.M. (1984). Pyramid methods in image processing.

*RCA Engineer*,*29*(6), 33–41.Applegate, D., Bixby, R., Chvatal, V., & Cook, W. (2006). Concorde TSP solver.

Borg, I., & Groenen, P. (2005).

*Modern multidimensional scaling: Theory and applications*. Springer Science & Business Media.Campbell, F.W., & Robson, J.G. (1968). Application of fourier analysis to the visibility of gratings.

*The Journal of Physiology*,*197*(3), 551–566.Dijkstra, E.W. (1959). A note on two problems in connexion with graphs.

*Numerische Mathematik*,*1*(1), 269–271.Dry, M., Lee, M.D., Vickers, D., & Hughes, P. (2006). Human performance on visually presented traveling salesperson problems with varying numbers of nodes.

*The Journal of Problem Solving*,*1*(1), 20–32.Graham, S.M., Joshi, A., & Pizlo, Z. (2000). The traveling salesman problem: A hierarchical model.

*Memory & Cognition*,*28*(7), 1191–1204.Haxhimusa, Y., Carpenter, E., Catrambone, J., Foldes, D., Stefanov, E., Arns, L., & Pizlo, Z. (2011). 2D and 3D traveling salesman problem.

*The Journal of Problem Solving*,*3*(2), 8.Haxhimusa, Y., Kropatsch, W.G., Pizlo, Z., & Ion, A. (2009). Approximative graph pyramid solution of the E-TSP.

*Image and Vision Computing*,*27*(7), 887–896.Jolion, J.M., & Rosenfeld, A. (1994).

*A pyramid framework for early vision*. Kluwer Academic.Kong, X., & Schunn, C.D. (2007). Global vs. local information processing in visual/spatial problem solving: The case of traveling salesman problem.

*Cognitive Systems Research*,*8*(3), 192–207.Kropatsch, W. G., Haxhimusa, Y., & Pizlo, Z. (2005a). Integral Trees: Subtree depth and diameter. In R. Klette & J. Žunić (Eds.)

*Combinatorial image analysis, lecture notes in computer science*(pp. 77–87). Springer: Berlin, Heidelberg.Kropatsch, W.G., Haxhimusa, Y., Pizlo, Z., & Langs, G. (2005b). Vision pyramids that do not grow too high.

*Pattern Recognition Letters*,*26*(3), 319–337.Macgregor, J.N., & Ormerod, T. (1996). Human performance on the traveling salesman problem.

*Perception & Psychophysics*,*58*(4), 527–539.Miller, G.A. (1956). The magical number seven, plus or minus two: Some limits on our capacity for processing information.

*Psychological Review*,*63*(2), 81–97. Place: US Publisher: American Psychological Association.Nešetřil, J., Milková, E., & Nešetřilová, H. (2001). Otakar Borůvka on minimum spanning tree problem Translation of both the 1926 papers, comments, history.

*Discrete Mathematics*,*233*(1-3), 3–36.Pizlo, Z., Rosenfeld, A., & Epelboim, J. (1995). An exponential pyramid model of the time-course of size processing.

*Vision Research*,*35*(8), 1089–1107.Pizlo, Z., & Stefanov, E. (2013). Solving large problems with a small working memory.

*The Journal of Problem Solving*,*6*(1), 5. Publisher: Purdue University Press.Pizlo, Z., Stefanov, E., Saalweachter, J., Li, Z., Haxhimusa, Y., & Kropatsch, W.G. (2006). Traveling salesman problem: A foveating pyramid model.

*The Journal of Problem Solving*,*1*(1), 8.Saalweachter, J., & Pizlo, Z. (2008). Non-Euclidean traveling salesman problem. In T. Kugler, J.C. Smith, T. Connolly, & Y.-J. Son (Eds.)

*Decision modeling and behavior in complex and uncertain environments, Springer optimization and its applications*(pp. 339–358). New York: Springer.Sajedinia, Z., Pizlo, Z., & Hélie, S. (2019). Investigating the role of the visual system in solving the traveling salesperson problem. In

*Proceedings of the 41st annual meeting of the Cognitive Science Society*.Shepard, R.N. (1972). Psychological representation of speech sounds. In E.E. David & P.B. Denes (Eds.)

*Human communication: A unified view*(pp. 67–113). McGraw-Hill. Publisher: McGraw-Hill Companies.Shepard, R. N. (1980). Multidimensional scaling, tree-fitting, and clustering.

*Science*,*210*(4468), 390–398. Publisher: American Association for the Advancement of Science.Tanimoto, S., & Pavlidis, T. (1975). A hierarchical data structure for picture processing.

*Computer Graphics and Image Processing*,*4*(2), 104–119.Tenenbaum, J. B., Silva, V. d., & Langford, J. C. (2000). A global geometric framework for nonlinear dimensionality reduction.

*Science*,*290*(5500), 2319–2323. Publisher: American Association for the Advancement of Science.van Rooij, I., Schactman, A., Kadlec, H., & Stege, U. (2006). Perceptual or analytical processing? evidence from children’s and adult’s performance on the Euclidean traveling salesperson problem.

*The Journal of Problem Solving, 1*(1).van Rooij, I., Stege, U., & Schactman, A. (2003). Convex hull and tour crossings in the Euclidean traveling salesperson problem: Implications for human performance studies.

*Memory & Cognition*,*31*(2), 215–220.Vickers, D., Lee, M.D., Dry, M., & Hughes, P. (2003). The roles of the convex hull and the number of potential intersections in performance on visually presented traveling salesperson problems.

*Memory & Cognition*,*31*(7), 1094–1104.Watt, R.J. (1987). Scanning from coarse to fine spatial scales in the human visual system after the onset of a stimulus.

*JOSA A,**4*(10), 2006–2021.White, G.P., & Sweeney, D.J. (1980). Using multidimensional scaling to solve traveling salesman and machine scheduling problems.

*Computers & Operations Research*,*7*(3), 177–184.

## Funding

This research was funded in part by a fellowship awarded to VanDrunen by the Division of Undergraduate Education at the University of California, Irvine.

## Author information

### Authors and Affiliations

### Contributions

VanDrunen designed the experiments, revised the pyramid models, performed Experiment 1, wrote the initial draft. Nam performed Experiment 2. Beers revised the clustering algorithm for the pyramid model. Pizlo (principal investigator) helped design the experiments and revise the models, revised the draft of the paper.

### Corresponding author

## Ethics declarations

### Ethics Approval

The experiments were classified as exempt research.

### Consent for Publication

Not applicable

### Consent to Participate

Verbal informed consent was obtained from all study participants.

### Conflict of Interests

The authors declare no competing interests.

## Additional information

### Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

VanDrunen, J., Nam, K., Beers, M. *et al.* Traveling Salesperson Problem with Simple Obstacles: The Role of Multidimensional Scaling and the Role of Clustering.
*Comput Brain Behav* **6**, 513–525 (2023). https://doi.org/10.1007/s42113-022-00155-0

Accepted:

Published:

Issue Date:

DOI: https://doi.org/10.1007/s42113-022-00155-0