A Polynomial-Time Algorithm for Computing the Maximum Common Connected Edge Subgraph of Outerplanar Graphs of Bounded Degree

The maximum common connected edge subgraph problem is to find a connected graph with the maximum number of edges that is isomorphic to a subgraph of each of the two input graphs, where it has applications in pattern recognition and chemistry. This paper presents a dynamic programming algorithm for the problem when the two input graphs are outerplanar graphs of a bounded vertex degree, where it is known that the problem is NP-hard, even for outerplanar graphs of an unbounded degree. Although the algorithm repeatedly modifies input graphs, it is shown that the number of relevant subproblems is polynomially bounded, and thus, the algorithm works in polynomial time.


Introduction
Finding common parts of graph-structured data is an important and fundamental task in computer science.Among many such problems, the maximum common subgraph problem has applications in various areas, which include pattern recognition [1,2] and chemistry [3,4].Although there are several variants, the maximum common subgraph problem (MCS) usually means the problem of finding a connected graph with the maximum number of edges that is isomorphic to a subgraph of each of the two input undirected graphs (i.e., the maximum common connected edge subgraph problem).
Because of its importance in pattern recognition and chemistry, many practical algorithms have been developed for MCS and its variants [1][2][3][4].Some exponential-time algorithms that are better than naive ones have also been developed [5,6].Kann studied the approximability of MCS and related problems [7].
It is also important for MCS to study a polynomially solvable subclasses of graphs, because graph structures are restricted in many application areas.It is well-known that if input graphs are trees, MCS can be solved in polynomial time using maximum weight bipartite matching [8].Akutsu showed that MCS can be solved in polynomial time if input graphs are almost trees of bounded degree, whereas MCS remains NP-hard for almost trees of unbounded degree [9], where a graph is called an almost tree if it is connected and the number of edges in each biconnected component is bounded by the number of vertices plus some constant.Yamaguchi et al. developed a polynomial-time algorithm for MCS and the maximum common induced connected subgraph problem for a degree bounded partial k-tree and a graph with a polynomially bounded number of spanning trees, where k is a constant [10].However, the latter condition seems rather artificial.Schietgat et al. developed a polynomial-time algorithm for outerplanar graphs under the block-and-bridge preserving subgraph isomorphism [11].However, they modified the definition of MCS by this restriction.Although it was announced that MCS can be solved in polynomial time if input graphs are partial k-trees and MCS must be k-connected (for example, see [12]), the restriction that subgraphs are k-connected is too strict from a practical viewpoint.As for the subgraph isomorphism problem, which is closely related to MCS, polynomial-time algorithms have been developed for biconnected outerplanar graphs [13,14] and for partial k-trees with some constraints, as well as their extensions [15,16].
In this paper, we present a polynomial-time algorithm for outerplanar graphs of a bounded degree (a preliminary version has appeared in [17]).Although this graph class is not a superset of the classes in previous studies [9,10], it covers a wide range of chemical compounds (it was reported that 94.4% of chemical compounds in the NCI database have outerplanar graph structures [18]).Furthermore, the algorithm and its analysis in this paper are not simple extensions or variants of those for the subgraph isomorphism problem for outerplanar graphs [13,14] or partial k-trees [15,16].These algorithms heavily depend on the property that each connected component in a subgraph is not decomposed.However, to be discussed in Section 4, connected components from both input graphs can be decomposed in MCS, and considering all decompositions easily leads to exponential-time algorithms.In order to cope with this difficulty, we introduce the concept of a blade.The blade and its analysis play a key role in this paper.
It is to be noted that the number of MCS can be exponential even for trees [19].Therefore, our proposed algorithm and all polynomial-time algorithms mentioned above are focusing on finding the one of MCS's.It should also be noted that the proposed algorithm is not practical, because the polynomial degree is very high, although it gives a non-trivial theoretical result on the computation of MCS.

