Paths and Trails in Edge Colored Graphs Latin-American on Theoretical Informatics Symposium LATIN 2008 Abouelaoualim, K. Das, L. Faria, Y. Manoussakis, C. Martinhon, R. Saad Buzios-RJ - Brazil
Topics 1. Motivation and basic definitions 2. Properly edge-colored s-t path/trail and extensions 3. NP-completeness 4. Approximation Algorithms for associated maximization problems 5. Some instances solved in polynomial time 6. Conclusions and open problems
1. Computational Biology when the colors are used to denote a sequence of chromosomes; 2. Cryptography when a color specify a type of transmission; 3. Social Sciences where a color represents a relation between 2 individuals; etc Some Applications using edge colored graphs
Basic Definitions Prop. edge-colored path between « s » and « t » t source destination 2 3 s 4 (without node repetitions!!) 1
Basic Definitions Prop. edge-colored trail between « s » and « t » t source destination 2 3 s 4 (without edge repetitions!!) 1
Basic Definitions Properly edge-colored cycle passing by « x » 5 start 2 3 x 4 (without node repetitions!!) 1
Basic Definitions Prop. edge-colored closed trail passing by « x » 5 start 2 3 x 4 (without edge repetitions!!) 1
Basic Definitions Almost prop. edge-colored cycle passing by « x » (without node repetitions!!) 5 start 2 3 x 4 1
Basic Definitions Almost properly edge-colored closed trail passing by « x » (without edge repetitions!!) 5 start 2 3 x 4 1
How to find a properly edge-colored s-t path? source destination 23 s edge-colored graph G t
source destination 23 s edge-colored graph G Graph G’ bluered 3’’ s 2’’ 3’ 4’’ 4’ 1’ t 1’’ 2’ t We find a perfect matching (if possible) !! How to find a properly edge-colored s-t path?
source destination 23 s edge-colored graph G Graph G’ bluered 3’’ s 2’’ 3’ 4’’ 4’ 1’ t 1’’ 2’ t How to find a properly edge-colored s-t path? t a pec s-t path in G G’ contains a perfect matching Therem: Jensen&Gutin[1998]
t start u s q v p dest. color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qbqb q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 st (a) 3-edge colored graph (b) non-colored graph Properly s-t path in edge-colored graphs (Szeider’s Algorithm – [2003])
color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qcqc q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 st (a) 3-edge colored graph (b) non-colored graph Properly s-t path in edge-colored graphs (Szeider’s Algorithm – [2003]) t start u s q v p dest.
color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qcqc q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 st (a) 3-edge colored graph (b) non-colored graph Properly s-t path in edge-colored graphs (Szeider’s Algorithm – [2003]) t start u s q v p dest.
t start u s q v p dest. color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qbqb q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 st (a) 3-edge colored graph (b) non-colored graph Properly s-t path in edge-colored graphs (Szeider’s Algorithm – [2003])
Our results: Lemma: Consider a c-edge-colored graph G, and an arbitrary pec trail T between « s » and « t ». Further, suppose that at least one node in T is visited 3 times or more. Then, there exists another pec trail T’ where no nodes are visited more than 2 times s x t y Cycles or closed trails passing by x Almost cycles or closed trails passing by y ab How to find a prop. edge-colored s-t trail?
Equivalence between paths and trails st Graph G pec trail P y x X’ X’’ y’ y’’ y x X’ X’’ y’ y’’
Equivalence between paths and trails st s’ 1’’ 1’ t’ 2’’ 2’ 1’ Graph G Graph H pec trail Ppec path P’ Theorem: We have a pec s-t trail in G we have a pec s’-t’ path in H
Shortest properly edge-colored s-t Path destination 2-edge-colored graph G Graph G’ bluered s 2’’ 3’ 4’’ 4’ 1’ 1’’ 2’ source 23 s 4 1t t 3’’ Find a minimum perferct matching (if it exists)!
Shortest properly edge-colored s-t trail Algorithm: Shortest prop. edge-colored s-t Trail 1.Construct H=(V’,E’) associated to G 2.Find a short. pec path P (if possible) between « s’ » and « t’ » in H 3.Return trail T in G, and size(T)=size(P)/3 Input: A 2-edge colored graph G=(V,E), and 2 nodes s,t in V Output: A shortest prop. edge-colored trail T between « s » and « t ». Construction of H y x X’ X’’ y’ y’’ y x X’ X’’ y’ y’’ H xy
Existence of prop. edge-colored closed trails Theorem: Let G a c-edge colored graph, such that every vertex of G is incident with at least two edges of different colors. Then either G has a bridge, or G has a prop. edge-colored closed trail Algorithm: Delete all bridges and all nodes adjacent to edges of the same color pec closed trail 1,2,3,1,5,7,6,4,1
Longest prop. edge-colored path in graphs with no pec cycles destination 2-edge-colored graph G source 23 s 4 1t
destination 2-edge-colored graph G source 23 s 4 1t Graph G’ bluered s 2’’ 3’ 4’’ 4’ 1’ 1’’ 2’ t 3’’ Find a maximum perfect matching (if it exists)! Longest prop. edge-colored path in graphs with no pec cycles
Longest pec trail in graphs with no pec closed trails s x t y Cycles or closed trails passing by x (not possible !!) Almost cycles or closed trails passing by y We can visit node « y » several times !! FACT: Node « y » can be visited at most times!
s x t y Cycles or closed trails passing by x (not possible !!) Almost cycles or closed trails passing by y We can visit node « y » several times !! FACT: Node « y » can be visited at most times! Longest pec trail in graphs with no pec closed trails
y x X1X1 X2X2 XdXd Y1Y1 Y2Y2 YdYd y x X1X1 X2X2 XdXd Y1Y1 Y2Y2 YdYd Construction of H Theorem: We have a pec s-t trail in G we have a pec s’-t’ path in H
s k-Properly Vertex Disjoint Path problem Input: Given a 2-edge colored graph G, a const. k and nodes s,t V. Question: Does G contains k pec vertex disjoint paths between « s » and « t »? t k-PVDP Without node repetitions !!
s k-Properly Edge Disjoint Trails problem Question: Does G contains k pec edge disjoint trails between « s » and « t »? t k-PEDT Without edge repetitions !! Input: Given a 2-edge colored graph G, a const. k and nodes s,t V.
s k-Properly Edge Disjoint Trails problem Question: Does G contains k pec edge disjoint trails between « s » and « t »? t k-PEDT Without edge repetitions !! Input: Given a 2-edge-colored graph G, a const. k and nodes s,t V.
s k-Properly Edge Disjoint Trails problem Question: Does G contains k pec edge disjoint trails between « s » and « t »? t k-PEDT Without edge repetitions !! Input: Given a 2-edge-colored graph G, a const. k and nodes s,t V.
s k-Properly Edge Disjoint Trails problem Question: Does G contains k pec edge disjoint trails between « s » and « t »? t k-PEDT Without edge repetitions !! Input: Given a 2-edge colored graph G, a const. k and nodes s,t V.
s k-Properly Edge Disjoint Trails problem Input: Given a 2-edge colored graph G, a const. k and nodes s,t V. Question: Does G contains k pec edge disjoint trails between « s » and « t »? t k-PEDT Without edge repetitions !!
NP-Completeness uv Fortune, Hopcroft, Wylie [1980] Directed cycle problem - DC Input: A digraph D=(V,A) and a pair of nodes u,v V Output: Does exist a vertex disjoint circuit passing by « u » and « v » ? Output: Does exist an arc disjoint Circuit passing by « u » and « v » ? Theorem: DC problem is NP-Complete uv Directed Closed-Trail problem - DCT
NP-Completeness Theorem: Both 2-PVDP and 2-PEDT problems are NP Complete on arbitrary 2-edge-colored graphs. Reduction: DC problem 2-PVDP Reduction: DCT problem 2-PEDT Lemma: DCT problem is NP-Complete. Proof : (sketch) Both 2-PVDP and 2-PEDT are in NP
Both 2-PVDP and 2-PEDT in c-edge colored graphs Theorem: Both 2-PVDP and 2-PEDT problems are NP-Complete even for graphs with colors s t 2-edge-colored graph G Complete graph K n with colors x Additional color
The k-PVDP is NP-Complete in graphs with no pec cycles SAT k-AVDP 2-edge-colored graph G=(V,E) (with no pec cycles) and 2 nodes s,t є V True assignments for B k-Vertex Disjoint s-t Paths in G
The k-PVDP is NP-Complete in graphs with no pec cycles Example: Variable x 1 t2t2 s2s2 s1s1 t3t3 s3s3 t1t t2t2 s2s2 t3t3 s1s1 t1t1 s3s3 Variable x t3t3 s1s1 t1t1 s2s2 s3s3 t2t2 Variable x t2t2 s2s2 s1s1 t3t3 s3s3 t1t
The k-PVDP is NP-Complete in graphs with no pec cycles Example: Variable x 1 t2t2 s2s2 s1s1 t3t3 s3s3 t1t t2t2 s2s2 t3t3 s1s1 t1t1 s3s3 Variable x t3t3 s1s1 t1t1 s2s2 s3s3 t2t2 Variable x t2t2 s2s2 s1s1 t3t3 s3s3 t1t s t
The k-PVDP is NP-Complete in graphs with no pec cycles Example: Variable x 1 t2t2 s2s2 s1s1 t3t3 s3s3 t1t t2t2 s2s2 t3t3 s1s1 t1t1 s3s3 Variable x t3t3 s1s1 t1t1 s2s2 s3s3 t2t2 Variable x t2t2 s2s2 s1s1 t3t3 s3s3 t1t s t
The k-PVDP is NP-Complete in graphs with no pec cycles Example: Variable x 1 t2t2 s2s2 s1s1 t3t3 s3s3 t1t t2t2 s2s2 t3t3 s1s1 t1t1 s3s3 Variable x t3t3 s1s1 t1t1 s2s2 s3s3 t2t2 Variable x t2t2 s2s2 s1s1 t3t3 s3s3 t1t s t
t2t2 s2s2 s1s1 t1t1 t2t2 s2s2 s1s1 t1t1 NP-Completeness in graphs with no pec cycles Grid G(x) t s s t k-PEDT is also NP-complete !!
Both 2-PVDP and 2-PEDT in c-edge with no properly edge-colored cycles (closed trails) Theorem: The 2-PVDP (2-PEDT) problem is NP-Complete for graphs with no pec cycles (closed trail) and c=Ω(n) colors s t 2-edge-colored graph G b Additional color a c d e K n with n-1 colors
Both 2-PVDP and 2-PEDT in c-edge with no properly edge-colored cycles (closed trails) Theorem: The 2-PVDP (2-PEDT) problem is NP-Complete for graphs with no pec cycles (closed trail) and c=Ω(n) colors s t 2-edge-colored graph G b Additional color a c d e K n with n-1 colors
Both 2-PVDP and 2-PEDT in c-edge with no properly edge-colored cycles (closed trails) Theorem: The 2-PVDP (2-PEDT) problem is NP-Complete for graphs with no pec cycles (closed trail) and c=Ω(n) colors s t 2-edge-colored graph G b Additional color a c d e K n with n-1 colors
Both 2-PVDP and 2-PEDT in c-edge with no properly edge-colored cycles (closed trails) Theorem: The 2-PVDP (2-PEDT) problem is NP-Complete for graphs with no pec cycles (closed trail) and c=Ω(n) colors s t 2-edge-colored graph G b Additional color a c d e K n with n-1 colors
Both 2-PVDP and 2-PEDT in c-edge with no properly edge-colored cycles (closed trails) Theorem: The 2-PVDP (2-PEDT) problem is NP-Complete for graphs with no pec cycles (closed trail) and c=Ω(n) colors s t 2-edge-colored graph G b Additional color a c d e K n with n-1 colors
Approximation Algorithm for the MPEDT Greedy-ED Procedure 1. S Ø 2. Repeat Find an pec shortest trail T between « s » and « t »; S S E(T); E E - E(T); Until (no pec s-t trails are found) Theorem: The Greedy-ED has performance ratio equal to for the MPEDT problem
Approximation Algorithm for the MPVDP Greedy-VD Procedure 1. S Ø 2. Repeat Find a pec shortest path P between « s » and « t »; S S E(P); V V - V(P); Until (no pec s-t paths are found) Theorem: The Greedy-VD has performance ratio equal to for the MPVDP problem
st Greedy solution Z H = 1 Approximation ratio for MPEDT
st Greedy solution Z H = 1 Approximation ratio for MPEDT Optimum solution Opt = k/2
st Approximation ratio for MPEDT Approximation ratio =
t start u s q v p dest. color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qbqb q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 s1s1 (a) 3-edge colored graph (b) non-colored graph s2s2 t1t1 t2t2 Some Polynomial Cases: we have no (almost) pec cycles passing by « s » or « t ».
t start u s q v p dest. color 1 color 2 color 3 papa v’v’’u’u’’ vava vbvb v1v1 v2v2 q’q’’ qaqa qbqb q2q2 q3q3 p’p’’ pbpb pcpc p1p1 p2p2 p3p3 uaua ubub ucuc u1u1 u2u2 u3u3 s1s1 (a) 3-edge colored graph (b) non-colored graph s2s2 t1t1 t2t2 Some Polynomial Cases: we have no (almost) pec cycles passing by « s » or « t ».
Open Problems and Future Diretions Input: Given a c-edge-colored complete graph, and vertices s,t of Open question: Maximize the number of edge-disjoint pec s-t paths in is in P? Future work: What about the performance ratio of both MPVDP and MPEDT problems in graphs with no pec cycles (closed trails)? Input: Given a 2-edge-colored graph with no pec cycles, vertices s,t V(G) and a fixed k 2. Question: Does G contains k pec vertex disjoint paths between « s » and « t »?
Thanks for your attention!!