1. Introduction
The clique-width of graphs and digraphs has been defined by Courcelle and Olariu [
1]. Clique-width is an important graph parameter due to its algorithmic and structural properties. If the clique-width of a graph class or digraph class is bounded by a constant, a wide range of problems that are NP-complete in general have been shown to be polynomial time solvable on this class [
2,
3,
4,
5]. While there are a lot of results on the clique-width of undirected graph classes [
6,
7,
8], there are only a few known digraph class of bounded directed clique-width. Among these are directed co-graphs [
5], specific orientations of distance hereditary graphs [
9], and orientations of trees [
5].
In this paper we consider a directed version of undirected series-parallel graphs, which are graphs with two distinguished vertices called terminals, formed recursively by parallel and series composition ([
10], Section 11.2). These graphs are interesting from a practical point of view due to their applications in modeling certain types of electric networks. Furthermore, they also play an important role in theoretical computer science, since they have tree-width at most 2 and are
-minor free graphs [
11]. Further, a number of graph problems are solvable in linear time on series-parallel graphs [
12]. Recently, it was proven by López-Medina et al. that the clique-width of undirected series-parallel graphs on
n vertices is at most 5, and an
algorithm was proposed to construct a clique-width 5-expression for this type of graph [
13].
We consider minimal series-parallel digraphs (MSP DAGs) which are defined in [
14] from the single vertex graph by applying the parallel composition and series composition. By ([
15], Section 11.1) these graphs are useful for modeling flow diagrams and dependency charts and they have applications to scheduling under constraints. In [
16] it was shown that the directed clique-width of an MSP DAG is at most 7. We prove a lower upper bound of 6 for the directed clique-width of MSP DAGs and show how a directed clique-width 6-expression can be found in linear time. Our given expression implies that every MSP DAG
G can be constructed from its binary decomposition tree
in linear time. We apply the shown bound on the directed clique-width to conclude a couple of algorithmic consequences for MSP DAGs. Since the directed clique-width occurs in the exponent of the runtimes of algorithms for interesting problems our result improves the runtime of several algorithms on MSP DAGs.
2. Preliminaries
A directed graph (or a digraph for short) is defined by two sets. , or simply V, is the vertex set, and , or simply E, is the arc set. Every arc of E is an ordered pair of vertices of V. The number n indicates to the number of vertices of G and the number m indicates to the number of arcs of G. If then x is called a predecessor of y and y is called a successor of x. A vertex x is called a source if x has no predecessor, and is called a sink if x has no successor. Given a subset X of the vertex set V, the subgraph induced by X will be denoted by . A path of length k is a sequence of vertices such that any two consecutive vertices form an arc. A path is called a circuit if and . A directed acyclic graph, denoted by DAG, is a digraph with no circuit.
Directed clique-width measures the difficulty of decomposing a digraph into a special tree-structure. The directed clique-width of digraphs has been defined by Courcelle and Olariu [
1] as follows.
Definition 1 (Directed clique-width [
1])
. The directed clique-width of a digraph G, for short, is the minimum number of labels needed to define G using the following four operations:- 1.
Creation of a new vertex v with label a (denoted by ).
- 2.
Disjoint union of two vertex-disjoint labeled digraphs G and H (denoted by ).
- 3.
Inserting an arc from every vertex with label a to every vertex with label b (, denoted by ).
- 4.
Change label a into label b (denoted by ).
An expression X built with the operations defined above using k labels is called a directed clique-width k-expression.
Example 1. The directed clique-width of digraph G with vertex set and arc set shown in Figure 1 is at most 3, since it can be defined by the following directed clique-width 3-expression: Given a digraph
G and an integer
k, deciding whether the directed clique-width of
G is at most
k is NP-complete [
17]. In contrast to the undirected case, there are only very few digraph classes for which we know how to compute a directed clique-width expression in polynomial time. This holds for directed co-graphs [
5], digraphs of bounded directed modular width [
18], and orientations of trees [
5]. In order to find directed clique-width expressions for general digraphs one can use results on the related parameter bi-rank-width [
19]. By ([
15], Lemma 9.9.12) we can use approximate directed clique-width expressions obtained from rank-decomposition with the drawback of a single-exponential blow-up on the parameter.
3. Directed Clique-Width of Minimal Series-Parallel Digraphs (MSP DAGs)
We recall the definition of an MSP DAG which is based on [
14] to be the digraph that can be constructed starting from one vertex and recursively using two fundamental operations: series composition and parallel composition.
Definition 2 (MSP DAG [
14])
. An MSP DAG is defined recursively as follows:- 1.
A DAG containing only one vertex is an MSP DAG.
- 2.
If and are two vertex-disjoint MSP DAGs, then the DAG constructed by each of the following two operations is also an MSP DAG:
- (a)
Parallel composition: .
- (b)
Series composition: where is the set of sink vertices of and is the set of source vertices of .
An MSP DAG G can be represented by a binary decomposition tree that reflects the construction of G starting with its vertices using series and parallel operations as follows:
Definition 3 (Binary decomposition tree of MSP DAGs). The binary decomposition tree for an MSP DAG G containing only one vertex v consists of a single node r (the root of T) labeled by v.
The binary decomposition tree for an MSP DAG () consists of a copy of the binary decomposition tree for , a copy of the binary decomposition tree for , an additional node r (the root of T) labeled by P (S) and two additional edges between the roots of and and node r. The root of is the left child of r and the root of is the right child of r.
For some node u of we define by the subgraph of G defined by the subtree of rooted at u.
It is proven in [
14] that the construction of
when
G is an MSP DAG can be completed in
time complexity. This binary decomposition tree of an MSP DAG is the key of defining a directed clique-width expression.
Example 2. Figure 2 illustrates an example of an MSP DAG G and its binary decomposition tree . Remark 1. Since MSP DAGs can define orientations of large complete bipartite graphs the underlying undirected graphs are not -minor free graphs. Thus, the underlying undirected graphs of MSP DAGs are not series-parallel graphs. Both graph classes are even incomparable. A more close relation can be shown for the set of edge series-parallel multidigraphs, ESP DAGs
for short, which are also defined in [14] from the single arc graph by applying a parallel composition and a series composition. The underlying undirected graph of an ESP DAG is a series-parallel graph. Furthermore, a DAG G with a single source and a single sink is an ESP DAG if and only if its line digraph is an MSP DAG [14]. Notation 1. In our directed clique-width expressions, we define an empty expression, denoted by ∅, to be an expression of an empty set of vertices. For any expression t, we consider that , so and .
In [
16] it was shown that the directed clique-width of an MSP DAG is at most 7. Next we improve this bound.
Theorem 1. Every MSP DAG G has directed clique-width at most 6.
Proof. Let
G be an MSP DAG and
be a binary decomposition tree for
G. We prove that
G has directed clique-width at most 6 by defining a directed clique-width 6-expression for
G. We use the 6 labels for the vertices in
G as follows (see
Figure 3):
Label 1 is used for the set of non-isolated sources.
Label 2 is used for the set of non-isolated sinks.
Label 3 is used for the set of vertices being neither sources nor sinks.
Label 4 is used for the set of isolated vertices.
Label 5 is used as an auxiliary label for label 2 for the first graph when we have to distinguish the labels from two combined graphs during the arc insertion operation.
Label 6 is used as an auxiliary label for label 1 for the second graph when we have to distinguish the labels from two combined graphs during the arc insertion operation.
We define for every node of a directed clique-width 6-expression which defines the subgraph of G defined by the subtree of rooted at such that all non-isolated sources are labeled by 1, all non-isolated sinks are labeled by 2, all vertices being neither sources nor sinks are labeled by 3, and all isolated vertices are labeled by 4. For every such we use two subexpressions and , such that
defines the subgraph of given by the non-isolated vertices and
defines the subgraph of given by isolated vertices.
This allows us to obtain by .
First, we distinguish between leaf vertices and inner vertices of :
Let
be a leaf of
which represents vertex
v of
G. We define
For the correctness we note that defines digraph and the single isolated vertex is labeled by 4.
Let
be an internal node of
and
,
are respectively the left and right children of
. We will construct a directed clique-width 6-expression
for
using a directed clique-width 6-expression
for
and a directed clique-width 6-expression
for
. We can assume that for
and
we know the subexpression for the non-isolated and isolated part of
and
, such that
and
To illustrate our following constructions we use two digraphs
and
in
Figure 4a,b. Without loss of generality, and for simplification of reading, we represented in this figure each type of vertex (non-isolated source, non-isolated sink, neither source nor sink, isolated) by a single vertex. The labeling of the vertices using labels from
obviously fulfills our given conditions.
To construct a directed clique-width 6-expression for we distinguish two cases according to the type of :
- −
Suppose that
is a
P-node. In this case, we define
, where
Figure 4c illustrates the construction of
from the two digraphs shown in
Figure 4a,b following the expressions
and
.
For the correctness we note that an P-node does not insert any new arcs in the disjoint union of and , thus defines the digraph . Furthermore, by the definition of without any relabeling and the assumptions for and , in all non-isolated sources are labeled by 1, all non-isolated sinks are labeled by 2, all vertices being neither sources nor sinks are labeled by 3, and all isolated vertices are labeled by 4.
Hence, the expression constructs digraph using at most 6 labels.
- −
Suppose that
is an
S-node. In this case, we define
, where
Figure 4d–g illustrate the construction of
from the two digraphs shown in
Figure 4a,b following the expressions
, and
.
For the correctness, we observe that defines the arcs from to , i.e. the arcs between the isolated vertices of to the isolated vertices of using a relabeling from 4 to 2 for those of , since they become non-isolated sinks of . Next defines the arcs from to , i.e. the arcs between the non-isolated sinks of and the isolated vertices of are inserted using a relabeling from 2 to auxiliary label 5 for the non-isolated sinks of . Further defines the arcs from and to , i.e. the arcs from the non-isolated sinks of and the isolated vertices of to the non-isolated sources of using a relabeling from 1 to auxiliary label 6 for the non-isolated sources of . Finally in the relabeling from 4 to 1 ensures that the isolated vertices of are labeled by 1 since they are non-isolated sources in and the auxiliary labels 5 and 6 are both changed to 3 since the non-isolated sinks of and the non-isolated sources of are neither sources nor sinks in . Expression is empty, since does not contain isolated vertices.
Hence, the expression constructs digraph using at most 6 labels.
By traversing in post-order we can calculate a directed clique-width 6-expression for every node of by the expressions given above. Since the r root of represents to whole digraph G we know that G can be constructed by directed clique-width 6-expression and thus has directed clique-width at most 6. □
The construction of an MSP DAG by a directed clique-width 6-expression described in the proof of Theorem 1 can be translated into a pseudo code shown in Algorithm 1. Our algorithm associates with every node of two expressions and , where represents the construction of the subgraph induced by the non-isolated vertices of and represents the construction of the subgraph induced by the isolated vertices of . At most one of the expressions and may be empty. The labels at the end of the computation of or represent implicitly whether the corresponding vertices are non-isolated sources (labeled by 1), non-isolated sinks (labeled by 2), vertices that are not sources and not sinks (labeled by 3), or isolated vertices (labeled by 4) in . Initially, in Step 3, every vertex is labeled by 4 since the subgraph induced by a leaf of consists only of one isolated vertex. Step 5 determines the left child and the right child of an internal node . Steps 7 and 8 construct the expression and for a P-node to be respectively the disjoint union of and the disjoint union of . Steps 10–14 construct the expressions and for an S-node as follows: Step 10 changes the label of isolated vertices of from 4 to 2 and inserts all arcs from an isolated vertex of to an isolated vertex of ; Step 11 changes the label of non-isolated sinks of from 2 to (auxiliary label) 5 and inserts all arcs from a non-isolated sink of to an isolated vertex of ; Step 12, changes the label of non-isolated sources of from 1 to (auxiliary label) 6 and inserts all arcs from an isolated vertex of to a non-isolated source of and all arcs from a non-isolated sink of to a non-isolated source of . Step 13, changes the label of every isolated vertex of from 4 to 1 since these vertices are non-isolated sources in , changes the label of every non-isolated sink of from 5 to 3, since these vertices are neither sources nor sinks in , and changes the label of every non-isolated source of from 6 to 3, since these vertices are also neither sources nor sinks in . The expression must be empty because of is connected. Since the number of nodes in is and every step can be done in time, the total time complexity of Algorithm 1 is in .
Corollary 1. For every MSP DAG G which is given by its binary decomposition tree a directed clique-width 6-expression can be found in time .
Algorithm 1 Construction directed clique-width 6-expression of an MSP DAG |
| Input A binary decomposition tree of an MSP DAG G. Output A directed clique-width 6-expression of G.
Let be a node on a post-order traversal of . |
1: | if is a leaf representing vertex v then |
2: | |
3: | |
4: | else |
5: | let and be respectively the left and right children of |
6: | if is a P-node then |
7: | |
8: | |
9: | else | ▹ is an S-node |
10: | | ▹ arcs from to |
11: | | ▹ arcs from to |
12: | | ▹ arcs from and to |
13: | | ▹ relabeling |
14: | | |
Example 3. Figure 5 illustrates the application of Algorithm 1 for the digraph G and its binary decomposition tree shown in Figure 2. The inner nodes are visited according to a post-order traversal of which is defined by the symbols , , written near every internal node of . Every subfigure in Figure 5 shows a digraph , , defined by expression of Algorithm 1. Digraph obviously corresponds to digraph G. Remark 2. A useful property of Algorithm 1 is that the number of relabelings of the vertices is bounded. A relabeling of a vertex is done if and only if the state (non-isolated source, non-isolated sink, neither source nor sink, isolated) of the vertex is changed. Since the state of a vertex can change at most twice and an auxiliary label 5 or 6 is given at most once to every vertex, every vertex changes its label at most three times.
The problem of finding a decomposition tree
for some special graph
G in polynomial time is a well studied problem. For every MSP DAG and also for every directed co-graph, a decomposition tree can be found in linear time [
14,
20]. The reverse direction, i.e. constructing
G in linear time from
seems to be unsolved for MSP DAGs. Our shown 6-expression allows to solve this problem.
Corollary 2. Every MSP DAG G can be constructed from its binary decomposition tree in time .
Proof. Let a binary decomposition tree for some MSP DAG G. By Corollary 1 from we can define a directed clique-width 6-expression X for G in time .
In order to access vertices of a given label
i we maintain in each node
u of the 6-expression-tree (see
Section 4) for
X an array containing at
i a pointer to a list of the vertices of label
i in the digraph defined by subtree with root
u for
. Our expression
X only inserts new arcs, such that these operations use time
and by Remark 2, the number of relabelings is at most three for every vertex. Thus,
G can be constructed from
in time
. □
4. Algorithmic Consequences
By the given definition every graph of directed clique-width at most
k can be represented by a tree structure, denoted as
k-expression-tree. The leaves of the
k-expression-tree represent the vertices of the digraph and the inner nodes of the
k-expression-tree correspond to the operations applied to the subexpressions defined by the subtrees. Using the
k-expression-tree many hard problems have been shown to be solvable in polynomial time when restricted to graphs of bounded directed clique-width [
4,
5].
In order to show tractability for several digraph problems w.r.t. the parameter directed clique-width one can use its defineability within monadic second order logic (MSO). We restrict to
-logic, which allows propositional logic, variables for vertices and vertex sets of digraphs, the predicate
for arcs of digraphs, and quantifications over vertices and vertex sets [
21]. For defining optimization problems we refer to the
framework given in [
2].
In several papers (cf. [
4,
19,
22]) it has been shown, that all digraph problems expressible in monadic second order logic with quantifications over vertices and vertex sets (
-logic) are fixed parameter tractable with respect to the parameter “directed clique-width of the input graph”. Theorem 1 leads to the next result.
Corollary 3. Every digraph problem expressible in -logic can be solved in polynomial time on MSP DAGs.
Examples for problems expressible in
-logic are the directed vertex disjoint paths problem [
4] and also the arc disjoint paths problem [
23].
Corollary 4. The directed vertex disjoint paths problem and the arc disjoint paths problem can be solved in polynomial time on MSP DAGs.
There are a lot of further problems which can be solved efficiently on graphs of bounded directed clique-width. This follows by the xp-algorithms for the problems directed Hamiltonian path, directed Hamiltonian cycle, directed cut, and regular subdigraph with respect to the parameter directed NLC-width given in [
5].
Corollary 5. The directed Hamiltonian path problem, directed Hamiltonian cycle problem, directed cut problem, and regular subdigraph problem can be solved in polynomial time on MSP DAGs.
5. Conclusions and Outlook
We have given an improved upper bound for the directed clique-width of MSP DAGs. Since the directed clique-width occurs in the exponent of the runtimes of algorithms for interesting problems our result improves the runtime of several algorithms on MSP DAGs. Further our findings extend the few known results on digraph classes with bounded directed clique-width.
It remains to show that the improved upper bound of 6 for the directed clique-width of MSP DAGs is tight. This might be done by further characterizations of MSP DAGs or using a computer program.
In our future work we also want to analyze the structure, relation, and directed clique-width of digraph classes obtained by slight modifications of the series operation considered in this paper. Among these are connecting every source of the first digraph with every sink of the second digraph (MSP-ST DAGs, ([
24], Definition 2)), connecting every source of the first digraph with every source of the second digraph (MSP-SS DAGs, ([
24], Definition 5)), and connecting every sink of the first digraph with every sink of the second digraph (MSP-TT DAGs, ([
24], Definition 8)).
Further, we want to analyze whether the recursive structure of MSP DAGs and the similar classes mentioned above can be used to give linear time solutions for the directed vertex disjoint paths problem and the arc disjoint paths problem in order to improve our results of Corollary 4.
As mentioned in Remark 1 the class of edge series-parallel multidigraphs defined in [
14] leads to a specific orientation of (undirected) series-parallel graphs and seems also to be interesting for our further research on digraph classes on bounded directed clique-width.
Finally, in [
14] only oriented graphs are considered. Therefore we want to analyze series operations which also define both possible directed edges between two vertices, i.e., so-called symmetric arcs.