Preliminaries
A graph is called outerplanar if it can be drawn on a plane such that all vertices lie on the outer face (i.e., the unbounded exterior region) without crossing of edges.Although there exist many embeddings (i.e., drawings on a plane) of an outerplanar graph, it is known that one embedding can be computed in linear time.Therefore, in this paper, we assume that each graph is given with its planar embedding.A path is called simple if it does not pass the same vertex multiple times.In this paper, a path always means a simple path that is not a cycle.
A cut vertex of a connected graph is a vertex whose removal disconnects the graph.A graph is biconnected if it is connected and does not have a cut vertex.A maximal biconnected subgraph is called a biconnected component.A biconnected component is called a block if it consists of at least three vertices; otherwise, it is an edge and called a bridge.An edge in a block is called an outer edge if it lies on the boundary of the outer face; otherwise, it is called an inner edge.It is well-known that any block of an outerplanar graph has a unique Hamiltonian cycle, which consists of outer edges only [20].For the details of the terminology used in graphs and outerplanar graphs, refer to an appropriate textbook on graph theory (e.g., [21]).
If we fix an arbitrary vertex of a graph G as the root r, we can define the parent-child relationship on biconnected components.For two vertices, u and v, u is called further than v if every simple path from u to r contains v.A biconnected component, C, is called a parent of a biconnected component C ′ if C and C ′ share a vertex v, where v is uniquely determined, and every path from any vertex in C ′ to the root contains v.In such a case, C ′ is called a child of C. A cut vertex v is also called a parent of C if v is contained in both C and its parent component ( both of a cut vertex and a biconnected component can be parents of the same component).Furthermore, the root, r, is a parent of For each cut vertex v, G(v) denotes the subgraph of G induced by v and the vertices further than v.For a pair of a cut vertex v and a biconnected component, C, containing v, G(v, C) denotes the subgraph of G induced by vertices in C and its descendant components.For a biconnected component, B, with its parent cut vertex, w, a pair of vertices, ) denotes the set of the vertices lying on the one of the two paths connecting v and v ′ in the Hamiltonian cycle that does not contain the parent cut vertex, except its endpoints.B(v, v ′ ) is the subgraph of B induced by V B(v, v ′ ) and is called a half block.It is to be noted that B(v, v ′ ) contains both v and v ′ .Then, G(v, v ′ ) denotes the subgraph of G induced by V B(v, v ′ ) and the vertices in the biconnected components, each of which is a descendant of some vertex in V B(v, v ′ ) − {v, v ′ }, and G(v, v ′ ) denotes the subgraph of G induced by the vertices in G(v, v ′ ) and descendant components of v and v ′ , where descendants are defined via the parent-child relationship.
Example Figure 1 shows an example of an outerplanar graph G(V, E).Blocks and bridges are shown by gray regions and bold lines, respectively.If a connected graph, G c (V c , E c ), is isomorphic to a subgraph of G 1 and a subgraph of G 2 , we call G c a common subgraph of G 1 and G 2 .A common subgraph G c is called a maximum common connected edge subgraph of G 1 and G 2 if its size is the maximum among all common subgraphs (we use MCS to denote both the problem and the maximum common subgraph), where the size means the number of edges.In what follows, for the sake of simplicity, a maximum common subgraph (MCS) always means a maximum common connected edge subgraph.In this paper, we consider the following problem.Note that the degree bound is essential, because MCS is NP-hard for outerplanar graphs of unbounded degree, even if each biconnected component consists of at most three vertices [9].Although we do not consider labels on vertices or edges, our results can be extended to vertex-labeled and/or edge-labeled cases in which label information must be preserved in isomorphic mapping.In the following, n denotes the maximum number of vertices of two input graphs ( it should be noted that the number of vertices and the number of edges are in the same order, since we only consider connected outerplanar graphs).
In this paper, we implicitly make extensive use of the following well-known fact [13], along with outerplanarity of the input graphs.
either clockwise or counterclockwise order.

