Rating Puzzle Ring Difficulty Based on Configuration Space

Transcription

Rating Puzzle Ring Difficulty Based on Configuration Space
Rating Puzzle Ring Difficulty Based on Configuration Space Complexity
Akira IWASE†
Shigeki SUZUKI† Takatoshi NAKA‡ Masashi YAMADA‡
Mamoru ENDO‡ and Shinya MIYAZAKI‡
†Graduate School of Computer and Cognitive Sciences, Chukyo University
‡School of Information Science and Technology, Chukyo University
E-mail: †{iwase | shigeki | naka}@om.sist.chukyo-u.ac.jp, ‡{myamada | endoh | miyazaki}@sist.chukyo-u.ac.jp
Abstract: The difficulty of puzzle rings is mainly due to the complexity of the solving procedures and the high number of dimensions
of the possible moving paths. This paper aims at providing a quantitative evaluation of the concept of puzzle ring difficulty, and proposes
some feature values for describing the difficulty. Furthermore, the effectiveness of those values is evaluated by comparing them with the level
of difficulty experienced by test subjects while solving real puzzle rings. In addition, we have implemented a data structure for describing
puzzle rings, as well as algorithms for manipulating and solving puzzle rings using a computer. A search algorithm for finding a solution path
and a method for characterizing the configuration space are presented.
Keywords: Motion Planning, High-Dimensional Configuration Space, Puzzle Rings, Evaluating Difficulty Rating
1. Introduction
There are many puzzle rings on the market, and
although they are usually given a difficulty rating,
this rating is subjective. We are interested in finding
Type A
a general way of providing a quantitative evaluation
of the difficulty of puzzle rings, and this paper
introduces some criteria necessary for determining
the difficulty rating of puzzle rings.
The problem of solving puzzle rings is essentially
a path planning problem in high-dimensional space.
The method used for the path planning problem is
applicable in the case of solving puzzle rings using a
computer. Fortunately, many algorithms have bee n
developed in the field of robotics [1][2][3][4][5][6 ].
Our approach to evaluating puzzle ring difficulty
consists of examining the search space, which is
commonly called configuration space and finding
out the structural features related to the difficulty of
the puzzle rings.
This paper provides a formal definition of the
puzzle ring problem, characterizes the configuration
space of puzzle rings, presents an algorithm for
solving
them,
and
provides
some
criteria
for
determining their difficulty rating.
2. A Puzzle Ring Model
Puzzle rings have been classified from the point of
view of their goal, materials or geometry. Here, we
introduce a classification based on geometry [7].
Simplify ing the shape of the rings, we can classify
the puzzle rings into the four ty pes shown in Figure
Type B
Type C
Type D
Figure 1. Geometrical types of puzzle rings
1. This paper deals with puzzle rings belonging to
ty pe B in the figure, since the shape of the type is
simple, and many variants of this ty pe exist. Each
of the two rings has an opening, and winds around
the other. The rings are made of wire whose
thickness is uniform and bigger than the width of
the
opening
disentangling
of
the
and
rings,
separating
and
the
the
goal
two
is
rings.
Therefore, in order to solve such puzzle rings, we
need to move the two rings, fitting the opening of
one ring to the opening of the other. Representative
examples of this type are shown in Figure 2.
2.1. Ring Objects
In the computer program, the shape of the rings is
modeled as connected cylinders, c 0 , c1 , K , c n , and
the diameter of each cylinder is
To > 0 . The
essence of the puzzle rings is kept if the number of
cylinders is large enough. In addition, the distance
between two cy linders is defined as the distance
between their central axes. As a result, the distanc e
between two rings, O′ and O , is defined as the
minimum distance between ci′ ∈ O′ and c j ∈ O . Two
rings are said to be in a state of collision if the
distance between the two rings is less than To .
Alpha
Dalpha
Devil
Figure 2. Examples of puzzle rings
Figure 4. An example of the configuration space of
puzzle rings
Points where O collides with ring O ′ are called
(a)
Figure 3.
(b)
(c)
Examples of the linking number
forbidden points, and points where O does not
collide with O ′ are called free points. Let Cobstacle
2.2. Linking Number
be a set of forbidden points, and C free be a set of
Computer programs for solving puzzle rings nee d
free points. Let C l = +1 , Cl = 0 and C l = −1 be sets of
to judge whether or not two rings are in a tangle d
state. The linking number, which represents the
number of times that each curve winds around
another, is a way of performing such judgments.
It can be either positive or negative depending on
the orientation of the two curves, but is alway s an
integer. Relevant examples are shown in Figure 3.
The linking number of the two curves shown i n
Figure 3(b) is 0 since the two curves do not win d
around each other. We use an algorithm presented
in [8] to compute the linking number, whic h
assumes that the rings are closed and have an
orientation. For puzzle rings, the linking number i s
+1, -1 or 0, where the linking number is 0 if two
rings are in a disentangled state, and either +1 or
–1 otherwise.
2.3. Configuration Space of Puzzle Rings
We fix the position of one of the two rings since
only their relative position is necessary for solving
the problem. Let O′ and O be a fixed ring and a
non-fixed ring respectively. The position of ring O
is represented by six parameters, ( x, y, z , a, b, c ),
where (x,y,z) represents a translation, and (a,b,c)
represents an Eulerian angle. In addition, the
parameter space representing all possible positions
is called the configuration space [1][2][3]. Here,
we characterize the configuration space of the
puzzle rings and present a relevant example in
Figure 4.
Let C be a six-dimensional configuration space.
Each point in C represents a position of ring O .
points where the linking number is +1,0 and –1
respectively. As the linking number at a free point
takes
a
value
of
+1,
0
or
–1,
we
obtain
C free = Cl = +1 U Cl = 0 U Cl = −1 .
Solving a puzzle ring is equal to finding a
solution
path
connecting
the
initial
point
(
or
)
and
a
point
in
.
Figures
p ∈ Cl = +1 ∈ Cl = −1
Cl = 0
5(a) and (b) show two examples of initial points.
Figure 5(c) shows a point in Cl = 0 where the two
rings are disentangled. The configuration space of
puzzle rings, C , has the following features.
(i) A solution path must pass through a narrow
space Cnarrow since ring O must pass through a
narrow opening in O ′ .
(ii) A path connecting a point in C l = +1 and a point
in
C l = −1 must pass through Cl = 0 . In other
words, if the initial point p is in C l = +1 , the
solution path does not need to pass through
C l = −1 , in which case the points in C l = −1 do
not need to be considered when solving the
puzzle.
(iii) The spaces
C l = +1 and C l = −1 are not alway s
continuous, and can be surrounded by Cobstacle .
The point shown in Figure 5(d) has a linking
number of +1, but no path can connect it to the
point shown in Figure 5(a).
(iv) Space Cl = 0 is an infinite set, while both C l = +1
and C l = −1 are finite sets.
Feature (i) implies that we need to find a pat h
which passes through a narrow space Cnarrow .
(a)Cl=+1
(b)Cl=-1
(c)Cl=0
(d) Cl=+1
Figure 6. The expanding process of RRT
(a)
Figure 5. Examples of the initial point (a) (b), a
disentangled point (c) and an impossible point (d)
(b)
(c)
Figure 7. An example of RRT (a), a solution path
on the RRT (b) and an optimized path (c)
Features (ii) and (iii) imply that solution paths can
be found in a continuous space which includes the
exceeds K , return “fail”, otherwise go to (2).
initial point and has the same linking number as the
initial point. Feature (iv) implies that bidirectional
searches are not useful for solving puzzle rings
since there is an infinite number of points in Cl = 0
which can be set as the goal.
If the algorithm returns “success”, we have found a
solution path that connects the latest pnew with pinit .
Figure 7(a) shows an RRT in a 2-dimensional
configuration space. The circle ●
denotes the
initial point, the circle ○ denotes the goal area,
3. Algorithm
Problems
This
section
for
Solving
Puzzle
Ring
and the triangles represent forbidden spaces. Figure
7(b) shows a solution path, which is not smooth
presents
an
algorithm
for
finding
because it is composed of the edges of RRT. We can
The
make the path smoother and shorter through the
algorithm is based on the Rapidly -Exploring Random
following process: calculating the distance between
Trees (RRT) construction algorithm [4][10]. The
every pair of points on the solution path, and the n
RRT algorithm grows a tree which spreads uniformly
finding the shortest path which connects the initial
solution
paths
for
puzzle
ring
problems.
over C free from the initial point. The original RRT
T
T = { pinit } ,
be a tree,
where pinit is the initial point.
(2) Choose a random point prand from C , and set
the nearest neighbor point pnear already in T
to pinit .
The goal condition for the puzzle ring problem is
that the link number of pnew becomes 0.
4. Evaluating the Difficulty of Puzzle Rings
In this section, we discuss the factors underlying the
(3) Create a point
toward
example of a shortest path. Here, we call the
shortest path the optimized path.
algorithm is composed of the following four steps.
(1) Initialization: Let
point and the goal point. Figure 7(c) shows an
prand
situations
p , and move it from
until
occurs:
one
(a) p
of
the
has
pnear
difficulty of puzzle rings, and subsequently show
following
that there are correlations between the configuration
travelled
a
space of the puzzle rings and their difficult.
distance of ε (see Figure 6), (b) p reaches
pinit or (c) a collision occurs (i.e. p is in
4.1. Factors Influencing the Difficulty of
Puzzle Rings
Cobstacle ). In the case of (a) or (b), set pnew = p .
We conducted an experiment whose objective was to
In the case of (c), go to (1).
(4) Add pnew and an edge ( prand , pnew )to T .
pnew
satisfies
“success”.
If
the
the
goal
number
condition,
of
points
elucidate the factors which affect the difficulty of
If
puzzle rings. In this experiment, there were nine
return
subjects solving three representative puzzle rings,
T
Alpha, Dalpha and Devil, shown in Figure 2, and the
in
600
500
400
300
200
100
0
sec.
1st
2nd
3rd
600
500
400
300
200
100
sec. 0
1st
Alpha
2nd
600
500
400
300
200
100
0
sec.
3rd
1st
Dalpha
2nd
3rd
Devil
Figure 8. The time needed to solve Alpha (left), Dalpha (center) and Devil (right)
time needed to solve each puzzle ring was measured.
(F1) the difficulty of finding a solution path,
Each subject attempted to solve all three puzzle
(F2) the difficulty of moving the rings along the
rings in three trials, which were undertaken two
weeks apart. Moreover, the subjects were taught how
to solve the respective puzzle after each trial.
The
results of this experiment are shown in Figure 8.
solution path.
We inspected the configuration space of puzzle
rings, and found the following features related to the
difficulty factors.
Records at 600 seconds in the graphs denote the
z
path complexity
cases where the subject was not able to solve the
z
configuration space complexity
puzzle ring within 10 minutes.
z
path visibility rate
At the first trial, all subjects were able to solv e
The following sections give formal definitions of
Alpha in a short time, however, most of them needed
these features and show the relation between them
more time to solve Dalpha and Devil, and some
and the difficulty factors.
subjects were not able to solve them. The cause of
4.2. Path Complexity
this is the difficulty of finding a solution path. The
Using the algorithm described in Section 3, we
solution paths for solving Dalpha or Devil are more
solved Alpha, Dapha and Devil using a computer.
intricate than those for Al pha, and in addition many
Table 1 shows the number of points of RRTs (Sv)
sham paths exist for the latter two puzzles. This is
and the number of points on the optimized paths
the first difficulty factor of puzzle rings.
(Pv). Figure 9 shows each point on the shortest
The results of the 2
nd
rd
trials show that the
optimized paths. Sv corresponds to the size of the
time needed to solve Dalpha did not decrease, while
search space, and Pv corresponds to the complexity
the time needed to solve Devil decreased. In spite of
(or non-linearity) of the path. The values of Pv
the fact that the subjects were aware of the solution
obtained were 7, 15 and 15 for Alpha, Dalpha and
nd
and 3
rd
trial since they had
Devil respectively, which indicates that the path
been taught the paths after each trial, they could not
complexity of Alpha is lower than that of the other
solve Dalpha efficiently. The cause of this is the
two puzzles. The path complexity can be related to
difficulty of moving the rings along the solution
the difficulty factor F1 since highly complex paths
path, which is the second difficulty factor of puzzle
are difficult to find. This is consistent with the
rings.
results
paths during the 2
and the 3
In summary, at least two factors exist in th e
from
the
first
trial
of
the
described in Section 4.1.
problem of puzzle rings:
Figure 9. Optimized solution paths: Alpha (top), Dalpha (middle) and Devil (bottom)
experiment
Table 1. Sv: number of points in T . P v : number
of points on the optimized solution path
Sv
Alpha
Dalpha
Devil
Pv
8380
7
16354
24401
15
15
Table 2. Number of clusters
NC(1)
NC(3)
NC(5)
NC(10)
Alpha
505
488
450
337
Dalpha
884
853
807
637
10482
1149
736
422
Devil
illustrates a neighboring pair.
Using this algorithm, we examined the clusters i n
the configuration space of puzzle rings. The point s
used as input data were the points of RRTs as
obtained in the experiments described in Section 4.2,
and the number of clusters is shown in Table 2. In
this table, NC(n) denotes the number of cluster s
which contain more than n points. The NC(1)s for
Dalpha and Devil are 884 and 10482, while their
Figure 10. Clusters and cluster pairs
NC(3)s are 853 and 1149 respectively. In addition,
4.3. Configuration Space Complexity
Dalpha has fewer clusters than Devil, and the
When solving puzzle rings, we divide the possible
number of clusters of Alpha is smaller than that of
positions into groups and regard the groups as
both Dalpha and Devil. This shows that Alpha has
possible states. Then, we try to find solution paths
the least number of possible states, while Devil ha s
as combinations of the possible states. Therefore,
the greatest number of possible states. These results
the
state s
about the clusters are consistent with the results of
affects the difficulty of the puzzle rings. In order to
the initial trials in the experiment described i n
estimate this number, we divide the possible point s
Section
in the configuration space into clusters, and then
configuration space can be related to the difficulty
examine the neighboring pairs of clusters.
factor F1.
number
of
Let D ( xi , x j )
combinations
of
possible
be the distance between two points,
xi and x j . If a collision occurs along the line
4.1.
Therefore,
the
complexity
of
the
4.4. Path Visibility Rate
Here, we define the path visibility rate, which is a
measure of the difficulty of moving the rings along
the optimized path. If a straight line segment can be
segment connecting them, then D ( xi , x j ) is ∞ . Let
drawn between two points without experiencing a
D(C, C' ) be the distance between two clusters, C
visible from the other. In Figure 11, the sy mbol ○
and C' . Following a representative hierarchy
clustering algorithm [12], we define D (C, C' ) as
denotes the points on an optimized path, and the
follows.
denoted with the symbol ● . Furthermore, the dotted
D(C, C' ) = max D( xi , x j ) ( xi ∈ C, x j ∈ C' ) .
Figure 10 illustrates an example of 15 clusters,
collision, we say that each of the two points is
RRT points which are not on the optimized path are
arrows connect the visible points, while the soli d
arrows connect the non-visible ones. Let V i and V i + 1
be two successive points on the optimized path. Next,
where the points of RRT shown in Figure 7(a) are
let N be the number of points which are visible from
used as input data. The points are expressed by the
V i and M be the number of points which are visible
same symbol if they belong to the same cluster. Note
that clusters calculated using this algorithm are of
different sizes.
Moreover, in order to see the structure of the
Vi
Vi+1
configuration space, we examine the neighboring
pairs of clusters. A pair of clusters, C and C' , i s
called a neighboring pair if D (C, C' ) is smaller
than a certain constant. Each edge in Figure 10
Figure 11. Path visibility
1.00
0.80
0.60
0.40
0.20
0.00
visibility rate
visibility rate
visibility rate
1.00
0.80
0.60
0.40
0.20
0.00
1 2 3 4 5 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
points Vi
points Vi
points Vi
Figure 12.
1.00
0.80
0.60
0.40
0.20
0.00
Path visibility rate for the optimized paths: Alpha (left), Dalpha (center), Devil (right)
from both V i and V i + 1 .
determining the features of problems. However,
The visibility rate at V i is defined as M/N. We
since other important criteria might exist, our
calculated the visibility rate for the optimized paths
future work will investigate other criteria for
of the 3 puzzle rings and presented them in Figure
determining the features of high-dimensional path
12. The results indicate that Dalpha has a lowe r
planning problems.
visibility rate than both Alpha and Devil. The lower
the visibility rate, the more difficult it becomes to
Acknowledgements
go back to the optimized path once we have moved
We thank Hanay ama Co., Ltd. for helpful comments.
away from it. In the experiment described in Section
This
4.1, the time needed to solve Dalpha on the 2
the 3
rd
nd
and
research
Grant-in-Aid
was
for
supported
Private
in
University
part
by
a
High-Tech
trial did not decrease, in contrast with the
Research Centers, and a Grant-in-Aid from the
case for Devil, which can be explained well throug h
Ministry of Education, Culture, Sports, Science and
the visibility rates of the optimized paths. Therefore,
Technology, Japan.
the
path
visibility
rate
can
be
related
to
the
References
difficulty factor F2.
5. Conclusion
The following points have been made in this paper.
z
There are two difficulty factors: F1, which
indicates
the
difficulty
of
estimating
a
solution path, and F2, which represents the
difficulty of moving the rings along the
solution path.
z
The path complexity and the configuration
space complexity are related to F1. The pat h
visibility rate is related to F2.
Although only three puzzle rings were used in the
experiments, the above points are applicable to
many other puzzle rings. Therefore, these three
features of the configuration space are useful when
rating the difficulty of puzzle rings in general. On
the other hand, other than puzzle rings, there are
many kinds of high-dimensional path planning
problems, as well as a variety of path planning
algorithms. Therefore, an appropriate algorithm
needs to be chosen among them when solving a
problem, and it is necessary to know the features o f
the problem in order to make the right choice. Pat h
complexity, configuration space complexity and
path
visibility
might
be
useful
criteria
for
[ 1 ] S . M . L a v a ll e , P l an n i n g A lg o r i th ms , C a mb r i d g e U n iv.
P r. , 2 0 0 6 .
[ 2 ] J . C . L a to mb e , R o b o t M o t io n P l an n in g , Kl u w e r
A c ad e mi c P u b l is h e r s , B o s t o n , M A , 1 9 9 1 .
[ 3 ] M . B e rg , M . K r ev e l d , M . O v e r ma r s , O . S c h w a r zk o p f ,
Co mp u t a t io n al G eo me t r y, Sp r i n g e r- Ve r l a g B e r l in
H e i d e l b e rg , 1 9 9 7 .
[ 4 ] J . J . K u ff n e r, S . M . L a Va l l e , R RT- co n n e c t : A n
eff i ci e n t a p p r o a ch to si n g l e -q u e r y p a th p l an n i n g . In
P ro c . I E E E I n t ' l C o n f . o n R o b o ti c s an d Au t o ma t i o n ,
p p .9 9 5 - 1 0 0 1 , 2 0 0 0 .
[ 5 ] N M . A ma t o , O . B . B a y a z i t , L . K . D a l e , C . J o n e s ,
an d D . Va l l e jo , Ch o o s in g G o o d Di s t an c e M e t r i c s an d
L o c al P l a n n e r s f o r P r o b a b l is t i c Ro a d ma p M e th o d s .
I E E E Tr a n s a c t io n s o n R o b o t i cs an d Au to ma t i o n ,
v o l .1 6 , n o .4 , p p . 4 4 2 -4 4 7 , Au g u s t 2 0 0 0 .
[ 6 ] P. I s t o , A P a r a l l el M o t i o n P l an n e r f o r S y s t e ms w i t h
M a n y D eg r e e s o f F r e ed o m, I n t e rn a t io n al Co n f e r e n c e
o n Ad v a n c ed R o b o t i cs , p p . 3 3 9 -3 4 4 , 2 0 0 1 .
[ 7 ] H . Ak i y a ma , Ch i en o - w a Do k u h o n , S h i n k ig en - s y a
L td . , 2 0 0 3 ( i n J ap an e s e ) .
[ 8 ] A . K a w au c h i , Kn o t T h eo r y, Sp r i n g e r- Ve r l a g To k y o ,
1 9 9 0 ( in J ap a n e se ) .
[ 9 ] T. B an c h o ff , S e lf L in k i n g Nu mb e r o f Sp a c e Po l y g o n s ,
I n d i an a Un iv e r s it y M a t h e ma t i cs J o u r n a l , v o l . 2 5 ,
n o .1 2 , 1 9 7 6 .
[ 1 0 ] S . M . L a Va l l e , R ap id l y - e x p l o ri n g r a n d o m t r e es : A
n e w to o l f o r p a t h p la n n i n g . T R 9 8 - 11 , C o mp u te r
S c i en c e D ep t . , I o w a St a t e Un i v e r s i t y, O c t . 1 9 9 8 .
[ 1 1 ] H . E r a , M . Ts u c h i y a , G r a p h T h eo r y, S a n g y o - to sh o ,
1 9 9 6 ( in J ap a n e se ) .
[ 1 2 ] T. K a mi s h i ma , A S u rv e y o f R e c en t C l u s t e r in g
M e th o d s f o r D a t a M in in g ( P a r t 1 ) , Jo u rn a l o f th e
J ap an e s e S o c i e t y f o r A r t if i c i a l In t e ll i g en c e , v o l . 1 8 ,
n o .1 , p p . 5 9 - 6 5 , 2 0 0 3 ( in J ap a n e s e ) .