 # Characterizations and Directed Path-Width of Sequence Digraphs

Computing the directed path-width of a directed graph is an NP-hard problem. Even for digraphs of maximum semi-degree 3 the problem remains hard. We propose a decomposition of an input digraph G=(V,A) by a number k of sequences with entries from V, such that (u,v) in A if and only if in one of the sequences there is an occurrence of u appearing before an occurrence of v. We present several graph theoretical properties of these digraphs. Among these we give forbidden subdigraphs of digraphs which can be defined by k=1 sequence, which is a subclass of semicomplete digraphs. Given the decomposition of digraph G, we show an algorithm which computes the directed path-width of G in time O(k· (1+N)^k), where N denotes the maximum sequence length. This leads to an XP-algorithm w.r.t. k for the directed path-width problem. Our result improves the algorithms of Kitsunai et al. for digraphs of large directed path-width which can be decomposed by a small number of sequence.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Let be a set of sequences , . All items are pairwise distinct. Further there is a function which assigns every item with a type . The sequence digraph for a set has a vertex for every type and an arc if and only if there is some sequence in where an item of type is on the left of some item of type .111A related but different concept for undirected graphs is the notation of word-representable graphs. A graph is word-representable if there exists a word over the alphabet such that letters and alternate in if and only if ., see  for a survey. The contributions of this paper concern graph theoretic properties of sequence digraphs and an algorithm to compute from a given some set on sequences the directed path-width of .

This paper is organized as follows. In Section 2 we give preliminaries for graphs and digraphs. In Section 3 we show how to define digraphs form sets of sequences, and vice versa. Further we give methods in order to compute the sequence digraph and also its complement digraph. In Section 4 we consider graph theoretic properties of sequence digraphs. Therefore in Section 4.1 we introduce the class as the set of all sequence digraphs defined by sets on at most sequences that together contain at most items of each type. We show inclusions of these classes and necessary conditions for digraphs to be in . In Section 4.2 we give finite sets of forbidden induced subgraphs for all classes and . It turns out that is equal to the well known class of transitive tournaments. Since only the first and the last item of each type in every are important for the arcs in the corresponding digraph all classes , are equal and can be characterized by one set of four forbidden induced subdigraphs. These characterizations lead to polynomial time recognition algorithms for the corresponding graph classes. Furthermore we give characterizations in terms of special tournaments and conditions for the complement digraph. In Section 4.3 we consider the relations of sequence digraphs to directed co-graphs (defined in ) and their subclass oriented threshold graphs (defined in ). In Section 4.4 we consider the closure of the classes with respect to the operations taking the converse digraph and taking the complement digraph. In Section 4.5 we characterize sequences whose defined graphs can be obtained by the union of the graphs for the subsequences which consider only the first or last item of each type.

In Section 5 we consider the directed path-width problem on sequence digraphs. We show that for digraphs defined by sequence the directed path-width can be computed in polynomial time. Further we show that for sets of sequences of bounded length, of bounded distribution of the items of every type onto the sequences, or bounded number of items of every type computing the directed path-width of is NP-hard. We also introduce a method which computes from a given set on sequences the directed path-width of , as well as a directed path-decomposition can be computed in time . The main idea is to discover an optimal directed path-decomposition by scanning the sequences left-to-right and keeping in a state the numbers of scanned items of every sequence and the number of active types.

From a parameterized point of view our method leads to an XP-algorithm w.r.t. parameter . While the existence of FPT-algorithms for computing directed path-width is open up to now, there are XP-algorithms for the directed path-width problem for some digraph . The directed path-width can be computed in time by  and in time by . Further in  it is shown how to decide whether the directed path-width of an -semicomplete digraph is at most in time . All these algorithms are exponential in the directed path-width of the input digraph while our algorithm is exponential within the number of sequences. Thus our result improves theses algorithms for digraphs of large directed path-width which can be decomposed by a small number of sequences (see Table 1 for examples). Furthermore the directed path-width can be computed in time , where denotes the vertex cover number of the underlying undirected graph of , by . Thus our result improves this algorithm for digraphs of large which can be decomposed by a small number of sequences (see Table 1 for examples).

Since every single sequence defines a semicomplete -free digraph (cf. Table 2 for the digraphs), we consider digraphs which can be obtained by the union of special semicomplete digraphs which confirms the conjecture of  that semicompleteness is a useful restriction when considering digraphs.222When considering the directed path-width of almost semicomplete digraphs in  the class of semicomplete digraphs was suggested to be a promising stage for pursuing digraph analogues of the splendid outcomes, direct and indirect, from the Graph Minors project. In Section 6 we give conclusions and point out open questions.