Algorithm for a Restricted Case
In this section, we consider the following restricted variant of OUTER-MCS, which is called SIMPLE-OUTER-MCS, and present a polynomial-time algorithm for it: (i) any two vertices in different biconnected components in a maximum common subgraph, G c , must not be mapped to vertices in the same biconnected component in G 1 (resp.G 2 ); (ii) each bridge in G c must be mapped to a bridge in G 1 (resp.G 2 ); (iii) the maximum degree need not be bounded.
It is to be noted from the definition of a common subgraph (regardless of the above restrictions) that no two vertices in different biconnected components in G 1 (resp.G 2 ) are mapped to vertices in the same biconnected component in any common subgraph, and no bridge in G 1 (resp.G 2 ) is mapped to an edge in a block in any common subgraph (otherwise there would exist a cycle containing the edge in a common subgraph, which would mean that the edge in G 1 (resp., G 2 ) is not a bridge).SIMPLE-OUTER-MCS is intrinsically the same as the one studied by Schietgat et al. [11].Although our algorithm is more complex and less efficient than their algorithm, we present it here, because the algorithm for a general (but bounded degree) case is rather involved and is based on our algorithm for SIMPLE-OUTER-MCS.
Here, we present a recursive algorithm to compute the size of MCS in SIMPLE-OUTER-MCS, which can be easily transformed into a dynamic programming algorithm to compute an MCS, as is true for many other dynamic programming algorithms.The following is the main procedure of the recursive algorithm.
The algorithm consists of a recursive computation of the following three scores: ) is a cut pair, and G c must contain a cut pair (w, w ′ ) corresponding to both (u, u ′ ) and (v, v ′ ).If there does not exist such G c (which must be connected), its score is −∞.
In the following, we describe how to compute these scores.
As in the dynamic programming algorithm for MCS for trees or almost trees [9], we construct a bipartite graph and compute a maximum weight matching.
Let C 1 , . . ., C h 1 , e 1 , . . ., e h 2 and D 1 , . . ., D k 1 , f 1 , . . ., f k 2 be children of u and v respectively, where C i 's and D j 's are blocks and e i 's and f j 's are bridges (see Figure 2).We construct an edge-weighted bipartite graph BG(X, Y ; E) by Then, we let M CS c (G 1 (u), G 2 (v)) be the weight of the maximum weight bipartite matching of BG(X, Y ; E).It is to be noted that w(C i , f j ) = 0 (resp., w(e i , D j ) = 0) comes from the fact that f j must be mapped to a bridge in G c , but a bridge in G c must not be mapped to an edge in any block (e.g., C i ), because of the condition (ii) of SIMPLE-OUTER-MCS.
. ., u h ) be the sequence of vertices in G 1 (u, C), such that there exists an edge, {u i , u}, for each u i , where u 1 , u 2 , . . ., u h are arranged in clockwise order.(v 1 , v 2 , . . ., v k ) is defined for G 2 (v, D) in the same way.It is to be noted that (C, D) is either a pair of blocks or a pair of bridges.A pair of subsequences (( ( the latter ordering is required for handling mirror images.),where g = 0 is allowed.We compute M CS b (G 1 (u, C), G 2 (v, D)) by the following (see Figure 3): if C is a block and g = 1 then continue; /* blocks must be preserved */ s ← 0; In the above procedure, the first inner for loop takes care of blocks, such as C 1 , C 4 , D 1 and D 4 in Figure 3, whereas the second inner for loop takes care of half blocks, such as C 2 , C 3 , D 2 , D 3 and D 5 in Figure 3.
For example, consider an alignment, ((u 1 , u 2 , u 3 ), (v 1 , v 2 , v 4 )), in Figure 3, where all alignments are to be examined in the algorithm.Then, the score of this alignment is given by )}, and thus, the maximum weight matching is given by w ).In this case, an edge, {v, v 3 }, is removed and then v 3 is treated as a vertex on the path connecting v 2 and v 4 in the outer face.For another example, consider an alignment ((u 1 ), (v 1 )) in the same figure.Then, this alignment is ignored by the "if ... then ..." line of the procedure, because a bridge in G c , which would correspond to {u, u 1 } in G 1 and {v, v 1 } in G 2 , must not be mapped to an edge in C or D. However, if both {u, u 1 } and {v, v 1 } are bridges, the resulting score would be Since the above procedure examines all possible alignments, it may take exponential time.However, we can modify it into a dynamic programming procedure, as shown below, where we omit a subprocedure for handling mirror images, because it is trivial.In this procedure, u 1 , u 2 , . . ., u h and v 1 , v 2 , . . ., v k are processed from left to right.In the first for loop, M [s, t] stores the size of MCS between G 1 (u s ) and G 2 (v t ) plus one (corresponding to a common edge between {u, u s } and {v, v t }).The double for loop computes an optimal alignment.M [s, t] stores the size of MCS between G 1 (u, C) and G 2 (v, D) up to u s and v t , respectively.f lag is introduced to ensure the connectedness of a common subgraph.For example, Let (u 1 , u 2 , . . ., u h ) be the sequence of vertices in G 1 (u, u ′ ), such that there exists an edge {u i , u} or {u i , u ′ } for each u i , where u 1 , u 2 , . . ., u h are arranged in clockwise order.
) by the following procedure, where it does not examine alignments with j g < j This procedure returns −∞ if there is no connected common subgraph between G 1 (u, u ′ ) and G 2 (v, v ′ ) that contains (w, w ′ ) corresponding to both (u, u ′ ) and (v, v ′ ).It should be noted that the first line in the body of the main loop puts the constraint that all corresponding pairs, (u it , v jt ), in an alignment must be connected to either (u, v) or (u ′ , v ′ ), and the second line puts the constraint that (u i 1 , v j 1 ) must be connected to (u, v) and (u ig , v jg ) must be connected to (u ′ , v ′ ).
As in the case of ) can be modified into a dynamic programming version.
Then, we have the following theorem: Theorem 1 SIMPLE-OUTER-MCS can be solved in polynomial time.
Proof.First we consider the correctness of the algorithm SimpleOuterM CS(G 1 , G 2 ).The crucial points of the algorithm are that it examines all possible combinations of the neighbors via alignments examined in SimpleOuterM CS b (G 1 (u, C), G 2 (v, D)) for each pair of cut vertices (u, v) and via alignments examined in SimpleOuterM CS p (G 1 (u, u ′ ), G 2 (v, v ′ )) for each pair of cut pairs ((u, u ′ ), (v, v ′ )), where the connectedness in the latter case is taken care of by the use of l(u i , v j ) and r(u i , v j ).It should be noted that non-neighbors of u cannot be neighbors of a node corresponding to u in MCS, and the ordering of neighbors must be preserved by Fact 1.Therefore, examination of all alignments covers all valid combinations of neighbors.Based on these facts, it is straightforward to see that SimpleOuterM CS(G 1 , G 2 ) correctly computes the size of MCS.
Next, we consider the time complexity.Since we examine O(n 2 ) possible root pairs, we focus on the case where the roots are fixed, where n is the maximum number of vertices in G 1 and G 2 .
Although SimpleOuterM CS(G 1 , G 2 ) is described as a recursive algorithm, the numbers of required scores of and O(n 4 ), respectively.Therefore, by storing these values in some tables, we can transform SimpleOuterM CS (G 1 , G 2 ) into a dynamic programming algorithm.
Computation of M CS(G 1 (u), G 2 (v)) can be done in O(n 3 ) time per call, because a maximum weight bipartite matching can be computed in O(n 3 ) time [22].Using the dynamic programming version, the computation of each of Therefore, the total time complexity is O(n 2 )×(O(n 2 )×O(n 3 )+O(n 2 )×O(n 4 )+O(n 4 )×O(n 4 )) = O(n 10 ). 2 Though it might be possible to substantially reduce the degree of polynomial by some simplification, as done in [11], we do not go further, because our main purpose is to present a polynomial-time algorithm for the non-restricted (but bounded degree) case.

