Designing Algorithms for the Shortest Path Reconﬁguration Problem
Using Decision Diagram Operations
Shou Ooba, Jun Kawahara
a
and Shin-ichi Minato
b
Graduate School of Informatics, Kyoto University, Japan
Keywords:
Decision Diagrams, Reconﬁguration Problem, Shortest Path, Graph Algorithm.
Abstract:
This paper proposes decision diagram (DD)-based algorithms for the (edge-unweighted) shortest s-t path
reconﬁguration problem. In the problem, given a graph and two shortest s-t paths, the task is to decide
whether one shortest path can be transformed into the other one by repeatedly applying the reconﬁguration
rule to the path, where the reconﬁguration rule is to change one vertex of the path at a time while maintaining
shortest s-t paths. We propose several DD-based algorithms for the problem and conﬁrm their performance
by computer experiments. We succeeded in ﬁnding a shortest reconﬁguration sequence with length 961,012
in 629.0 seconds for some instance.
1 INTRODUCTION
A combinatorial reconﬁguration problem is a prob-
lem in which two solutions of a combinatorial opti-
mization problem are given, and one solution is trans-
formed into the other one according to a given rule.
The task is to determine whether it can be transformed
from one to the other while satisfying that the in-
termediate states are also feasible. Taking the token
jumping model of the independent set reconﬁguration
problem (Ito et al., 2011) as an example, given a graph
G and two independent sets I
s
and I
t
of G, the rule is
to arbitrarily remove one element from the indepen-
dent set and arbitrarily add one element to it at the
same time, and to determine whether it is possible to
transform I
s
to I
t
, while maintaining the generated sets
being independent.
Combinatorial reconﬁguration is a young research
area (Ito et al., 2011; Nishimura, 2018). Accord-
ing to the web survey
1
on combinatorial reconﬁgura-
tion, 69 papers on combinatorial reconﬁguration have
been published, including the independent set recon-
ﬁguration problem (Ito et al., 2011) and the graph
coloring reconﬁguration problem (Bonsma and Cere-
ceda, 2009). Reconﬁguration problems can be viewed
as problems of changing the conﬁguration of a so-
cial system without stopping it, such as changing the
a
https://orcid.org/0000-0001-7208-044X
b
https://orcid.org/0000-0002-1397-1020
1
https://www.ecei.tohoku.ac.jp/alg/coresurvey/
switch conﬁguration of a power distribution network
to prevent power outages. However, many reconﬁgu-
ration problems, including the independent set recon-
ﬁguration, are known to be PSPACE-complete in gen-
eral (Ito et al., 2011; Nishimura, 2018), and it may be
hard to solve such problems in practically acceptable
time.
Under such circumstances, CoRe Challenge
2022 (Soh et al., 2022), a programming competition
for reconﬁguration, was held. Some 369 instances
of the independent set reconﬁguration problem were
provided and 10 solvers participated, including SAT-
2023), model checking-based (Toda et al., 2023), and
AI planning-based solvers (Christen et al., 2023).
Some of the solvers successfully solved instances
consisting of graphs with several hundreds of vertices.
There exists a data structure called the Zero-
suppressed binary Decision Diagram (ZDD) (Minato,
1993) that efﬁciently represents a family of sets; a
solver for the reconﬁguration problem using ZDDs
also participated in the competition (Ito et al., 2023).
This solver is particularly good at instances where
the shortest reconﬁguration length is very long, and
has successfully solved instances that no other solver
has been able to solve. According to the paper (Ito
et al., 2023), the ZDD solver succeeded in obtaining
the shortest reconﬁguration sequence for an instance
consisting of a graph with 247 vertices, 1,578 edges
and shortest reconﬁguration length of 5,767,157. As
long as the family of objects that we want to trans-
Ooba, S., Kawahara, J. and Minato, S.
Designing Algorithms for the Shortest Path Reconﬁguration Problem Using Decision Diagram Operations.
DOI: 10.5220/0012379900003636
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 16th International Conference on Agents and Artiﬁcial Intelligence (ICAART 2024) - Volume 3, pages 641-648
ISBN: 978-989-758-680-4; ISSN: 2184-433X
Proceedings Copyright © 2024 by SCITEPRESS – Science and Technology Publications, Lda.
641
form is represented as a ZDD, the ZDD solver can
compute the shortest reconﬁguration sequence under
the token jumping model; that is, the rule of removing
one element and adding one element at the same time.
Their paper (Ito et al., 2023) designed a ZDD-based
algorithm that works only under the token jumping
model, using so-called ZDD operations. However,
there are some reconﬁguration rules (models) that are
more complex than it. If we would like to apply
the ZDD-based technique to reconﬁguration problems
under such rules, we need to design other ZDD oper-
ations.
In this paper, we treat the shortest s-t path recon-
ﬁguration problem, where each edge is unweighted;
that is, all the edges have unit length one. In the prob-
lem, given a graph and two shortest s-t paths, the task
is to decide whether one shortest path can be trans-
formed into the other one by repeatedly applying the
reconﬁguration rule to the path, where the reconﬁg-
uration rule is to change one vertex of the path at a
time while maintaining shortest s-t paths. We propose
several ZDD-based algorithms for the problem by de-
signing ZDD operations. We conducted computer ex-
periments to compare them, and succeeded in ﬁnd-
ing a shortest reconﬁguration sequence with length
961,012 in 629.0 seconds for some instance.
The paper is organized as follows. In Sec. 2, pre-
liminaries for reconﬁguration problems, ZDDs, and
a ZDD-based framework for solving reconﬁguration
problems are provided. Sec. 3 describes ZDD-based
algorithms. The results of computer experiments are
shown in Sec. 4. We conclude the paper in Sec. 5.
2 PRELIMINARIES
We denote by U + a the addition to a set U , i.e.,
U {a}. We also denote by U a and U U
0
the
removal of an element a and all the elements in U
0
from a set U, i.e., U \ {a} and U \ U
0
, respectively.
For a graph G = (V,E), we denote by uv E an edge
whose endpoints are u,v V .
2.1 Reconﬁguration Problems
Let F be the set of feasible solutions of a combina-
torial problem. By ﬁxing some reconﬁguration rule,
the adjacency relation between two solutions in F is
determined. Given F and two solutions S,T F ,
the reconﬁguration problem of (F ,S,T ) asks us to
decide whether there is a reconﬁguration sequence
S = F
0
,F
1
,F
2
,. . .,F
`
= T such that F
i
F holds for
i = 0, 1, ...,` and F
i
and F
i+1
0,1, . ..,` 1 under the given adjacency relation.
Let us consider the token jumping model of the
independent set reconﬁguration as an example. In
the token jumping model, two independent sets I
and I
0
are adjacent if |I \ I
0
| = |I
0
\ I| = 1. Given
a graph G and two independent sets S and T of
G, the independent reconﬁguration problem asks to
decide whether there is a reconﬁguration sequence
S = I
0
,I
1
,I
2
,. . .,I
`
= T such that I
0
,I
1
,. . .,I
`
all are
independent and I
i
and I
i+1
are adjacent for all i =
0,1, . ..,` 1.
2.2 ZDD
ZDD is a data structure for compactly representing
the family of sets. We brieﬂy explain the charac-
teristics of ZDD (Minato, 1993). In this subsection,
assume that the universe set of families represented
by ZDDs is U = {x
1
,. . .,x
n
} and the elements are or-
dered as x
1
< ··· < x
n
. A ZDD Z is a directed acyclic
graph that has two nodes with outdegree 0, called 0-
and 1-terminals, and one node with indegree 0, called
root, and denoted by root(Z). The outdegree of each
non-terminal nodes is two; the arcs are called 0- and
1-arc. Each non-terminal node ν has a label, one of
x
1
,. . .,x
n1
or x
n
, which we denote by label(ν). For
non-terminal nodes ν and ν
0
, if ν points at ν
0
by its 0-
or 1-arc, label(ν) < label(ν
0
) must hold.
We interpret that a ZDD represents the fam-
ily of sets in the following manner: We con-
sider a route from the root to 1-terminal, say
ν
1
,a
1
,ν
2
,a
2
,. . .,ν
k
,a
k
,ν
k+1
, where ν
i
is a non-
terminal node for i = 1, ...,k, a
i
is a 0- or 1-arc of
ν
i
and ν
k+1
is 1-terminal. Then, the route represents
the set {label(ν
i
) | a
i
is 1-arc}; that is, collecting the
labels of the nodes each of whose outgoing arc on the
route is 1-arc. A ZDD represents the family of sets
each of which is represented by a route from the root
to 1-terminal. For a ZDD Z, the family of sets repre-
sented by Z is denoted by S(Z).
A ZDD has the following recursive structure.
Given a ZDD Z, consider the root node ν of Z and
the nodes pointed by 0- and 1-arcs of ν, which we
denote by ν
0
and ν
1
, respectively. Then, for i = 0,1,
we consider a directed graph consisting of the nodes
and arcs reachable from ν
i
. The graph can be re-
garded as a ZDD whose root is ν
i
and we denote it by
child
i
(Z). The ZDDs child
0
(Z) and child
1
(Z) repre-
sent the family of sets in S(Z) not including the label
of root(Z) and the family of sets in S(Z) including
the label of root(Z), respectively.
We use the following operations, which are efﬁ-
ciently performed by recursive algorithms. See the
book (Knuth, 2011) for detail. Let F , G be ZDDs,
and a be an element in U.
ICAART 2024 - 16th International Conference on Agents and Artiﬁcial Intelligence
642
F G, F G, and F \ G are ZDDs
representing the union, intersection, and
subtraction of S(F ) and S(G), respec-
tively; that is,
{
F
|
F S(F ) or F S (G)
}
,
{F | F S(F ) and F S(G)}, and
{F | F S (F ) and F / S (G)} (Bryant, 1986;
Minato, 1993; Knuth, 2011).
Operation subset1(F ,a) is a ZDD representing
the family of sets obtained by extracting the sets
containing a from S(F ) and removing a from the
sets; that is, {S a | S S(F ), S 3 a} (Minato,
1993).
Operation multip(F ,a) is a ZDD representing the
family of sets obtained by adding a to each set in
S(F ); that is, {S + a | S S(F )} (Okuno et al.,
1998).
Operation restrict(F ,G) is a ZDD represent-
ing the family of sets obtained by extract-
ing the sets from S(F ) each of which com-
pletely subsumes a set in S(G); that is,
{
F F
|
G G,G F
}
(Okuno et al., 1998).
2.3 ZDD-Based Algorithmic
Framework for Reconﬁguration
Problems
Ito et al. (Ito et al., 2023) proposed a ZDD-based algo-
rithmic framework for solving reconﬁguration prob-
lems. We explain the framework taking the token
jumping model of the independent set reconﬁguration
as an example. First, we construct a ZDD represent-
ing the family of solutions. In the case of the inde-
pendent set reconﬁguration, we construct the ZDD,
say Z
sol
, representing the family of all the indepen-
dent sets of a given graph. This can be performed by
an existing algorithm (Hayase et al., 1995). Then, for
a ZDD Z, let swap
I
(Z) be the ZDD representing
{U + v v
0
| U S (Z),v I \U, v
0
U}.
This is the family of sets obtained by applying the re-
conﬁguration rule (removing one element and adding
another element) to each set in S(Z) and collecting
all the possible resulting sets. Let Z
i
be the family of
sets obtained by applying the reconﬁguration rule to
S, i times, where Z
0
is the ZDD representing {S}. Z
i
can be computed by Z
i
= swap
I
(Z
i1
) Z
sol
. Since
S(swap
I
(Z
i1
)) includes not independent sets, we ex-
clude them by “ Z
sol
,” which can be performed by a
ZDD operation described in Sec. 2.2. By computing
Z
i
for i = 1,2,... , and checking whether T S(Z
i
),
we can ﬁnd a shortest reconﬁguration sequence from
S to T . If S(Z
i
) =
/
0 for some i, there is no reconﬁgu-
ration sequence.
Instead explaining the construction of swap
I
(Z),
we explain how to compute remove(Z), a ZDD for
{U v | U S(Z),v U}
because remove(Z) is easier than swap
I
(Z) and
swap
I
(Z) can be computed in similar to the way
for remove(Z). The algorithm uses the recursive
structure of ZDDs. Let x = root(Z). We divide
S(remove(Z)) into two groups: (i) sets including x
and (ii) sets not including x. Group (i) can be obtained
by collecting the sets obtained by removing some el-
ement other than x from each set including x in S(Z).
The ZDD representing the family of group (i) can be
constructed by recursively calling remove(F
1
), where
F
1
= child
1
(Z), because child
1
(Z) is the family of
sets containing x (see the description of the recursive
structure in Sec. 2.2). Group (ii) is further divided into
two subgroups: (ii-1) the sets obtained by removing
some element from each set not including x in S(Z),
and (ii-2) the sets obtained by removing x from each
set including x in S(Z). The ZDD for (ii-1) is con-
structed by recursively calling remove(child
0
(Z)),
and that for (ii-2) is exactly child
1
(Z). The ZDD for
(ii) is the union of the ZDDs (ii-1) and (ii-2). Let
F
0
= remove(child
0
(Z)) child
1
(Z). Therefore, the
ZDD for remove(Z) is constructed as follows: First,
we construct F
0
and F
1
by recursive calls. Then, we
create a node labeled x and make its 0-arc and 1-arc
point at the roots of F
0
and F
1
, respectively.
I
operation is deﬁned by the ZDD repre-
senting
{U + v | U S(Z),v / U,v I},
which can be computed similarly. We need index I
because we need to specify what we add to a set. The
swap
I
operation can also be performed similarly. Re-
fer to the paper (Ito et al., 2023) for detail.
3 SHORTEST s-t PATH
RECONFIGURATION
PROBLEM
We begin with the deﬁnition of the shortest s-t path re-
conﬁguration problem (Kami
´
nski et al., 2011), where
each edge is unweighted. Given an edge-unweighted
undirected simple graph G and two s-t paths S and T
of G, the problem asks us to decide whether there is
a reconﬁguration sequence P
0
= S, P
1
,P
2
,. . .,P
`
= T ,
where P
i
is an s-t path for i = 0,...,` and two s-
t paths P
i
and P
i+1
have all common edges except
two edges and all common vertices except one ver-
tex. This problem is shown to be PSPACE-complete
Designing Algorithms for the Shortest Path Reconﬁguration Problem Using Decision Diagram Operations
643
in general, but can be solved in polynomial-time if
the input graph G is a planar graph (Kami
´
nski et al.,
2011).
To apply the ZDD-based framework to the short-
est s-t path reconﬁguration, we ﬁrst represent the so-
lution space as a ZDD, and then we design recursive
ZDD operation(s) to obtain Z
i
from Z
i1
, which we
deﬁne in Sec 2.3.
Let us consider what variables of ZDDs are. A
path on a graph is uniquely speciﬁed by its edge set.
Therefore, we can represent the solution space by the
family of edge sets each of which consists of a path.
Our ﬁrst direction is to make the edges of G the vari-
ables of ZDDs, which we call edge variables.
We can consider another direction of ZDD vari-
ables by using the characteristics of shortest paths.
Once the input graph G and the input vertices s and
t are ﬁxed, the shortest distance from s to each ver-
tex can be easily determined by ordinary breadth ﬁrst
search. We partition V into V
0
,. . .,V
n1
, where V
i
is
the set of vertices to which the length of a shortest
path from s is i for i = 0,... , d (recall that we assume
that the weights of all the edges of G are 1). Then,
any s-t shortest path P can be uniquely speciﬁed by
v
0
= s, v
1
,. . .,v
d1
,v
d
= t, where d is the length of
any shortest s-t path, and v
i
V
i
for i = 0,. . .,d. This
implies that the set {v
0
,v
1
,. . .,v
d
} can uniquely rep-
resent an s-t path. Our second direction is to make the
vertices of G the variables of ZDDs, which we call
vertex variables.
In the setting of edge variables, we can use
frontier-based search for representing various objects
such as s-t paths, cycles, spanning trees, matchings,
as ZDDs (Kawahara et al., 2017). Therefore, the edge
variable direction can solve various reconﬁguration
problems. On the other hand, the vertex variable di-
rection highly depends on the structure of shortest s-t
paths, and thus it is specialized to solve the shortest
s-t path reconﬁguration problem. As we will show in
the experiment section, the vertex variable direction
is faster than the edge variable direction for almost all
instances, although the results are omitted due to the
space limitation. The rest of the section is devoted
to solving the shortest s-t path reconﬁguration using
edge variable ZDDs and vertex variable ZDDs.
3.1 Algorithms on Edge Variables
Kawahara et al. (Kawahara et al., 2017) proposed an
algorithm to construct a ZDD representing the fam-
ily of all the s-t paths of a given graph G and given
vertices s,t of G, where ZDD variables are edge
variables, which we denote by Z
path
. It is easy to
construct a ZDD representing the family of all the
sets whose cardinality is exactly k, which we de-
note by Z
=k
(Knuth, 2011). Therefore, by comput-
ing Z
path
Z
=d
, we obtain the solution space ZDD
Z
sol
, which represents the family of all the s-t short-
est paths of G, where ‘ is the intersection operation
of ZDDs (Bryant, 1986), described in Sec. 2.2.
Next, we show how to construct the ZDD Z
i
from
Z
i1
. First, we design a naive algorithm. We consider
a cycle x, u, y,v,x of G with length four. We extract
all the sets including xu and uy from S(Z
i1
), remove
xu and uy from each extracted set, and add xv and vy
to each of them. Each obtained edge set consists of a
shortest s-t path transformed from a path in S (Z
i1
).
We conduct the process for all cycles with length four
and take the union of all of them. Thus, we obtain
Z
i
=
[
xu,uy,xv,vyE
multip(multip(subset1(
subset1(Z
i1
,xu), uy), xv), vy),
where multip and subset1 are described in Sec. 2.2.
Note that for a ZDD Z, subset1(Z,a) conducts both
the extraction of the sets containing a from S(Z) and
removing a. The symbol ’ is the union operation of
ZDDs, described in Sec. 2.2. Since the above equa-
tion computes the union O(n
4
) times, the computation
is not efﬁcient. In the following, we propose ﬁve al-
gorithms to compute it. Their efﬁciency will be com-
pared by computer experiments in Sec. 4.
Remove-Add Algorithm. It is natural to consider
the use of remove(Z) and add
I
(Z), which removes
and adds one arbitrary element from and to S(Z), re-
spectively. In the setting of edge variables, to trans-
form a shortest s-t path, we remove two edges and add
another two edges. One might think that if we remove
arbitrary two edges by calling remove twice and add
arbitrary two edges by calling add twice, some gen-
erated results would not consist of a (shortest) path.
However, such not (shortest) paths can be eliminated
by the intersection operation of Z
sol
(the ZDD for the
family of edge sets consisting of shortest s-t paths).
Therefore, we have
Z
i
E
E
(remove(remove(Z
i1
)))) Z
sol
.
Moreover, we can design new operations that con-
duct remove k times at once, and that conduct add
I
k
times at once:
remove(F ,k) =
{
F X
|
X F F ,
|
X
|
= k
}
,
I
(F ,k) = {F X | F F , X F =
/
0,
X I,
|
X
|
= k}.
Algorithms that compute remove(F ,k) and
I
(F ,k) will be designed later. Using them,
we obtain
Z
i
E
(remove(Z
i1
,2), 2) Z
sol
,
ICAART 2024 - 16th International Conference on Agents and Artiﬁcial Intelligence
644
which we call the remove-add algorithm. Note that
S(Z
i
) includes paths each of which is completely
equal to a path in S(Z
i1
), which violates our recon-
ﬁguration rule, but it does not affect the decision of
the existence of a reconﬁguration sequence and com-
puting a shortest reconﬁguration sequence.
Remove-Restrict and Remove-Restrict-k Algo-
trary two edges after removing two edges. It generates
a huge number of edge sets consisting of non-paths
(although they are compactly represented as a ZDD).
The algorithm proposed here adds two edges so that
the resulting edge sets consist of paths. This can be
performed using the restrict operation, described in
Sec. 2.2, as follows:
Z
i
= restrict(Z
sol
,remove(Z
i1
,2)),
which we call the remove-restrict algorithm. Re-
call that the deﬁnition of restrict. Each edge set
E
0
S(restrict(Z
sol
,remove(Z
i1
,2))) is a member
of S(Z
sol
) such that there exists an edge set X
S(remove(Z
i1
,2)) satisfying X E
0
. This means
that we ﬁrst remove two edges from S(Z
i1
) (the re-
sulting set is X), and then add edges to X (the resulting
set is E
0
) so that E
0
is in S(Z
sol
); i.e., E
0
consists of a
shortest s-t path.
We know the size of E
0
is larger than that of X by
two. By using the fact, we expect to accelerate the
computation. We propose a new operation:
restrict(F ,G, k) = {F F | G G,
G F,
|
F G
|
= k}.
The computation of it and the reason this makes the
computation faster will be shown later. By using the
extended restrict operation, we write
Z
i
= restrict(Z
sol
,remove(Z
i1
,2), 2),
which we call the remove-restrict-k algorithm.
Dist Algorithm. In the remove-restrict and remove-
restrict-k algorithms, we ﬁrst call remove(Z
i1
,2).
Here, we consider to compute remove and restrict at
once. We propose a new operation, called dist:
dist(F ,G, k) =
{
F F
|
G G,
|
F G
|
= k
}
,
where F G = (F G) (G F). This operation ex-
tracts the sets F from S(F ) such that the hamming
distance between F and a set G in S(G) is k. Using
the operation, we compute Z
i
as follows:
Z
i
= dist(Z
sol
,Z
i1
,4),
which we call the dist algorithm.
Delta Algorithm. Knuth (Knuth, 2011) proposed in
his book “The art of computer programming” a ZDD
operation, called delta:
delta(F ,G) =
{
F G
|
F F ,G G
}
.
Using delta, we can compute Z
i
. First, we con-
struct the ZDD C representing the family of edge sets
each of which consists of a cycle with length four by
frontier-based search (Kawahara et al., 2017). Then,
we compute
Z
i
= Z
sol
delta(Z
i1
,C ),
which we call the delta algorithm.
3.2 Algorithms on Vertex Variables
First, we construct the solution space ZDD Z
sol
when
the ZDD variables are the vertices of the input graph
G = (V,E). For i = 0,. . .,d, exactly one vertex in V
i
is included in a shortest s-t path. Let V
i
be the ZDD
for the family of sets containing exactly one vertex in
V
i
and arbitrary vertices in V V
i
; that is,
S(V
i
) =
{
X V
i
|
|X| = 1
}
{
X
|
X V V
i
}
.
Two vertices that are not adjacent on G cannot be in-
cluded in a shortest s-t path. Let X
uv
be the ZDD
for the family of sets containing both u and v; that
is, S(X
uv
) =
{
X V
|
X {u,v}
}
.
Z
sol
=
\
i=0,...,d
V
i
!
\
[
u,vV,uv/E
X
uv
.
The ZDDs V
i
and X
uv
can be easily constructed and
the above equation can be computed by ZDD opera-
tions. Therefore, we can construct the ZDD Z
sol
.
Next, we describe how to construct Z
i
from Z
i1
.
This is similar to the edge variable algorithms. The
main difference of them is to remove and add one
variable in the setting of vertex variables. We propose
the following algorithms:
Naive algorithm:
Z
i
=
[
u,vV
multip(subset1(Z
i1
,u), v)
!
Z
sol
,
Z
i
V
(remove(Z
i1
)) Z
sol
,
Remove-restrict algorithm:
Z
i
= restrict(Z
sol
,remove(Z
i1
,1)),
Remove-restrict-k algorithm:
Z
i
= restrict(Z
sol
,remove(Z
i1
,1), 1),
Dist algorithm: Z
i
= dist(Z
sol
,Z
i1
,2),
Delta algorithm: Z
i
= Z
sol
delta(Z
i1
,C
0
),
where C
0
is the ZDD for the family of all the subsets
of V whose cardinality is two.
Designing Algorithms for the Shortest Path Reconﬁguration Problem Using Decision Diagram Operations
645
3.3 Recursive Operations
In this subsection, we show how to con-
duct the recursive operations described in
the previous subsections. First, we explain
remove(F ,k) =
{
F X
|
X F F ,
|
X
|
= k
}
.
If k = 0, remove(F , 0) = F . We consider the case of
k > 0. Let x = root(F ). We create a node labeled x
and make its 0-arc and 1-arc point at the ZDDs F
0
and F
1
, explained below, respectively.
F
0
and F
1
can be constructed by
F
0
remove(child
0
(F ),k)
remove(child
1
(F ),k 1),
F
1
remove(child
1
(F ),k).
The second term remove(child
1
(F ),k 1) in the ﬁrst
equation means that x is removed and k 1 elements
other than x will be removed in the recursive call. We
omit the explanation of the termination in the recur-
sion.
I
(F ,k) = {F X | F F ,X F =
/
0,X
I,
|
X
|
= k} operation can be computed similarly. We
show just F
0
and F
1
as follows: If x / I, we have
F
0
I
(child
0
(F ),k),
F
1
I
(child
1
(F ),k).
If x I, we obtain
F
0
Ix
(child
0
(F ),k),
F
1
Ix
(child
1
(F ),k)
Ix
(child
0
(F ),k 1).
Next, we consider
restrict(F ,G, k) = {F F | G G,
G F,
|
F G
|
= k}.
F
0
and F
1
can be obtained by
F
0
restrict(child
0
(F ),child
0
(G),k),
F
1
restrict(child
1
(F ),child
1
(G),k)
restrict(child
1
(F ),child
0
(G),k 1).
Finally, we consider
dist(F ,G, k) =
{
F F
|
G G,
|
F G
|
= k
}
.
F
0
and F
1
can be obtained by
F
0
dist(child
0
(F ),child
0
(G),k)
dist(child
0
(F ),child
1
(G),k 1),
F
1
dist(child
1
(F ),child
1
(G),k)
dist(child
1
(F ),child
0
(G),k 1).
4 COMPUTER EXPERIMENTS
We conducted computer experiments on N × N grid
graph instances, the instances provided by the pa-
per (Kami
´
nski et al., 2011), and randomly generated
instances. For grid graph instances, we implemented
and measured a polynomial-time solution method for
planar graphs as a comparison with the proposed
method (Bonsma, 2017). The N × N grid graph in-
stance, denoted by gridN, has N
2
vertices, 2N(N 1)
edges, and a shortest reconﬁguration sequence with
length (N 1)
2
. We set s and t to be the upper-left and
lower-right corners of a grid graph. We set the start
and goal shortest s-t paths to be the path consisting
of the uppermost and rightmost edges via the upper
right corner, and the path consisting of the leftmost
and lowermost edges via the lower left corner, respec-
tively. The instances provided by the paper (Kami
´
nski
et al., 2011) are used for proving that the shortest
s-t reconﬁguration is PSPACE-complete. Each of
the instances has a parameter N, which we denote
by expN. It has 13N + 2 vertices, 36N 11 edges,
and a shortest reconﬁguration sequence with length
11(2
N
1). As for the randomly generated instances,
we generate random graphs by randomly adding ver-
tices to V
0
,V
1
,. . .,V
d
for a given integer d and ran-
domly connecting vertices between V
i
and V
i+1
. We
pick up the generated instances whose execution time
was the ﬁfth longest, denoted by random5, random6,
random9, random10, random11. The features of the
instances are shown in Table 1.
Table 1: Features of input graphs. The length of a shortest
s-t path reconﬁguration sequence is shown as `.
Instance |V | |E| `
grid10x10 100 180 81
grid20x20 400 760 361
grid30x30 900 1740 841
grid40x40 1600 3120 1521
grid50x50 2500 4900 2401
grid60x60 3600 7080 3481
exp6 80 205 891
exp8 106 277 3696
exp10 132 349 14949
exp12 158 421 59994
exp14 184 493 240207
exp16 210 565 961092
random5 470 1887 113
random6 482 1938 111
random9 385 2971 38
random10 437 3423 34
random11 458 3676 41
Due to the memory limitation, we did not restore
a shortest reconﬁguration sequence, but measured the
ICAART 2024 - 16th International Conference on Agents and Artiﬁcial Intelligence
646
Table 2: Results for vertex variable (in seconds). ’ means timeout (exceeding 1000 seconds).
Instance Naive Remove-add Remove-restrict Remove-restrict-k Dist Delta
grid10x10 0.1 0.1 < 0.1 < 0.1 < 0.1 < 0.1
grid20x20 67.4 4.5 1.3 0.4 0.5 1.7
grid30x30 47.5 14.7 5.0 6.5 17.0
grid40x40 208.3 69.3 37.4 55.7 89.3
grid50x50 571.4 241.7 173.9 323.1 331.8
grid60x60 684.2 509.4 945.5
exp6 0.6 0.3 0.2 0.1 0.1 0.1
exp8 6.9 2.1 2.0 0.3 0.4 0.7
exp10 48.3 12.3 11.9 2.6 2.1 4.1
exp12 323.1 66.1 61.4 14.7 12.1 22.8
exp14 314.6 300.7 68.6 60.0 105.4
exp16 351.8 291.3 500.1
random5 143.7 390.0 34.1 731.4 346.1
random6 19.6 45.4 7.2 189.5 35.9
random9 49.7 61.5 269.2
random10 323.6 777.6
random11 656.3 73.8 199.8 53.2
time taken to ﬁnd the length of a shortest sequence.
However, since the polynomial-time method for pla-
nar graphs cannot ﬁnd the length of a shortest recon-
ﬁguration sequence, we measured the time taken to
determine the reachability. The time required to em-
bed a planar graph into a plane was not measured in
the polynomial-time method for planar graphs. Due
to the space limitation, we omit the experimental re-
sults for the edge variable method. Results for the
vertex variable method and the polynomial-time al-
gorithm (Bonsma, 2017) are shown in Tables 2, and
3, respectively. The values in the table represent the
execution time in seconds, in particular, <0.1 means
that the solution was completed in less than 0.1 sec-
ond.
For the vertex variable setting, remove-restrict-
k was the fastest for both instances. The remove-
restrict was almost as fast as the dist algorithm in
the grid graph instance, but in the exponential in-
stance, remove-restrict was about three times slower
in the largest case, and the delta algorithm was faster
in the largest case. The remove-add algorithm was
the fastest after rem+restrict and delta, and the slow-
est was the naive algorithm. Comparing the speed of
the same type of algorithms between vertex and edge
variables, the vertex variable was faster in both cases.
The polynomial-time algorithm for planar graphs
are considerably faster than other algorithms. How-
ever, considering that it is not possible to ﬁnd the
shortest reconﬁguration sequence length or the short-
est reconﬁguration sequence, and that it can only be
used on planar graphs, the proposed algorithms with-
out these restrictions can also be considered valuable.
The reason why the remove-restrict, remove-
restrict-k, and dist algorithms are relatively fast is that
they ﬁnd Z
i
by ZDD operations with Z
sol
, which has a
small number of nodes. The remove-add and delta al-
gorithms are fast once the remove-add and delta algo-
rithms generate a set that includes combinations that
may not necessarily be a shortest s-t path and then
intersect with Z
sol
, which may result in many unnec-
essary (non shortest s-t path) combinations. However,
for the delta algorithm, it is easy to reduce the num-
ber of unnecessary combinations by limiting the ver-
tex variables to pairs of u,v in the same V
i
or limit-
ing the edge variables to four edges that form a cycle.
The remove-add algorithm is considered to be slower
because it takes into account a large number of unnec-
essary combinations, especially when k, the argument
In both cases, the remove-restrict-k algorithm is
faster than the remove-restrict algorithm. This is be-
cause the restrict(F ,G,k) operation is equivalent to
the product set operation at k = 0. When k > 0, the
child pointed to by the 1-arc of restrict(F ,G, k) is
restrict(F
1
,G
1
,k)restrict(F
1
,G
0
,k 1). In particu-
lar, when k = 1, the second term is replaced by the
product set F
1
G
0
. On the other hand, the child
pointed to by the 1-arc in the restrict(F ,G) operation
is computed as restrict(F
1
,G
1
) restrict(F
1
,G
0
). In
general, the restrict(F ,G,k) operation is faster than
the restrict(F , G) operation because the product set
operation is lighter than the restrict(F , G) operation.
However, the addition of k to the argument may re-
duce the cache hit ratio. In other words, the larger k
is, the smaller the speedup effect is, and it should be
noted that the restrict(F , G) operation may be more
efﬁcient in some cases.
Designing Algorithms for the Shortest Path Reconﬁguration Problem Using Decision Diagram Operations
647
In conclusion, the remove-restrict-k and dist algo-
rithms in the vertex variable seem to be the best for
the shortest s-t path reconﬁguration problem.
Table 3: Results for the polynomial time algorithm for pla-
nar graphs.
Instance Time (sec.)
grid20x20 < 0.1
grid40x40 < 0.1
grid60x60 0.1
grid80x80 0.3
grid100x100 0.7
5 CONCLUSION
In this paper, we have proposed several algorithms for
the shortest s-t path reconﬁguration problem. All of
them are based on DD operations. Computer experi-
ments were conducted to compare these algorithms.
We believe that the value of this study is that it
showed that ZDD operations can solve combinatorial
reconﬁguration problems under various rules. Future
work includes considering what rules of combinato-
rial reconﬁguration problems our method can be ap-
plied to.
ACKNOWLEDGEMENTS
This work was partially supported by JSPS KAK-
ENHI Grant Numbers JP20H00605, JP20H05794,
JP20H05964, and JP23H04383.
REFERENCES
Bonsma, P. and Cereceda, L. (2009). Finding paths between
graph colourings: PSPACE-completeness and super-
polynomial distances. Theoretical Computer Science,
410(50):5215–5226.
Bonsma, P. S. (2017). Rerouting shortest paths in planar
graphs. Discrete Applied Mathematics, 231:95–112.
Bryant, R. E. (1986). Graph-based algorithms for Boolean
function manipulation. IEEE Transactions on Com-
puters, C-35(8):677–691.
Christen, R., Eriksson, S., Katz, M., Muise, C., Petrov, A.,
Pommerening, F., Seipp, J., Sievers, S., and Speck, D.
(2023). PARIS: planning algorithms for reconﬁguring
independent sets. In Gal, K., Now
´
e, A., Nalepa, G. J.,
Fairstein, R., and Radulescu, R., editors, ECAI 2023
- 26th European Conference on Artiﬁcial Intelligence,
September 30 - October 4, 2023, Krak
´
ow, Poland - In-
cluding 12th Conference on Prestigious Applications
of Intelligent Systems (PAIS 2023), volume 372 of
Frontiers in Artiﬁcial Intelligence and Applications,
pages 453–460. IOS Press.
Hayase, K., Sadakane, K., and Tani, S. (1995). Output-size
sensitiveness of OBDD construction through maximal
independent set problem. In Du, D.-Z. and Li, M., ed-
itors, Computing and Combinatorics, pages 229–234,
Berlin, Heidelberg. Springer Berlin Heidelberg.
Ito, T., Demaine, E. D., Harvey, N. J. A., Papadimitriou,
C. H., Sideri, M., Uehara, R., and Uno, Y. (2011). On
the complexity of reconﬁguration problems. Theoret-
ical Computer Science, 412(12–14):1054–1065.
Ito, T., Kawahara, J., Nakahata, Y., Soh, T., Suzuki, A.,
Teruyama, J., and Toda, T. (2023). ZDD-based al-
gorithmic framework for solving shortest reconﬁgu-
ration problems. In 20th International Conference
on the Integration of Constraint Programming, Artiﬁ-
cial Intelligence, and Operations Research (CPAIOR
2023), pages 167–183.
Kami
´
nski, M., Medvedev, P., and Milani
ˇ
c, M. (2011).
Shortest paths between shortest paths. Theoretical
Computer Science, 412(39):5205–5210.
Kawahara, J., Inoue, T., Iwashita, H., and Minato, S.
(2017). Frontier-based search for enumerating all con-
strained subgraphs with compressed representation.
IEICE Transactions on Fundamentals of Electron-
ics, Communications and Computer Sciences, E100-
A(9):1773–1784.
Knuth, D. E. (2011). The Art of Computer Program-
ming, Volume 4A, Combinatorial Algorithms, Part 1.
Minato, S. (1993). Zero-suppressed BDDs for set manip-
ulation in combinatorial problems. In Proc. of the
30th ACM/IEEE design automation conference, pages
272–277.
Nishimura, N. (2018). Introduction to reconﬁguration. Al-
gorithms, 11(4):52.
Okuno, H. G., Minato, S., and Isozaki, H. (1998). On the
properties of combination set operations. Information
Processing Letters, 66(4):195–199.
Soh, T., Okamoto, Y., and Ito, T. (2022). Core chal-
lenge 2022: Solver and graph descriptions. CoRR,
abs/2208.02495.
Toda, T., Ito, T., Kawahara, J., Soh, T., Suzuki, A., and
Teruyama, J. (2023). Solving reconﬁguration prob-
lems of ﬁrst-order expressible properties of graph ver-
tices with boolean satisﬁability. In The 35th IEEE In-
ternational Conference on Tools with Artiﬁcial Intel-
ligence, pages 294–302.
Yamada, Y., Banbara, M., Inoue, K., and Schaub, T.
(2023). Recongo: Bounded combinatorial recon-
ﬁguration with answer set programming. In Logics
in Artiﬁcial Intelligence: 18th European Conference,
JELIA 2023, Dresden, Germany, September 20–22,
2023, Proceedings, pages 278–286, Berlin, Heidel-
berg. Springer-Verlag.
ICAART 2024 - 16th International Conference on Agents and Artiﬁcial Intelligence
648