On paths, trails and closed trails in edge-colored graphs

In this paper we deal from an algorithmic perspective with different questions regarding properly edge-colored (or PEC ) paths, trails and closed trails. Given a c -edge-colored graph G c , we show how to polynomially determine, if any, a PEC closed trail subgraph whose number of visits at each vertex is speciﬁed before hand. As a consequence, we solve a number of interesting related problems. For instance, given subset S of vertices in G c , we show how to maximize in polynomial time the number of S -restricted vertex (resp., edge) disjoint PEC paths (resp., trails) in G c with endpoints in S . Further, if G c contains no PEC closed trails, we show that the problem of ﬁnding a PEC s - t trail visiting a given subset of vertices can be solved in polynomial time and prove that it becomes NP -complete if we are restricted to graphs with no PEC cycles. We also deal with graphs G c containing no (almost) PEC cycles or closed trails through s or t . We prove that ﬁnding 2 PEC s - t paths (resp., trails) with length at most L > 0 is NP -complete in the strong sense even for graphs with maximum degree equal to 3 and present an approximation algorithm for computing k vertex (resp., edge) disjoint PEC s - t paths (resp., trails) so that the maximum path (resp., trail) length is no more than k times the PEC path (resp., trail) length in an optimal solution. Further, we prove that ﬁnding 2 vertex disjoint s - t paths with exactly one PEC s - t path is NP -complete. This result is interesting since as proved in Abouelaoualim et . al .(2008), the determination of two or more vertex disjoint PEC s - t paths can be done in polynomial time. Finally, if G c is an arbitrary c -edge-colored graph with maximum vertex degree equal to four, we prove that ﬁnding two monochromatic vertex disjoint s - t paths with different colors is NP -complete. We also propose some related problems.


Introduction
In the last few years a great number of applications have been modelled as problems in edge-colored graphs. To solve them, we can explore some interesting connections between edge-colored graphs and the theory of cycles and paths in directed and undirected graphs, matching theory, and other branches of graph theory [2,4]. Among the applications are problems in molecular biology [17,18], transportation and connectivity problems [11,12,22] (where connection costs are associated to pair of colors at adjacent edges), social sciences [7] and graph models for conflict resolution [23,24].
Given a graph G = (V, E), a walk ρ from s to t in G (called s-t walk) is a sequence ρ = (v 0 , e 0 , v 1 , e 1 , . . . , e k , v k+1 ) where v 0 = s, v k+1 = t and e i = v i v i+1 ∈ E for i = 0, . . . , k. A trail from s to t in G (called s-t trail) is a walk ρ from s to t where e i = e j for i = j. Analogously, a path from s to t is a trail where v i = v j for 0 ≤ i < j ≤ k and 1 ≤ i < j ≤ k + 1. If ρ is a path (resp., trail) with v 0 = v k+1 then ρ defines a cycle (resp., closed trail). We define V (ρ) = (v 0 , v 1 , . . . , v k+1 ) and E(ρ) = (e 0 , e 1 , . . . , e k ). The length of a path, trail or walk is the number of its edges. We say that a path (resp., cycle) ρ defines a Hamiltonian path (resp., Hamiltonian cycle) if all vertices of V are visited exactly once.
Let I c = {1, 2, . . . , c} be a set of given colors, with c ≥ 2. In this work, G c denotes a simple graph whose edges are colored by colors of I c and with no parallel edges linking the same pair of vertices. The vertex and edge sets of G c are denoted by V (G c ) and E(G c ), respectively, where | V (G c ) |= n and | E(G c ) |= m. For a given color i, E i (G c ) denotes the set of edges of G c colored by i. If H c is a subgraph of G c then N i H c (x) denotes the set of vertices of H c , linked to x with edges colored by i. The degree of x in G c is d G c (x) = i∈Ic |N i G c (x)| or just d(x) when no confusion arises. An edge between two vertices x and y is denoted by xy, its color by c(xy) and its weight by w(xy), if any.
Also, given an induced subgraph Q of a graph G, a contraction of Q in G consists of replacing Q by a new vertex z Q , so that each vertex x in G − Q is connected to z Q by an edge, if and only if, there exists an edge xy of G for some vertex y of Q.
From now on, we denote properly edge-colored by just PEC, for short. A subgraph of G c containing at least two edges is said to be a PEC subgraph if any two adjacent edges differ in color. A PEC path (resp., PEC trail) is a path (resp., trail) such that any two successive edges have different colors. Given two vertices s, t ∈ V (G c ), we call PEC s-t path (resp., PEC s-t trail) a path (resp., trail) that begins at s and finishes at t. The vertices s and t will be denoted endpoints of the path or trail. In addition, observe that the edges in a PEC trail need not to form a PEC subgraph since we can have adjacent but not successive edges with the same color.
A PEC path or trail in G c is said to be closed if its endpoints coincide and its first and last edges differ in color. They are also refereed, respectively, as PEC cycle and PEC closed trail. We say that a cycle (resp., closed trail) ϑ x with vertices V (ϑ x ) = (x, v 1 , . . . , v k , x) with x = v i for i = 1, . . . , k is an almost PEC cycle (resp., closed trail) through x in G c if c(xv 1 ) = c(xv k ) and both paths (resp., trails) with at least two edges from x to v 1 and from x to v k are properly edge-colored. Note that, if c(xv 1 ) = c(xv k ) then we have a PEC cycle (resp., closed trail) through x. Further, to simplify our notation, if G c contains no PEC and almost PEC cycles (resp., closed trails) through vertex x, we say that G c contains no (almost) PEC cycles (resp., closed trails) through x in G c . A monochromatic path in G c contains all its edges colored with the same color.
We also deal with the concept of k-(PEC path)-(PEC cycle) subgraph F k of G c (see [2,4]). The subgraph F k denotes an union of k PEC paths and an arbitrarily number of PEC cycles in G c , all vertex disjoint. If k = 0, the subset F 0 will be called PEC cycle subgraph. A k-(PEC path)-(PEC cycle) subgraph F k of G c is maximum if F k has maximum number of vertices among all k-(PEC path)-(PEC cycle) subgraphs F k of G c . Here, we extend this concept and introduce the definition of k-(PEC trail)-(PEC closed trail) subgraph. We say that F k defines a k-(PEC trail)-(PEC closed trail) subgraph of G c if it is composed by an union of k PEC trails with non-coincident endpoints (i.e., if some PEC trail of F k begins or finishes at some vertex x of G c then the remaining PEC trails in F k cannot begin or finish at x, if any) and an arbitrarily number number of maximal PEC closed-trails, all edge disjoint. We say that F k is maximum if F k has maximum number of edges among all k-(PEC trail)-(PEC closed trail) subgraphs of G c . Moreover, we say that a vertex x is visited or covered by a PEC trail or closed trail ρ ∈ F k if x ∈ V (ρ). We denote by α(x) = d F k (x)/2 , the total number of visits at x ∈ V ( F k ). If k = 0, the subset F 0 will be called PEC closed trail subgraph (note that d F0 (x) is always even for every x). Further, notice thatF 0 with α(x) = 1 for every x of F 0 defines a PEC cycle subgraph.
Finally, we introduce the concept of S-restricted PEC path (resp., trail). Given G c and a subset S ⊆ V (G c ) with |S| ≥ 2, we say that a PEC x-y path (resp., trail) ρ with x = y and x, y ∈ S is S-restricted, if there are no vertices of S belonging to V (ρ) \ {x, y}.