Algorithm for Outerplanar Graphs of Bounded Degree
In order to extend the algorithm in Section 3 for a general (but bounded degree) case, we need to consider the decomposition of biconnected components.For example, consider graphs G 1 and G 2 in Figure 5.We can see that in order to obtain a maximum common subgraph, biconnected components in G 1 and G 2 should be decomposed, as shown in Figure 5, where there can be multiple ways of optimal decompositions in general.This is the crucial point, because considering all possible decompositions easily leads to exponential-time algorithms.In order to characterize decomposed components, we introduce the concept of a blade, as shown below (see also Figure 6).
Suppose that v i 1 , . . ., v i k are the vertices of a half block arranged in this order, and v i 1 and v i k are respectively connected to v and v ′ , where v and v ′ can be the same vertex.If we cut one edge, {v i h , v i h+1 } for i h ∈ {2, 3, ..., k −2}, we obtain two half blocks, one induced by v i 1 , v i 2 , . . ., v i h and the other induced by v i k , v i k−1 , . . ., v i h+1 .However, only one half block is obtained in the case of i 1 = i h or i k = i h+1 , and no half block is obtained in the case of k = 2 (see Figure 7).Each of these half blocks is a chain of biconnected components called a blade body, and a subgraph consisting of a blade body and its descendants is called a blade.Vertices v i 1 and v i k , an edge {v i h , v i h+1 } and vertices v i h , v i h+1 are called base vertices, a tip edge and tip vertices, respectively.The sequence of edges in the shortest path from v i 1 to v i h (resp.from v i k to v i h+1 ) is called the backbone of a blade.As a result, the edges between two blades are deleted (it does not cause a problem, because all possible configurations are examined, as discussed later).In addition, there exists three subcases, depending on the existence of edges {v i 1 , v i k } and {v ′ , v i 1 } (cases with {v, v i k } can be handled in an analogous way).We need not consider the case where {v where these three cases are respectively denoted by "deletion of e", "deletion of e" and "deletion of ê" (see Figure 7).It is to be noted that, in any case, we cannot have multiple tip edges simultaneously for the same pair, (v, v ′ ), because disconnected component(s) would appear if multiple tip edges exist.In addition, we allow {v, v i 1 } (resp.{v ′ , v i k }) to be a tip edge.In this case, after removing this tip edge, the resulting half block induced by ) is a blade body, where v i k (resp.v i 1 ) becomes the base vertex.For example, the rightmost blade in Figure 8 is created by removing a tip edge {u, u 5 } and u 4 becomes the base vertex.Since a blade can be specified by a pair of base and tip vertices and an orientation (clockwise or counterclockwise), there exist O(n 2 ) blades in G 1 and G 2 .Of course, we need to consider the possibility that during the execution of the algorithm, other subgraphs may appear from which new blades are created.However, we will show later that blades appearing in the algorithm are restricted to be those in G 1 and G 2 .