## 2 Preliminaries

We use the notations of Bang-Jensen and Gutin  for graphs and digraphs.

##### Undirected graphs

We work with finite undirected graphs , where is a finite set of vertices and is a finite set of edges. For a vertex we denote by the set of all vertices which are adjacent to in , i.e. . Set is called the set of all neighbors of in or neighborhood of in . The degree of a vertex , denoted by , is the number of neighbors of vertex in , i.e. . The maximum vertex degree is . A graph is a subgraph of graph if and . If every edge of with both end vertices in is in , we say that is an induced subgraph of digraph and we write . For some undirected graph its complement graph is defined by .

##### Special Undirected Graphs

By , , we denote a path on vertices and by , , we denote a cycle on vertices. Further by , , we denote a complete graph on vertices and by a complete bipartite graph on vertices.

##### Directed graphs

A directed graph or digraph is a pair , where is a finite set of vertices and

is a finite set of ordered pairs of distinct

333Thus we do not consider directed graphs with loops. vertices called arcs. For a vertex , the sets and are called the set of all out-neighbours and the set of all in-neighbours of . The outdegree of , for short, is the number of out-neighbours of and the indegree of , for short, is the number of in-neighbours of in . The maximum out-degree is and the maximum in-degree is . The maximum vertex degree is and the maximum semi-degree is .

A vertex is out-dominating (in-dominated) if it is adjacent to every other vertex in and is a source (a sink, respectively). A digraph is a subdigraph of digraph if and . If every arc of with both end vertices in is in , we say that is an induced subdigraph of digraph and we write . For some digraph its complement digraph is defined by and its converse digraph is defined by .

Let be a digraph.

• is edgeless if for all , , none of the two pairs and belongs to .

• is a tournament if for all , , exactly one of the two pairs and belongs to .

• is semicomplete if for all , , at least one of the two pairs and belongs to .

• is (bidirectional) complete if for all , , both of the two pairs and belong to .

##### Omitting the directions

For some given digraph , we define its underlying undirected graph by ignoring the directions of the edges, i.e. .

##### Orientations

There are several ways to define a digraph from an undirected graph , see . If we replace every edge of by

• one of the arcs and , we denote as an orientation of . Every digraph which can be obtained by an orientation of some undirected graph is called an oriented graph.

• one or both of the arcs and , we denote as a biorientation of . Every digraph which can be obtained by a biorientation of some undirected graph is called a bioriented graph.

• both arcs and , we denote as a complete biorientation of . Since in this case is well defined by we also denote it by . Every digraph which can be obtained by a complete biorientation of some undirected graph is called a complete bioriented graph.

##### Special Directed Graphs

We recall some special directed graphs. We denote by , a bidirectional complete digraph on vertices. By , we denote a directed path on vertices and by , we denote a directed cycle on vertices.

The -power graph of a digraph is a graph with the same vertex set as . There is an arc in if and only if there is a directed path from to of length at most in .

An oriented forest (tree) is the orientation of a forest (tree). A digraph is an out-tree (in-tree) if it is an oriented tree in which there is exactly one vertex of indegree (outdegree) zero.

A directed acyclic digraph (DAG for short) is a digraph without any , as subdigraph.

## 3 Sequence Digraphs and Sequence Systems

### 3.1 From Sequences to Digraphs

Let be a set of sequences. Every sequence consists of a number of items, such that all items are pairwise distinct. Further there is a function which assigns every item with a type . The set of all types of the items in some sequence is denoted by . For a set of sequences we denote . For some sequence we say item is on the left of item in sequence if . Item is on the position in sequence , since there are items on the left of in sequence .

In order to insert a new item on a position in sequence we first move all items on positions to position starting at the rightmost position and then we insert at position . In order to remove an existing item at a position in sequence we move all items from positions to position starting at position .

For hardness results in Section 5.2 we consider the distribution of the items of a type onto the sequences by

 dQ(t)=|{q∈Q∣t∈types(q)}| and dQ=maxt∈types(Q)dQ(t).

For the number of items for type within the sequences we define

 cQ(t)=∑q∈Q|{b∈q∣t(b)=t}| and cQ=maxt∈types(Q)cQ(t).

Obviously it holds and .

###### Definition 3.1 (Sequence Digraph)

The sequence digraph for a set has a vertex for every type, i.e.  and an arc if and only if there is some sequence in where an item of type is on the left of an item of type . More formally, there is an arc if and only if there is some sequence in , such that there are two items and such that