Some related work
Given an arbitrary c-edge-colored graph G c , the determination of one PEC cycle or closed trail through a subset Ψ of vertices is NP-complete even for |Ψ| = 2 and c = Ω(n 2 ) (see [1,5]). When restricted to c-edge-colored complete graphs K c n with c ≥ 2, Benkouart et. al. [5] present efficient algorithms for finding PEC cycles through a given subset of vertices. In the work of Das and Rao [8], they characterize those 2-edge-colored complete graphs which contain a PEC closed trail visiting each vertex x of K c n (for c = 2) exactly α(x) > 0 times. Generalizing this last problem Bang-Jensen and Gutin [3] solved the problem of determining the length of a longest PEC closed trail visiting each vertex x in 2-edge-colored complete multigraphs at most α(x) > 0 times.
The determination of PEC s-t paths (for Ψ = ∅) over arbitrary c-edge-colored graphs was first solved by Edmonds for two colors (see Lemma 1.1 in [16]) and then extended by Szeider [20] to include any number of colors. In Abouelaoualim et al. [1], the authors also deal with PEC trails and present polynomial time procedures for several versions of the s-t path/trail problem: as the shortest PEC s-t path/trail on general c-edge-colored graphs and the longest PEC path (resp., trail) for graphs with no PEC cycles (resp., closed trails). Recently, Feng et. al. [9], showed how to determine in polynomial time a Hamiltonian PEC path in K c n (for c ≥ 2), provided that one exists. If G c is an arbitrary 2-edge-colored graph and Ψ a non-empty subset of V (G c ) \ {s, t}, Chou et. al. [7] show that the determination of one PEC s-t path passing by all vertices of Ψ is NP-complete even for |Ψ| = 1 (actually, this result can be easily extended to include any number of colors). They also present an efficient algorithm for this problem over 2-edge-colored complete graphs.
A polynomial characterization of c-edge-colored graphs with no PEC cycles was first presented by Yeo [25] and generalized in [1] for PEC closed trails. In addition, the authors in [1] prove that deciding whether there exist k pairwise vertex (resp., edge) disjoint PEC s-t paths (resp., trails) over arbitrary c-edge-colored graphs G c is NPcomplete even for k = 2 and c = Ω(n 2 ). Moreover, they prove that these problems remain NP-complete for c-edge-colored graphs containing no PEC cycles (resp., closed trails) and c = Ω(n). They conclude their paper with some approximation results for the associated maximization problems together with polynomial results for c-edge-colored graphs with no (almost) PEC cycles or closed trails through s or t.
Some interesting questions regarding monochromatic paths can be found in the literature [13,15,19]. For instance, the authors in [15], show that it is NP-hard to find the minimum number of vertex disjoint monochromatic paths which cover the vertices of the graph G c . They also show that there is no constant factor approximation algorithm for this problem unless P = NP.
In Gourvès et al. [12], the authors consider s-t paths, trails and walks with reload costs between colors. In this case, given a c-edge-colored graph, whenever a vertex is crossed by a walk, there is an associated non-negative reload costs r i,j , with i and j denoting, respectively, successive edge colors in this walk. In the minimum reload s-t path/trail/walk problem the objective is to find an s-t path/trail/walk with minimum reload cost. As discussed in [12], reload s-t paths in edge-colored graphs may be converted into PEC or monochromatic s-t paths by conveniently choosing reload costs between each pair of colors. Other results regarding reload costs can be found in [11,22].

Contributions
In Section 2 in the Fundamental Lemma we deal with the construction of PEC closed trails subgraphsF 0 and show how to find in polynomial time, if any, a subset of PEC closed trails visiting all vertices of G c a prescribed number of times defined by an interval associated to each vertex. This result generalizes both works of Benkouar et. al. [5] and Das and Rao [8] only restricted to K c n . As one of its consequences, given a subset S of vertices in G c , we show how maximize in polynomial time the total number of S-restricted PEC paths/trails with non-coincident endpoints in S. In Section 3, we deal with the determination of one s-t trail visiting a non-empty subset Ψ of V (G c ) \ {s, t}. We show how to polynomially solve this problem over graphs containing no PEC closed trails and prove that it becomes NP-complete over graphs containing no PEC cycles (note that PEC closed trails are allowed in this case). Graphs with no PEC cycles or closed trails are interesting since they constitute, in a certain sense, the edge-colored counterpart of non-colored acyclic digraphs. We also show how to determine in polynomial time, if any, an s-t trail visiting a subset E ⊆ E(G c ).
In Section 4 we deal with graphs containing no PEC cycles or closed trails through s or t. We prove that to check whether G c contains two PEC s-t paths/trails with length at most L > 0 is NP-complete in the strong sense even for graphs with maximum vertex degree equal to 3. Further, also based on the Fundamental Lemma, we present an approximation algorithm for computing k vertex/edge disjoint PEC s-t paths/trails so that the maximum path/trail length is no more than k times the PEC path/trail length in an optimal solution. Moreover, if L denotes the length of a shortest PEC s-t path/trail in G c , we consider the problem of computing k vertex/edge disjoint PEC s-t paths/trails of sizes at most L, L + 1 and L + 2, respectively. We also prove that finding two vertex disjoint s-t paths with exactly one PEC s-t path is NP-complete. This result is interesting since as proved in [1], the problem of finding two PEC s-t paths (resp., trails) in graphs with no PEC cycles (resp., closed trails) through s or t can be solved in polynomial time.
In Section 5, we deal with arbitrary c-edge-colored graphs and prove that finding 2 vertex disjoint monochromatic s-t paths with different colors is NP-complete even for graphs with maximum degree 4. Finally, we conclude in Section 6 by presenting some final remarks and future directions. Some related problems are also proposed at the end of each section.