Description of Algorithm
In this subsection, we describe the algorithm as a recursive procedure, which can be transformed into a dynamic programming one, as stated in Section 3.
The main procedure, OuterM CS(G 1 , G 2 ) is the same as that mentioned in Section 3, and we recursively compute three kinds of scores: , where cut vertices, cut pairs, blocks and bridges do not necessarily mean those in the original graphs, but may mean those in subgraphs generated by the algorithm.

Computation of M CS
Let C 1 , . . ., C h 1 and e 1 , . . ., e h 2 be children of u, where C i 's and e j 's are blocks and bridges, respectively.Let u i 1 , . . ., u i h be the vertices of u that are contained in the children of u.We define a configuration as a tuple of the following (see Figure 8).
, where B is the block containing u i j , u i k and u.This edge is defined only for a consecutive selected vertex pair, u i j and u i k , in the same block (i.e., B(u i j , u i k ) does not contain any other selected vertex).e is used as a tip edge, where e can be empty, which means that we do not cut any edge in B(u i j , u i k ).It is to be noted that, at most, one edge in B(u i j , u i k ) can be a tip edge, and thus, each B(u i j , u i k ) is divided into, at most, two blade bodies; further decomposition will be done in later steps.We also consider e and ê for e = tip(u i j , u i k ) whenever available.
Each configuration defines a subgraph of G 1 (u) as follows: Otherwise, e i is removed along with its descendants.• If no vertex in C i is selected, it is removed along with its descendants.Otherwise, C i is divided into blocks, blade bodies (according to s(. ..)'s and tip(. ..)'s) and bridges, where edges, {u i j , u} with s(u i j ) = 0, are removed.
Let C ′ 1 , . . ., C ′ p 1 and e ′ 1 , . . ., e ′ p 2 be the resulting blocks and bridges containing u, which are new 'children' of u, for a configuration, F 1 .Configurations are defined for G 2 (v) in an analogous way.Let D ′ 1 , . . ., D ′ q 1 and f ′ 1 , . . ., f ′ q 2 be the resulting new children of v for a configuration F 2 of G 2 .As stated in Section 3, we construct a bipartite graph BG F 1 ,F 2 by and we compute the weight of the maximum weight matching for each configuration pair (F 1 , F 2 ) ( although a bridge cannot be mapped on a block here, a bridge can be mapped to an edge in a block of an input graph by converting the block into smaller blocks and bridges using tip edge(s)).The following is a procedure for computing M CS c (G 1 (u), G 2 (v)): for all configurations F 1 for G 1 (u) do for all configurations F 2 for G 2 (v) do s ← weight of the maximum weight matching of BG F 1 ,F 2 ; if s > s max then s max ← s; return s max .