1. ,

2. ,

3. , and

4. .

Sequence digraphs have successfully been applied in order to model the stacking process of bins from conveyor belts onto pallets with respect to customer orders, which is an important task in palletizing systems used in centralized distribution centers . In this paper we show graph theoretic properties of sequence digraphs and their relation to special digraph classes.

In our examples we will use type identifications instead of item identifications to represent a sequence . For not necessarily distinct types let denote some sequence of pairwise distinct items, such that for . We use this notation for sets of sequences as well.

###### Example 3.2 (Sequence Digraph)

Figure 2 shows the sequence digraph for with sequences , , and .

In Example 3.2 all sequences of contain consecutive items of the same type. This is obviously not necessary to obtain digraph . Let be the subsequence of which is obtained from by removing all but one of consecutive items of the same type for each type and .

###### Observation 3.3

Let be a set of sequences, then .

Next we give methods in order to compute the sequence digraph and also its complement digraph. Therefore we define the position of the first item in some sequence of some type by and the position of the last item of type in sequence by . For technical reasons, if there is no item for type contained in sequence , then we define , and .

###### Lemma 3.4

Let be some set of one sequence, the defined sequence digraph, its complement digraph, and two vertices of .

1. There is an arc , if and only if .

2. There is an arc , if and only if .

3. If , then .

4. There is an arc and an arc , if and only if .

Proof

1. By the definition of the arcs of sequence digraphs.

2. It holds if and only if . Further by (1) and it holds if and only if .

3. If , then our result (2) implies which implies that .

4. Follows by (2) and (3).

###### Lemma 3.5

Let be some set of sequences, the defined sequence digraph, its complement digraph, and two vertices of .

1. There is an arc , if and only if there is some such that .

2. There is an arc , if and only if for every it holds .

Proof

1. By the definition of the arcs of sequence digraphs.

2. It holds if and only if . Further by (1) and we have if and only if for every it holds .

Properties (3) and (4) of Lemma 3.4 can not be shown for sequences, since an arc can be obtained by two types and from two different sequences and such that and . In such situations it is not necessary to have .

By Lemma 3.5(1) only the first and the last item of each type in every are important for the arcs in the corresponding digraph. Let be the subsequence of which is obtained from by removing all except the first and last item for each type and .

###### Observation 3.6

Let be a set of sequences, then .

Alternatively to Lemma 3.5 the sequence digraph can be obtained as follows.

###### Proposition 3.7

Given a set of sequences, the sequence digraph can be computed in time .

Proof  Digraph can be computed in time by the algorithm Create Sequence Digraph shown in Figure 3. A value is added to vertex set or arc set only if it is not already contained. To check this efficiently in time we have to implement and as boolean arrays. Therefore we need some preprocessing phase where we run through each sequence and seek for the types. This can be done in time . To implement list efficiently, we have to use an additional boolean array to test membership in . The inner loop sums up to steps. Since , lines 6-8 will run in time , so the overall running time is .

### 3.2 From Digraphs to Sequences

###### Definition 3.8 (Sequence System)

Let be some digraph and its arc set. The sequence system for is defined as follows.

1. There are items .

2. Sequence for .

3. The type of item is the first vertex of arc and the type of item is the second vertex of arc for . Thus .

###### Example 3.9 (Sequence System)

For the digraph of Figure 2 the corresponding sequence system is given by , where , , , , , , . The sequence digraph of is .

The definitions of the sequence system and the sequence digraph , defined in Section 3.1, imply the following results.

###### Observation 3.10

For every digraph it holds .

The related relation is not true in general (e.g. not for from Example 3.2). But if the reduction to different consecutive items contains exactly two items of different types the following equivalence holds true.

###### Lemma 3.11

For every set of sequences it holds if and only if each sequence contains exactly two items of different types.

Since holds for every set of sequences , in Lemma 3.11 we also can replace condition by condition .

###### Lemma 3.12

For every digraph with there is a set of at most sequences such that .

Proof  For every digraph by Observation 3.10 the sequence system leads to a set of at most sequences such that . If we have two arcs and between two vertices and these can be represented by one sequence .

There are digraphs which even can be defined by one sequence (see Example 4.11(1) and Theorem 4.16) and there are digraphs for which sequences are really necessary (see Lemma 4.12 and Lemma 4.8).

For digraphs of bounded vertex degree the sequence system leads to sets whose distribution and number of items of each type can be bounded as follows.

###### Lemma 3.13

For every digraph where there is a set with and such that .