Determination of a PEC closed trail subgraph visiting vertices a prescribed number of times
In this section we extend some of the results and concepts presented in [1] and present our Fundamental Lemma which will be useful in the proof of other important polynomial time procedures in this paper. Initially, recall that for arbitrary c-edge-colored graphs (see Subsection 1.1), the determination of one PEC cycle or closed trail through a subset with two or more vertices is NP-complete. Here, we want to determine a subset of PEC closed trails (or a PEC closed trail subgraph F 0 ) satisfying a non-negative function α over V (G c ) denoting the total number of visits at each vertex in G c . Formally, given two mappings α min and α max from V (G c ) to N such that we show how to find in polynomial time, if any, a subset of PEC closed trails whose the total number of visits at x is equal to α(x) for some α(x) ∈ I α (x) = {α min (x), . . . , α max (x)}. Here, we show that this can be accomplished by using the concept of Edmonds-Szeider graph and trail-path graph [1,20] in a modified manner. For completeness, we recall the definition of Edmonds-Szeider graph as discussed in [1]. Given G c and vertices x ∈ V (G c ), we first construct subgraphs or gadgets G x with: See the gadgets G a , G b , G c and G d in the example of Figure 1. The former graph G will be called Edmonds-Szeider graph and is constructed as follows: To illustrate this concept, we can use the Edmonds-Szeider graph G associated with G c to obtain a subset of vertex disjoint PEC cycles (or PEC cycle subgraph F 0 ). To do that, given a perfect matching M in G (which always exists in this case) a possibly empty subset of PEC cycles in G c can be easily obtained after coloring all edges x i y i ∈ (E(G) ∩ M ) with color i and then contracting all subgraphs G x of G into a single vertex x. In addition, we can easily determine if all vertices of G c can be covered or not by a disjoint subset of PEC cycles. To do that, we assign unitary costs w(x i y i ) = 1 for every x i y i ∈ E(G) and cost zero for the remaining edges of E(G). In this way, the non-colored graph G contains a maximum perfect weighted matching M * with total edge cost cost(M * ) = |V (G c )|, if and only if, each vertex of G c is visited exactly once by some PEC cycle in F 0 . See the example of Figure 1.  Now, given intervals I(α x ) associated to each x of G c and conveniently adapting the concepts of Edmonds-Szeider graph and trail-path graph as described in [1], we can establish the following result for the determination of a PEC closed trail subgraph satisfying α.

Lemma 1 : (Fundamental Lemma)
Consider an arbitrary G c and I α (x) = {α min (x), . . . , α max (x)} for each x ∈ V (G c ). Then, we can find within polynomial time, if any, a subset of PEC closed trails visiting all vertices of G c exactly α(x) times for α(x) ∈ I α (x).
Proof: Initially, given G c and I α (x) for every x ∈ V (G c ), we show how to construct a c-edge-colored graph H c (I α ), denoted here by α-trail-path graph. The construction of H c (I α ) can be done into three steps and extends the definition of a trail-path graph presented in [1]: For each edge xy of G c , say colored k, add two new vertices v xy and u xy and add edges x i v xy , u xy y j , for i = 1, . . . , α x and j = 1, . . . , α y , all of them colored by k.
(c) Add edge v xy u xy with a new unused color k ∈ {1, . . . , c} with k = k.
In the sequel, construct the (non-colored) Edmonds-Szeider graph associated to H c (I α ) and contract all gadgets associated to vertices ofV . Let us denote by H this new non-colored graph. Note that, we have an associated noncolored gadget H z of H for every z ∈ S x (see Figures 2(a) and 2(b)). In the Figure 2(a) we are assuming z ≡ x i for some i ∈ {1, . . . , α x }. Now, for every z ∈ S x and their associated H z , delete edges z a z b (see Figure 2(c)) and relabel all these gadgets by H z . We call modified Edmonds-Szeider graph, denoted byH, the resulting non-colored graph obtained in this way.
The idea, provided that a subset of PEC closed trails satisfying function α in G c exists, is to find an associated subset of PEC cycles in H c (I α ) by forcing the visit exactly once of all vertices z ∈ S x , the remaining vertices z ∈ S x \ S x may be visited or not by these cycles. Since |S x | = α min (x) and |S x | = α max (x), after contracting all subgraphs induced by S x , vertex x will be visited by PEC closed trails exactly α(x) times in G c for some α(x) ∈ I α (x). Note that PEC cycles in the α-trail-path graph H c (I α ) will correspond to PEC closed trails satisfying α in G c and vice-versa. This may be accomplished by just finding a perfect matching M * inH, if any.
Thus, in the case M * exists, we can determine the associated PEC closed trail subgraphF 0 satisfying α as in the sequel. Initially, for all pairs of edges z k v xy , u xy w k of M * ⊆ E(H) for some z ∈ S x and w ∈ S y in H c (I α ), we pick edge xy of G c , colored k. Further, note that if z ∈ S x , we have two edges of M * not belonging to E(H z ) and incident with exactly two different vertices of H z . Thus, vertex z must be visited exactly once in H c (I α ). Since |S x | = α min (x) and |S x | = α max (x), we have at least α min (x) and at most α max (x) visits at vertex x in G c . Therefore, the set of picked edges in G c defines a PEC closed trail subgraph satisfying α. Reciprocally, given a set of PEC closed trail subgraphs satisfying α, we can easily determine an associated set of PEC cycles in H c (I α ) and a corresponding perfect matching M * inH. 2 Therefore, as one of the consequences of the Fundamental Lemma we have the following result.
Theorem 2 Let G c be an arbitrary c-edge-colored graph and S a subset of V (G c ). Then, the problem of maximizing the number of S-restricted vertex disjoint PEC paths (resp., edge disjoint PEC trails) with non-coincident endpoints in S can be solved in polynomial time.
Proof: Initially, to avoid paths of unitary length between pairs of S (since PEC paths/trails contains at least two edges), we delete all edges xy ∈ E(G c ) with x, y ∈ S. Note that these edges do not eliminate any S-restricted PEC path (or trail) between two vertices of S. Thus, w.l.o.g., consider G c with no edges between pairs of S. Here, we only deal with the problem of maximizing the number of edge disjoint S-restricted PEC trails with endpoints of S, the PEC path case is analogous and is omitted here.
To accomplish our goal, given G c and S ⊂ V (G c ) we first construct an edge-colored graph G c v with a new vertex v and c colors with x ∈ S} and color all |S| edges vx with a new different color of I c \ I c . Basically, for a given set of intervals and the associated modified Edmonds-Szeider graphH v as detailed in the Fundamental Lemma. In addition, for all edges ), we assign weights w(p k v xy ) = w(u xy q k ) = 1/2, and weight zero for the remaining edges ofH v . In this way, note that if edge xy belongs to some PEC closed trail in G c v , we have exactly two edges (each of them with cost 1/2) in the associated perfect matching M inH v and vice versa. However, if xy does not belong to any PEC closed trail then edge v xy u xy (with cost zero) will be selected to M .
Essentially, the idea is to construct an interval of integer values I α (x) associated to each x of V (G c v ) and determine, if any, a subset of PEC closed trailsF 0 with the maximum number of visits at v and minimum number of edges. It is important to note that, even if we have no edges xy between pairs of S, we can have non S-restricted PEC trails between two endpoints of S (see the PEC path ρ 3 in the example of Figure 3). Thus, to avoid that, each PEC closed trail ofF 0 passing by v must correspond to a shortest S-restricted PEC trail in G c with endpoints in S. Therefore, to maximize the number of S-restricted s-t trails among vertices of S we construct the following polynomial time algorithm: update the weightedH v , and return to step 3. Note in the Step 3 above that the total number of edges in the PEC closed trail subgraph of G c v is equal to the cost of the minimum perfect matching M * computed overH v . This will ensure the presence ofᾱ v S-restricted shortest PEC trails among vertices of S in G c and avoiding non S-restricted PEC trails. To see that, suppose we have a non S-restricted PEC x-y trail with x, y ∈ S and an associated minimum perfect matching M * inH v . Since ρ is non S-restricted, there is at least one vertex z of S belonging to V (ρ) \ {x, y}. Now, we can take a shorter S-restricted PEC trail ρ with endpoints x and z, which always exists in this case. Therefore, we can easily construct a perfect matching M (associated to ρ ) with cost(M ) < cost(M * ), leading to a contradiction. 2 We conclude the section with the following related problem: Can the problem of maximizing the number of (non necessarily S-restricted) vertex disjoint PEC paths (resp., edge disjoint PEC trails) with endpoints in S be solved in polynomial time?
In the Problem 1 above we can include another constraint. For instance, whether or not the endpoints of two different PEC trails can coincide. In both cases, the problem seems harder when compared to the S-restricted case discussed here.