Computation of M CS
This score can be computed, as stated in Section 3, although we should take blades into account.In this case, we can directly examine all possible alignments, because the number of neighbors of u or v is bounded by a constant, and we need to examine a constant number of alignments.
As in OuterM CS c (G 1 (u), G 2 (v)), we examine all possible configurations by specifying selected vertices and tip edges (see Figure 9).Each configuration defines a subgraph of G 1 (u, u ′ ) (resp.G 2 (v, v ′ )).This subgraph contains three kinds of biconnected components: (i) components connecting only to u (resp.v) (ii) components connecting only to u ′ (resp.v ′ ) and (iii) component connecting to both u and u ′ (resp.v and v ′ ), where this type (iii) component is uniquely determined.For each of type (i) and type (ii) components, we construct a bipartite graph, as in OuterM CS(G 1 (u), G 2 (v)), although blades might appear in the recursive process.Let the resulting bipartite graphs be BG l F 1 ,F 2 and BG r F 1 ,F 2 , respectively.Let C 0 (u, u ′ ) and D 0 (v, v ′ ) be type (iii) components (i.e., half blocks) for G 1 (u, u ′ ) and G 2 (v, v ′ ), respectively.For this pair of components, we compute a maximum common subgraph, as in SimpleOuterM CS(G s ← score of the maximum common subgraph between C 0 (u, u ′ ) and D 0 (v, v ′ ); s ← s + weight of the maximum weight matching of BG l F 1 ,F 2 ; s ← s + weight of the maximum weight matching of BG r F 1 ,F 2 ; if s > s max then s max ← s; return s max .

Analysis
As mentioned before, each blade is specified by base and tip vertices in G 1 or G 2 and an orientation.Each half block is also specified by two vertices in block in G 1 or G 2 .We show that this property is maintained throughout the execution of the algorithm and bound to the number of half blocks and blades, as below.

Lemma 1 The number of different half blocks and blades appearing in
Proof.We prove it by mathematical induction on the number of steps in the execution of the algorithm.At the beginning of the algorithm, this property is trivially maintained, because we only have G 1 and G 2 .A new half block (along with its descendants) or a new blade is created only when graphs are modified according to a configuration or alignment.In the alignment case, it is straightforward to see that new half blocks are half blocks of the current block or current half block.It can also be seen that whenever a blade is newly created, it is a half block (along with descendants) of the current block or current half block.The crucial cases lie when an existing blade is modified according to a configuration.Let u and {u, w} be the base vertex and a backbone edge in a blade BD, respectively.Let C 0 be the block in G 1 (resp.G 2 ) from which BD was created.Then, we need to consider the following three cases (Figure 10) ( new blades may also be created by a tip edge in a half block specified by a pair of selected vertices): (a) w is not selected.
The base vertex of a new blade is the selected vertex nearest to w in the first block (i.e., block containing u) of BD.Since the original blade body was a half block of a block C 0 , the resulting blade body is also a half block of C 0 .(b) w is selected, and there is no tip edge between w and its nearest selected vertex.
The resulting blade body begins from w (in the next step), which is a half block of C 0 .(c) w is selected, and there is a tip edge between w and its nearest selected vertex.
The resulting blade body begins from w, which is a half block of C 0 .Furthermore, two (or less) new blade bodies are created, both of which are half blocks of C 0 .
Therefore, we can see that every half block or blade appearing in the algorithm is specified by two vertices in a block of G 1 or G 2 , from which the lemma follows. 2  Proof.It is straightforward to check the correctness of the algorithm, because it implicitly examines all possible common subgraphs via alignment, decomposition by configurations and bipartite matching, where Fact 1 enables us to use alignment and dynamic programming.Therefore, we focus on the time complexity.
Since the number of half blocks and blades is O(n 2 ) and the maximum degree is bounded, the number of different G 1 (u)'s and G 1 (u, u ′ )'s (resp.G 2 (v)'s and G 2 (v, v ′ )'s) appearing in the algorithm, some of which can be obtained from subgraphs of G 1 (resp.G 2 ), is O(n 3 ), where an additional O(n) factor comes from the fact that O(n) new blocks and bridges may be created per blade.Therefore, we can transform the recursive algorithm into a dynamic programming algorithm using O(n 3 )×O(n 3 ) = O(n 6 ) size tables.
For each subgraph appearing in OuterM CS(G 1 (u), G 2 (v)) or OuterM CS(G 1 (u, u ′ ), G 2 (v, v ′ )) as an argument, the number of configurations is O(n 2D−3 ), because there exists at most 2D −2 neighboring vertices (excluding those nearer to the root) of u and u ′ (resp.v and v ′ ) for a constant, D, (D > 2) and a tip edge lies between a path connecting two neighboring vertices.For some block pair, we need to examine all possible alignments.Since the maximum degree is bounded by constant, D, we need to examine a constant number of alignments, and thus, this calculation can be done in constant time.By the same reason, a maximum matching can be computed in constant time.All other miscellaneous operations, which include modification of edges and summation of scores, can be performed in O(n 2 ) time per pair of configurations, pair of biconnected components and pair of half blocks.Since we need to examine O(n 2 ) pairs of the roots, the total computation time is: for a constant, D (a constant factor depending only on D is ignored here, because we assume that D is a constant).2

Concluding Remarks
We have presented a polynomial-time algorithm for the maximum common connected edge subgraph problem for outerplanar graphs of bounded degree.However, it is not practically efficient.Therefore, development of a much faster algorithm is left as an open problem.Although the proposed algorithm might be modified for outputting all maximum common subgraphs, it would not be an output-polynomial-time algorithm.Therefore, such an algorithm should also be developed.
Recently, it has been shown that the maximum common connected edge subgraph problem is NP-hard, even for partial k-trees of a bounded degree, where k = 11 [23].Since outerplanar graphs have treewidth 2 and most chemical compounds have a treewidth of at most 3 [10,18], to decide whether the problem for partial k-trees is NP-hard for k = 3 is left as an interesting open problem.

B 1 ,
B 3 and e 2 are the children of the root r.B 4 , B 6 and B 7 are the children of B 3 , whereas B 4 and B 6 are the children of w.Both w and B 3 are the parents of B 4 and B 6 .G(w) consists of B 4 , B 5 and B 6 , whereas G(w, B 4 ) consists of B 4 and B 5 .(v, v ′ ) is a cut pair of B 7 , and B 7 (v, v ′ ) is a region surrounded by a dashed bold curve.G(v, v ′ ) consists of B 7 (v, v ′ ), B 8 , B 9 , B 10 , e 4 , e 5 and e 6 , whereas G(v, v ′ ) consists of B 7 (v, v ′ ), B 10 , e 4 and e 5 .
is a pair of the roots or a pair of cut vertices, and G c must contain a vertex corresponding to both u and v. M CS b (G 1 (u, C), G 2 (v, D)): the size of an MCS G c between G 1 (u, C) and G 2 (v, D), where (C, D) is either a pair of blocks or a pair of bridges, u (resp.v) is the cut vertex belonging to both C (resp.D) and its parent, G c must contain a vertex corresponding to both u and v and G c must contain a biconnected component (which can be empty) corresponding to a subgraph of C and a subgraph D.

Figure
Figure configuration and its subgraph of G 1 (u).Black circles, dark gray regions and thin dotted lines denote selected vertices, blades and removed edges, respectively.Block C 1 and edges e 1 , e 2 are the children of u in G 1 (u), where block H 1 is a child of e 1 , blocks H 2 , H 3 are children of C 1 and block H 4 is a child of e 2 .Edges, e a , e b , are tip edges, where {u, u 5 } is also regarded as a tip edge.Then, edge e 1 is deleted along with block H 1 , whereas edge e 2 remains as it is.Block C 1 is divided into block C ′ 1 , blades B 1 , . . ., B 5 and edge e ′ 1 , where blocks, H 2 , H 3 , and blades, B 1 , B 2 , B 3 , are children of C ′ 1 and blades, B 4 , B 5 , are children of e ′ 1 .In the resulting subgraph, block, C ′ 1 , and edges, e ′ 1 , e ′ 2 , are the children of u.

Figure 9 .
Figure 9. Example of configuration and its resulting subgraph for G 1 (u, u ′ ).Black circles, dark gray regions and thin dotted lines denote selected vertices, blade, and removed edges, respectively.Edges, e a , e b , are tip edges, where {u ′ , u ′′ } is also regarded as a tip edge.In the resulting subgraph, C ′ 1 is a type (i) component, e ′ 1 and e ′ 2 are type (ii) components and C 0 (u, u ′ ) is a type (iii) component.

Figure 10 .
Figure 10.Three cases considered in the proof of Lemma 1. Bold lines and dark gray regions denote backbone edges and new blade bodies, respectively.
obtain the following theorem.Theorem 2 A maximum common connected edge subgraph of two outerplanar graphs of bounded degree can be computed in polynomial-time.