In case of complete bioriented digraphs we can improve the latter bounds as follows.

###### Lemma 3.14

For every complete bioriented digraph where there is a set with and (for even ) such that .

Proof  By Lemma 3.13 we obtain and . Since we consider complete bioriented digraphs for every two vertices and we now have two sequences and , which can be combined to only one sequence . This leads to and . For we can show the stated improvement as follows. Obviously for every weakly connected component of there is at most one type such that there are exactly items of type . If there is one type such that there are exactly items of type , then there are less than types such that there are exactly items of type . Thus there is one sequence such that there are at most items of type . If we substitute by we achieve .

## 4 Properties of Sequence Digraphs

### 4.1 Graph Classes and their Relations

In order to represent some digraph as a sequence digraph we need exactly types. By Lemma 3.12 every digraph is a sequence digraph using a suitable set of sequences. Thus we want to consider digraphs which can be defined by a given upper bound for the number of sequences. Furthermore the first and the last item of each type within a sequence is the most important one by Observation 3.6, thus we want to analyze the digraphs which can be defined by a given upper bound for the number of items of each type. We define to be the set of all sequence digraphs defined by sets on at most sequences that contain at most items of each type in . By the definition we know for every two integers and the following inclusions between these graph classes.

 Sk,ℓ ⊆ Sk+1,ℓ (1) Sk,ℓ ⊆ Sk,ℓ+1 (2)

By Lemma 3.12 and Observation 3.6 we obtain the following bounds.

###### Corollary 4.1

Let be a set on sequences and the defined graph with . Then we can assume that and .

###### Lemma 4.2

Let and be defined by , then digraph is semicomplete and thus graph is the complete graph on vertices.

Proof  Let be some set of one sequence which defines the sequence digraph . For every vertex in there is exactly one corresponding type . Since for every two vertices and in there are two items and of type and , respectively, which define the arc or .

###### Corollary 4.3

Let be a digraph, such that graph has connected components. Then for every and it holds .

The following generalization of Lemma 4.2 to sequences is easy to verify.

###### Lemma 4.4

Let be some set of sequences, then is connected if and only if there is no set , such that .

Bounds on distribution and number of items for each type in

can be used to classify

into the classes as follows.

###### Lemma 4.5

Let be some set of sequences, then and .

Proof  Relation holds by Observation 3.6. The further results hold by definition.

Next we consider the relations of the defined classes for sequence. Since contains only digraphs with exactly one arc between every pair of vertices (cf. Theorem 4.16 for a more precise characterization) and for contains all bidirectional complete graphs we know that for every . Further by (2) and by Observation3.6 it follows that all classes for are equal.

###### Lemma 4.6

For every two integers it holds .

###### Corollary 4.7

For the following inclusions hold.

 S1,1⊊S1,2=…=S1,ℓ

The equalities of Lemma 4.6 can not be generalized for sequences and since removing items from different sequences can change the sequence digraph. In order to give examples for digraphs which do not belong to some of the classes we next show some useful results.

For a set of digraphs we denote by -free digraphs the set of all digraphs such that no induced subdigraph of is isomorphic to a member of . If consists of only one digraph , we write -free instead of -free. For undirected graphs we use this notation as well.

###### Lemma 4.8

Let be a triangle free graph, i.e. a -free graph, with , such that and be an orientation of . Then for it holds but for or it holds .

Proof  Let and be as in the statement of the lemma. Further let be a set of sequences such that . If some sequence defines more than one arc of , then has to contain at least three items of pairwise distinct types. This would induce a in , which is not possible by our assumption. Thus we have to represent every arc of by one sequence . Thus can not be defined by less than sequences or less than items for every type.

Since for every and every there is a tree on edges and we know by Lemma 4.8 that for and we have . Further by Observation 3.6 we know that for and it holds .

###### Corollary 4.9

For the following inclusions hold.

 Sk,1⊊Sk,2⊊…⊊Sk,k⊆Sk,k+1⊆…⊆Sk,2k=Sk,2k+1=…
###### Proposition 4.10

Let , then for every induced subdigraph of it holds .

Proof  A set of sequences for an induced subdigraph can be obtained from a set of the original digraph by restricting to the items which are destinated for types corresponding to vertices of .

Graph classes which are closed under taking induced subgraphs are called hereditary. Hereditary graph classes are exactly those classes which can be defined by a set of forbidden induced subgraphs. On the other hand, the classes are not closed under taking arbitrary subgraphs by the following example.

###### Example 4.11
1. For every and it holds , which can be verified by set , where

 q