Determination of a PEC s-t path/trail visiting a subset Ψ of vertices
Let G c be an arbitrary c-edge-colored graph and Ψ a non-empty subset of V (G c ) \ {s, t}. As discussed in Subsection 1.1, the determination of one PEC s-t path visiting all vertices of Ψ is NP-complete even for |Ψ| = 1 (see [7]). Here, we show how to find in polynomial time, if any, a PEC s-t trail visiting all vertices of Ψ restricted to c-edge-colored graphs with no PEC closed trails. We also consider a slightly more general class of graphs and prove that the same problem over c-edge-colored graphs with no PEC cycles is NP-complete. Note that PEC closed trails are allowed in this case.

Graphs with no PEC closed trails
We begin with the following auxiliary lemma: Lemma 3 Consider G c with no PEC closed trails and vertices s, t ∈ V (G c ). Further, assume that there exists a PEC trail ρ between s and t in G c . Then, there are no vertices of ρ which are visited three times or more.
Proof: Suppose a vertex x of ρ with at least 3 visits (i.e., α(x) ≥ 3). Without loss of generality, assume α(x) = 3 and c = 2. In this case we have two possibilities as illustrated in the Figure 4. In the first case (resp., second case), the first and last edges of ρ incident to x 1 have different colors (resp., the same color). In the s-t trail ρ of Figure 4(a), one can easily observes that subsequence ρ of ρ with V (ρ ) = (x 1 , x 4 , x 5 , x 1 , x 2 , x 3 , x 1 ) defines a PEC closed trail in G c , leading to a contradiction. Analogously, in the s-t trail ρ of Figure (4 Theorem 4 Let G c be a c-edge-colored graph with no PEC closed trails, s, t ∈ V (G c ) and a non-empty subset Ψ of V (G c ) \ {s, t}. Then, we can find within polynomial time, if any, a PEC s-t trail visiting all vertices of Ψ.
Proof: Given G c , introduce an additional vertex v and construct a new c -edge-colored G c v as discussed in the Theorem 2 above. Now consider W = {s, t, v} and define intervals I α (x) associated to vertices x ∈ V (G c v ) as in the sequel. Initially, set α min (x) = α max (x) = 1, for every x of W . Since G c contains no PEC closed trails, we conclude from Lemma 3 that arbitrary s-t trails in G c , if any, contain vertices visited at most 2 times. Therefore, we set α max (x) = 2 for every x of V (G c v ) \ W . Now, since all vertices of Ψ must be visited at least once, we define α min (x) = 1 for every x of Ψ and α min (x) = 0 for every In the sequel, construct the associated modified Edmonds-Szeider graphH v as detailed in the Fundamental Lemma. After finding a perfect matching overH v , provided that one exists, we can easily determine a PEC closed trail in G c v visiting all vertices of W ∪ Ψ and such that function α is satisfied. This will correspond to a PEC s-t trail visiting all vertices of Ψ in G c . 2 In the sequel, we show how to extend the Fundamental Lemma in order to force the visit of a given subset E of edges. Formally: be a c-edge-colored graph with no PEC closed trails and E ⊆ E. Then, we can find within polynomial time, if any, a PEC s-t trail visiting all edges of E .

Proof:
Initially, construct G c v and function α exactly in the same way as described in the first paragraph of Theorem 4 and define α min (x) = 0 for every x ∈ V (G c v ) \ W . In the sequel, construct the α-trail-path graph H c v (I α ) associated to G c v and its modified Edmonds-Szeider graphH v as described in the Fundamental Lemma. Note that, by construction of H c v (I α ) andH v , we have two vertices v xy , u xy associated to edges xy of G c v . Now, for every pair v xy , u xy ofH v associated to edges xy of E ⊆ E, we add two new vertices a xy , b xy and change edge v xy u xy by edges: v xy a xy , a xy b xy and a xy u xy respectively (as illustrated in the Figure 5(c)). LetH v be this new non-colored graph.   Therefore, if we find a perfect matching overH v , provided that one exists, we can easily determine a PEC closed trail in G c v visiting all vertices of W and all edges of E . Note that, since G c contains no PEC closed trails, the PEC closed trail subgraph in G c v is composed by exactly one PEC closed trail containing W and E ⊆ E, respectively. Thus, after deleting vertex v, this will correspond to a PEC s-t trail visiting all vertices of E in G c .

Graphs with no PEC cycles
Here, we consider PEC s-t paths and trails over c-edge-colored graphs with no PEC cycles. Note that PEC closed trails are allowed in this case. We begin with the following result: Theorem 6 Let G c = (V, E) be a c-edge-colored graph with no PEC cycles, s, t ∈ V and a non-empty subset Ψ of V \ {s, t}. Then, the problem of finding a PEC s-t path visiting all vertices of Ψ can be solved in polynomial time.
The proof of Theorem 6 is analogous to Theorem 4 above and is omitted here. As an immediate consequence we have the following result: Corollary 7 The problem of finding a Hamiltonian PEC s-t path in G c with no PEC cycles can be solved in polynomial time.
Proof: It suffices to set Ψ = V (G c ) \ {s, t}. 2 Now, we are interested in to find a PEC s-t trail visiting a given vertex w of V (G c ) \ {s, t}. Surprisingly, if no s-t paths visiting w exist, we prove that the determination of one PEC s-t trail passing by w in G c is NP-complete.
Theorem 8 Consider G c with no PEC cycles, c ≥ 2 and s, t, w ∈ V (G c ). Then, the problem of finding a PEC s-t trail visiting w is NP-complete.
Proof: Clearly, our problem belongs to NP. To prove that it is NP-complete, we construct a polynomial time reduction from the Local Path Problem (LPP): given a non-colored digraph D = (V, A) and three vertices p, q, v ∈ V , the objective in the LPP is to find, if any, a directed p-q path through vertex v in D (i.e., each vertex in the path, other than p and q, has exactly one incoming and one outgoing arc). The LPP is known to be NP-complete (see Fortune et. al. [10]). Without loss of generality, let D be a digraph with no incoming arcs at p and with no outgoing arcs from q. In the sequel, we show how to polynomially construct a 2-edge-colored graph G c with no PEC cycles and vertices s, t and w in V (G c ), such that we have a directed p-q path visiting v in D, if and only if, we have an s-t trail visiting w in G c .
For each vertex x ∈ V (D)\{p, q}, create the following gadget G In the sequel, change p, q ∈ V , respectively, by s = p a and t = q e in V (G c ). Now, for each arc e = xu of A (with x, u ∈ V (D)) add vertex z xu and edges x a z xu and z xu u e (gadget G e ) with colors j and i, respectively. This construction is obviously polynomial. See the example of Figure 6. Observe that G c contains no PEC cycles since all circuits (or directed cycles) of D, if any, are mapped to PEC closed trails in G c . Actually, any PEC closed trail ρ in G c visiting gadget G x for some x must visit twice vertex x b . Thus, ρ never defines a PEC cycle. Further, notice that in all gadgets G x (associated to x ∈ V (D) \ {p, q}), vertexx can be visited at most once (otherwise, both edges incident atx would be visited twice). Thus, if we have a p-q path in D passing by v, we have a PEC s-t trail passing by w =v in G c and vice-versa. 4 Finding k ≥ 2 PEC s-t paths/trails in graphs with no (almost) PEC closed trails through s or t In this section we deal with a number of results regarding the determination of two or more PEC s-t paths/trails over c-edge-colored graphs with no (almost) PEC closed trails through s or t. In the general case, it is proved in Abouelaoualim et. al. [1] that deciding whether an arbitrary c-edge-colored graph G c on n vertices contains two vertex/edge disjoint PEC s-t paths/trails is NP-complete even for graphs with Ω(n 2 ) colors. In addition, they show that if G c contains no (almost) PEC cycles (resp., closed trails) through s or t then the problem of maximizing the number of vertex (resp., edge) disjoint PEC s-t paths (resp., s-t trails) can be solved in polynomial time.
Here, given G c with no (almost) PEC closed trails through s or t, we define the MIN-MAX k-PEC s-t path (resp., trail) problem whose objective is to find k vertex/edge disjoint PEC s-t paths (resp., trails) such that size of the maximum PEC s-t path (resp., trail) is minimized. We show that these problems are NP-hard even for k = 2 and present a k-approximation algorithm based on the Fundamental Lemma. Further, we prove that the problem of maximizing the number of shortest PEC s-t paths/trails, say of size L, can be solved in polynomial time, and it becomes NP-complete for PEC s-t paths/trails of size at most L + 2 for c = 2 and L + 1 for c ≥ 3. These results generalize the work of Tragoudas and Varol [21] only restricted to non-colored graphs. In addition, as a consequence of the NP-hardness of the MIN-MAX 2-PEC s-t path (see Theorem 9 below) we can prove that deciding whether there exists 2-vertex disjoint s-t paths ρ 1 and ρ 2 such that ρ 1 is a PEC s-t path is NP-complete. This result is interesting since the determination of two PEC s-t paths/trails can be done in polynomial time as detailed in [1].
Therefore, we first consider the following decision version associated to the MIN-MAX 2-PEC s-t path problem. The proof can be easily extended to handle trails instead of paths.
Theorem 9 Let G c be a c-edge-colored graph with no (almost) PEC closed trails through s or t, and a constant L > 0. Then, the problem of finding 2 vertex/edge disjoint PEC s-t paths, each having at most L edges in G c is NP-complete in the strong sense, even for graphs with maximum vertex degree equal to 3.

Proof:
The vertex-disjoint case follows immediately from the edge-disjoint case and its proof is omitted. Initially, we consider I c = {1, 2}. Here, we prove that the (3, B2)-SAT problem can be polynomially reduced to the problem of finding two edge disjoint PEC s-t paths, each having at most L edges. An instance I of (3, B2)-SAT consists of n variables X = {x 1 , . . . , x n } and m clauses C = {c 1 , . . . , c m }. Each clause has exactly three literals. Each variable appears four times, twice negated and twice unnegated. Deciding whether I is satisfiable is NP-complete [6].
We say that c j is the h-th clause of x i , if and only if, x i appears in c j and x i appears in exactly h − 1 other clauses c j with j < j. We say that x i is the -th variable of c j , if and only if, x i and exactly − 1 other variables x i with i < i appear in c j .
Let us show how to build a 2-edge-colored graph G c upon I with no (almost) PEC closed trails through s or t and maximum vertex degree equal to 3. For each x i ∈ X (resp., c j ∈ C) we build a gadget G xi (resp., G cj ) as depicted on the left (resp. right) of Figure 7. The gadget of a variable x i has 18 vertices. It consists of a right part (vertices t k ia , t k i b for k = 0, . . . , 3 and edges t 0 , an entrance a i , an exit b i and edges The left (resp., right) part of this gadget corresponds to the case where x i is set to false (resp., true). Note that each edge of G xi has color 2 (see Figure 7(a)). As discussed later, some other edges with color 1 will be also included in G xi . The gadget of a clause c j (containing 12 vertices) consists of an entrance q j , an exit w j with three edges u 1 j v 1 j , u 2 j v 2 j , and u 3 j v 3 j (all with color 2) corresponding to the first, second and third variables of c j , respectively. We also have 4 edges q j u , q j u , v q j and v q j with color 2 and 6 edges u u 1 j , u u 2 j , u u 3 j , v 1 j v , v 2 j v and v 3 j v all with color 1 (see Figure 7(b)). We add 2 vertices s and t and we link the gadgets as follows (see Figure 8(a)): b 1 a 2 , b 2 a 3 , . . . , b n−1 a n and b n t, all of them with color 1 (thin); • sq 1 , w 1 q 2 , w 2 q 3 , . . . , w m−1 q m , w m t, all of them with color 1 (thin).
For each pair x i , c j such that x i is the -th variable of c j and c j is the h-th clause of x i we proceed as follows. If x i appears negated in c j then add edges . See the example of Figure 8. Each vertex's degree is at most 3 and every edge incident to vertices a i and b i (resp., q j and w j ), inside G xi (resp., G cj ) has color 2 and every edge incident to s or t has color 1. Thus, it is easy to see that G c contains no (almost) PEC closed trails through s and t.
In order to simplify the proof, we deal with the version where the edges have an odd and polynomially bounded length. Then, we can replace each edge e of integer length (e) by a PEC path ρ e made of (e) edges (initial and terminal edges of ρ e have color c(e)). We complete the construction of G c by assigning a length L c = 18n − 5 to the edges w 1 q 2 , w 2 q 3 , . . . , w m−1 q m , w m t, and a length L v = 18n(m − 1) + 1 to sa 1 . The remaining edges of G c have length 1 (see Figure 8(a)).
The graph contains 18n+12m+2 vertices: 18 per variable gadget, 12 per clause gadget, s and t. Its construction is clearly done within polynomial time. An instance I of our problem consists of an weighted 2-edge-colored G c as above and L = 18nm + 1. We claim that a truth assignment for I, instance of (3, B2)-SAT, corresponds to 2 edge disjoint PEC s-t paths in I , each with total length at most L = 18mn + 1 and vice-versa.
An s-t path with first edge sa 1 and last edge b n t is called a variable path and it is denoted by ρ v . An s-t path with first edge sq 1 and last edge w m t is called a clause path and it is denoted by ρ c .
Suppose that we have 2 paths ρ v and ρ c , associated to I . If ρ v uses an edge of length L c then its total length (of size at least L c + L v + 6) exceeds L. Therefore it never passes through a vertex q j or w j (1 ≤ j ≤ m). Since ρ v is an s-t path, it must visit each variable gadget G xi . Thus, each vertex a i is visited by ρ v . Since ρ v and ρ c are edge-disjoint, ρ c cannot go through a i , i = 1, . . . , n. Then, ρ c must visit each clause gadget G cj to reach t. Further, both ρ v and ρ c have length L.
Thus, if we have 2 PEC s-t paths, each of weight L in G c (resp., variable and clause paths) then we have a truth assignment for I. For instance, if an edge u k j v k j of the gadget G cj is used by a clause path and variable x i (appearing in the k-th position of c j ) is in the negated form (resp., unnegated form) then variable x i must be false (resp., true) and clause c j will be true in the assignment. Therefore, using the clause and the variable s-t paths (of weight L) we can uniquely determine a truth assignment for I.
Conversely, suppose we have a truth assignment, solution to I. To build a variable path ρ v , we take the right (resp., left) part if and only if x i is true (resp., false) (see Figure 8(b)). Then the total length of ρ v is L v + 14n < L. Each clause c j is satisfied so there is an edge u k j v k j of G cj not used by ρ v . The clause path can use it to reach t. In this case ρ c has total length m(L c + 5) + 1 = L.
Finally, we show how to extend our result for graphs with c = Ω(n 2 ) colors. To do that, it suffices to define a complete graph K c n with I c ⊆ I c and edge xy with x ∈ V (K c n ), y ∈ V (G c ) and some color c(xy) ∈ I c . Thus, the resulting c -edge-colored graph G c α with V (G c α ) = V (G c ) ∪ V (K c n ) and edges E(G c α ) = E(G c ) ∪ E(K c n ) ∪ {xy} will contains, resp., 2n vertices and at most n(n−1) 2 different edge colors, completing our proof. 2 Corollary 10 Let s and t be two vertices in a c-edge-colored graph G c with maximum vertex degree equal to 3 and with no (almost) PEC closed trails through s or t. Then, it is NP-complete to decide whether there exist 2 vertex/edge disjoint s-t paths such that exactly one of them is a PEC s-t path.
Proof: Again, the vertex disjoint case follows immediately from the edge-disjoint case. Analogously, given an instance I of the (3, B2)-SAT problem, we show how to construct a c-edge-colored graph G c with no (almost) PEC closed trails through s or t and maximum vertex degree equal to 3. In this case G c is non-weighted and the variable and clause gadgets are constructed exactly as in the proof of Theorem 9 except for the color of clause gadgets. Now, all edges of c j for j = 1, ..., m are colored blue (color 2). Using the same arguments as above, we can easily see that there will exist two s-t paths in G c with exactly one PEC s-t path, if and only if, instance I is true at some truth assignment. 2 Note that Corollary 10 above can be easily extended to handle trails instead of paths. Now, using the Fundamental Lemma we can establish the following approximation result for the MIN-MAX k-PEC s-t path/trail problem: Theorem 11 Consider a fixed constant k ≥ 2 and a c-edge-colored graph G c with no (almost) PEC cycles (resp., closed trails) through s or t. Then, the problem of finding k vertex (resp., edge) disjoint PEC s-t paths (resp., trails) so that the maximum path (resp., trail) length is minimized has performance ratio equal to k.
Proof: Here, we only deal with the edge disjoint case, the vertex disjoint case is analogous. Therefore, given G c as above, assign weights w(xy) = 1 for every edge xy of E(G c ). In the sequel, add a new vertex v and 2k vertices S = {s 1 , . . . , s k } and T = {t 1 , . . . , t k }, respectively. Further, define Φ = {s, t, v} ∪ S ∪ T . Now, color edges {s 1 s, . . . , s k s} and {t 1 t, . . . , t k t} with a new color c + 1, all edges {vs 1 , . . . , vs k } with a new color c + 2 and all edges {vt 1 , . . . , vt k } with a new color c + 3 (see the Figure 9). Finally, assign weight w(xy) = 0 to all edges xy of E(Φ). Let us denote by G c Φ this new weighted c -edge-colored graph. Note that G c Φ contains n + 2k + 1 vertices and c = c + 3 colors. In the sequel, define intervals α min (x) = α max (x) = k for every x ∈ {s, t, v}, α min (x) = α max (x) = 1 for every x ∈ S ∪ T and α min (x) = 0 and α max (x) = k for every x ∈ V (G c Φ ) \ Φ (note that x can be visited at most k times in the edge disjoint case). Finally, construct a weighted modified Edmonds-Szeider graphH Φ (associated to H c Φ (I α )) as discussed in the Fundamental Lemma, i.e., for all edges p v xy , u xy q ofH Φ associated to edges xy with color in E(G c Φ ) (with p ∈ S x and q ∈ S y in H c Φ (I α )) assign weights w(p v xy )=w(u xy q )=w(xy)/2, resp., and assign weight zero for the remaining edges ofH Φ . ...
... Our algorithm proceed as follows. Initially, find a minimum perfect matching M * with total edge weight equal to cost(M * ) inH Φ , if any. Then, determine the associated PEC closed trail subgraph satisfying α in G c Φ . Since we have no (almost) PEC closed trails through s or t, each of the k PEC closed trails passing by v in G c Φ will be associated to a PEC s-t trail in G c . Let Ξ be the set of k PEC s-t trails in G c obtained in this way. Note that cost(M * ) = ξ∈Ξ length(ξ). Now, denote by z H (ξ k ) the length of the maximum PEC s-t trail ξ k of Ξ. Then, we claim that z H (ξ k ) ≤ k.Opt(G c ), with Opt(G c ) denoting the k-th longest trail of minimum length in G c . Initially, note that z H (ξ k ) ≤ cost(M * ). Since M * is a minimum perfect matching, it follows that cost(M * )/k ≤ Opt(G c ) and z H (ξ k ) ≤ k.Opt(G c ), which proves our result. 2 Theorem 12 Consider G c with no (almost) PEC closed trails through s or t in V (G c ). Then, the problem of maximizing the number of vertex/edge disjoint PEC s-t paths (resp., trails) with shortest path (resp., trail) length can be solved in polynomial time.
Proof: Similarly to Theorem 11, we will only consider the edge-disjoint case. Further, we only deal with trails instead of paths. Therefore, initially construct a shortest PEC s-t trail in G c (see [1] for details) and denote its length by L > 0 (w.l.o.g., we assume the existence of at least one PEC s-t trail in G c of size L). Construct the weighted c -edge-colored graph G c Φ as in the previous theorem and define intervals α min (x) = α max (x) = k with x ∈ {s, t, v} and some integer k > 0 (to be defined later), α min (x) = α max (x) = 1 for every x ∈ S ∪ T , α min (x) = 0 and α max (x) = k for every x ∈ V (G c Φ ) \ Φ. Finally, construct the weighted modified Edmonds-Szeider graph, denoted here byH Φ (k) and associated to H c Φ (I α ) and k, respectively. Now, we proceed as follows: Since G c contains no (almost) PEC closed trails through s or t, the determination of a minimum perfect matching M * inH Φ (k), if any, will be associated with k PEC closed trails in G c Φ passing by s, t and v, resp., each of them associated to a PEC s-t trail in G c . Further, if cost(M * ) = kL we have exactly k PEC s-t trails with minimum length L in G c . 2 The following results regard PEC s-t paths in c-edge-colored graphs with no (almost) PEC cycles through s or t. They can be easily extended to handle PEC s-t trails in graphs with no (almost) PEC closed trails through s or t (the details are omitted and left to the reader). Initially, consider the following auxiliary result restricted to 2-edge colored graphs: Lemma 13 Consider G c with c = 2 and with no (almost) PEC cycles through s or t. If a shortest PEC s-t path has size L then G c contains no other vertex disjoint PEC path between s and t of size L + 1.
Proof: Suppose α and β two vertex disjoint PEC s-t paths of size L and L + 1, respectively. Without loss of generality, consider the first and last edges of α colored red, incident respectively to s and t. Further, since β has size L + 1 its first and last edges must have different colors, for instance, a red edge incident to s and a blue edge incident to t. In this case, we would have an almost PEC cycle passing by s and containing vertex t, resulting in a contradiction. 2 Theorem 14 Consider G c with c = 2 and with no (almost) PEC cycles through s or t in V (G c ). If L > 0 denotes the length of a shortest PEC s-t path, the problem of finding k vertex disjoint PEC s-t paths in G c with length at most L + 2 is NP-complete.
Proof: This problem is obviously in NP. The reduction is based on the Theorem 3 of [21] (restricted to non-colored graphs). Here, we deal with a different version of the 3-SAT problem. We prove that the (3,B2)-SAT problem can be reduced to the problem of finding k = m + 2n vertex disjoint PEC s-t paths with length at most L + 2 in G c , where G c has no (almost) PEC cycles through s or t.
Let I be an instance of (3, B2)-SAT with X ={x 1 , x 2 , ..., x n } and C={c 1 , c 2 ..., c m } denoting the variable and clause sets, respectively. We will construct a 2-edge-colored graph G c , as follows: • For each x i ∈ X , we build a combined gadget G xi (see Figures 10(a) and 10(b)). Vertices u ik (resp.ū ik ) of α G xi correspond to the k th occurrence of x i (resp.,x i ) in I for k = 1, 2.
• Graph G xi has three components: one α G xi and two β k G xi , 1 ≤ k ≤ 2.
• Any two β k G xi gadgets share vertex s. Gadgets β k G xi and α G xi share vertices s, u ik andū ik for k = 1, 2.
• In gadget α G xi there will be vertices: • In gadget β k G xi there will be vertices: • G c will have the following edges: • Finally, G c will contain additional vertices c j for j = 1, .., m and edges c j t, 1 ≤ j ≤ m, colored red, as well as U ik c j (resp.,Ū ik c j ), colored blue, if the k th occurrence of x i (resp.x i ) is in the j th clause. See Figure 11 for a graph G c associated with an instance of the (3, B2)-SAT problem.  Fig. 11: The graph G c associated with the instance (x1 ∨ x2 ∨ x3) ∧ (x1 ∨x2 ∨x3) ∧ (x1 ∨x2 ∨ x3) ∧ (x1 ∨ x2 ∨x3) of the (3,B2)-SAT problem Note that G c contains no (almost) PEC cycles through s and t and a minimum shortest PEC path from s to t has size L = 6. Further, observe that the degree of t is m + 2n, so every edge incident to t must participate in a path of size at most L + 2 (in the case instance I is true at some assignment). In addition, every s-t path that contains edges of a β k G xi gadget must also contain some vertex c j , otherwise its length would be greater than L + 2.
Initially, consider G c as above with 2n + m PEC s-t paths of size at most L + 2. Clearly, 2n paths must contain a PEC sub-path from w ik to Z ik in α G xi and every α G xi contributes with exactly 2 paths. Then all paths of α G xi contain only vertices u ik orū ik , 1 ≤ k ≤ 2. The other m paths contain a vertices c j , 1 ≤ j ≤ m, and a vertex u ik (orū ik ) that is not in any of the first 2n paths. If u ik (resp.,ū ik ) is on the same path as the vertex c j , the j th clause c j is satisfied by assigning x i to true (resp., x i to false). In this way, we can easily obtain a truth assignment for I satisfying all clauses. See the example of Figure 11.
Reciprocally, if x i (resp.,x i ) of c j is true at some truth assignment of I, there will be m PEC s-t paths of size L + 2 in G c passing by gadgets β k G xi , vertices u ik (resp.,ū ik ), U ik (resp.,Ū ik ) and c j (where k denotes the k th occurrence of x i (resp.,x i )). The remaining 2n PEC paths of size L + 2 will pass by gadgets α G xi , two paths per gadget, and use vertices u ik orū ik not used by the previous m PEC paths. 2 Corollary 15 Consider a c-edge-colored graph G c with c ≥ 3 and with no (almost) PEC cycles through s or t in V (G c ). If L > 0 denotes the length of a shortest PEC s-t path, the problem of finding k vertex disjoint PEC s-t paths (resp., trails) in G c with length at most L + 1 is NP-complete.
Proof: In this case, it suffices to change the combined gadget of Figures 10.(a) and 10.(b), respectively, by a new combined gadget α G xi , β k G xi for 1 ≤ k ≤ 2, as described in the Figure 12. In this case, we can easily see that 2n + m PEC s-t paths of size at most L + 1 in G c will be associated to satisfiable truth assignments for I and vice-versa. Now, we conclude this section with the following related problem: Problem 3 Consider a c-edge-colored graph G c with no (almost) PEC cycles through s and t and a fixed constant k > 0. If c = 2 (resp., c ≥ 3) and L > 0 denotes the length of a shortest PEC s-t path, does the problem of finding k vertex disjoint PEC s-t paths in G c with length at most L + 2 (resp., L + 1) NP-complete?

Monochromatic s-t paths in edge-colored graphs
Here, we deal with monochromatic s-t paths in c-edge-colored graphs. We show that finding k vertex disjoint monochromatic s-t paths with different colors is NP-complete even for k = 2. As an immediate consequence, the same problem over c-edge-colored digraphs is also NP-complete. Notice that finding one monochromatic s-t path in G c or 2 monochromatic edge disjoint s-t paths in G c (with the same color) can be easily solved in polynomial time (by using for each i ∈ I c , a polynomial algorithm for finding one s-t path in (V, E i (G c ))). However if the color of both paths are different, we have the following result: Theorem 16 Let G c be a c-edge-colored graph with s, t ∈ V (G c ) with c ≥ 2 and maximum vertex degree equal to 4. The problem of finding two vertex disjoint monochromatic s-t paths with different colors in G c is NP-complete.
Proof: This proof is similar to the one of Theorem 9, i.e., we reduce an instance I of the (3, B2)-SAT to the existence of two monochromatic s-t paths with different colors in G c for c = 2. Then we use the same notations and only describe how G c is built upon I.
The graph G c will be composed by clause components G cj (for j = 1, . . . , m) and variable components G xi (for i = 1, . . . , n). For each x i ∈ X we build an identical gadget as depicted on the left of Figure 7 (also colored 2 -bold). Similarly to Theorem 9, the right (resp., left) part of this gadget corresponds to the case where x i is set to true (resp., false). The gadget of a clause c j consists of an entrance q j , an exit w j and 3 vertices u 1 j , u 2 j , and u 3 j corresponding to the first, second and third variables of c j , respectively. We conclude the construction of G cj by adding 6 edges q j u k j for k = 1, 2, 3 and u k j w j for k = 1, 2, 3, all of them with color 1 (thin). Now, we add vertices s, t and link all gadgets G xi (resp., G(c j )) by adding the following edges as described in the Figure 13(a): • sa 1 , b 1 a 2 , b 2 a 3 , . . . , b n−1 a n and b n t, all of them with color 2 (bold); • sq 1 , w 1 q 2 , w 2 q 3 , . . . , w m−1 q m , w m t, all of them with color 1 (thin). For each pair x i , c j such that x i is the -th variable of c j and c j is the h-th clause of x i we proceed as follows. If x i appears negated in c j then add edges t h−1 ia u j , t h−1 i b u j and f h−1 ia f h−1 i b , all colored 2 (bold). If x i appears unnegated in c j then add f h−1 ia u j , f h−1 i b u j and t h−1 ia t h−1 i b , all colored 2 (bold). Clearly, the construction of G c can be done in polynomial time in the size of X and C. Further, observe that truth assignments for an instance I of the (3, B2)-SAT problem are associated to 2 vertex disjoint monochromatic s-t paths of colors 1 and 2, respectively. To construct the path with color 2 (bold), whenever a variable x i is true (resp., false), we take the sub-path between vertices a i and b i by using the right (resp., left) side of G xi (see Figure 13(b)). The unvisited vertices u j of c j can be used at random, to construct the path colored 1 (thin) between s and t. Reciprocally, if we have 2 vertex disjoint monochromatic s-t paths of colors 1 and 2 then we have a truth assignment for I. For instance, if a vertex u j of the component G cj is visited by some path colored 1 and variable x i (appearing in the -th position of c j ) is in the negated form (resp., unnegated form) then variable x i must be false (resp., true) and clause c j will be true in the assignment. Therefore, by using both monochromatic s-t paths with colors 1 and 2 we can uniquely determine a truth assignment for I, which completes the proof for c = 2.
The generalization of our proof for graphs containing c ≥ 3 colors is identical to Theorem 9 above and will be omitted here. 2 Note that if G c has maximum degree equal to 3, the determination of two vertex disjoint monochromatic s-t paths with different colors can be easily solved in polynomial time. To do that, it suffices to delete all edges xy of E(G c ), say colored i, with x, y ∈ V (G c ) \ {s, t} and such that xy is the unique edge with color i incident to x or y (since we cannot have monochromatic s-t paths through these edges). Finally, we delete all edges sx (resp., yt), say colored i, if sx (resp., yt) is the unique edge with color i incident to vertex x (resp., y).
We conclude with the following related problem: Problem 4 Consider a planar c-edge-colored graph G c and 2 vertices s, t ∈ V (G c ). Does the problem of finding 2 monochromatic s-t paths with different colors NP-complete?

Conclusions and final remarks
A number of problems defined over arbitrary c-edge-colored graphs and regarding one or more PEC s-t paths, trails and closed trails are hard to solve (see Subsection 1.1). As a consequence, we have restricted ourselves to problems defined over some particular classes of graphs such as graphs containing no PEC cycles or closed trails or just graphs with no (almost) PEC cycles or closed trails through s or t. These classes are interesting since they constitute, in a certain sense, the edge-colored counterpart of non-colored acyclic digraphs. Moreover, through the use of different graph techniques, we have extended some of the paths and trails problems defined over non-colored graphs and digraphs [21].
As a future direction a possible question is to study PEC paths and trails restricted to other classes of c-edgecolored graphs, such as regular, planar and serial parallel graphs. Another possibility is to investigate the Fundamental Lemma (Lemma 1) and its consequences through the adoption of different gadgets (such as the XP and BJGP-gadgets) as discussed in [4,14]. In this case, one should analyze their impact in the proofs and complexity of the proposed algorithms. Finally, an interesting subject is to consider the MAX-MIN k-PEC s-t path/trail problem whose objective is to determine k vertex/edge disjoint PEC s-t paths/trails so that the minimum path/trail length is maximized.