Eulerian Walks in Temporal Graphs
Andrea Marino, Ana Silva
Abstract
Abstract An Eulerian walk (or Eulerian trail) is a walk (resp. trail) that visits every edge of a graph G at least (resp. exactly) once. This notion was first discussed by Leonhard Euler while solving the famous Seven Bridges of Königsberg problem in 1736. But what if Euler had to take a bus? In a temporal graph $$\varvec{(G,\lambda )}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>,</mml:mo> <mml:mi>λ</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> , with $$\varvec{\lambda : E(G)}\varvec{\rightarrow } \varvec{2}^{\varvec{[\tau ]}}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mrow> <mml:mi>λ</mml:mi> <mml:mo>:</mml:mo> <mml:mi>E</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>→</mml:mo> </mml:mrow> <mml:msup> <mml:mrow> <mml:mn>2</mml:mn> </mml:mrow> <mml:mrow> <mml:mo>[</mml:mo> <mml:mi>τ</mml:mi> <mml:mo>]</mml:mo> </mml:mrow> </mml:msup> </mml:mrow> </mml:math> , an edge $$\varvec{e}\varvec{\in } \varvec{E(G)}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mrow> <mml:mi>e</mml:mi> </mml:mrow> <mml:mrow> <mml:mo>∈</mml:mo> </mml:mrow> <mml:mrow> <mml:mi>E</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:mrow> </mml:math> is available only at the times specified by $$\varvec{\lambda (e)}\varvec{\subseteq } \varvec{[\tau ]}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mrow> <mml:mi>λ</mml:mi> <mml:mo>(</mml:mo> <mml:mi>e</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>⊆</mml:mo> </mml:mrow> <mml:mrow> <mml:mo>[</mml:mo> <mml:mi>τ</mml:mi> <mml:mo>]</mml:mo> </mml:mrow> </mml:mrow> </mml:math> , in the same way the connections of the public transportation network of a city or of sightseeing tours are available only at scheduled times. In this paper, we deal with temporal walks, local trails, and trails, respectively referring to edge traversal with no constraints, constrained to not repeating the same edge in a single timestamp, and constrained to never repeating the same edge throughout the entire traversal. We show that, if the edges are always available, then deciding whether $$\varvec{(G,\lambda )}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>,</mml:mo> <mml:mi>λ</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> has a temporal walk or trail is polynomial, while deciding whether it has a local trail is $$\varvec{\texttt {NP}}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>NP</mml:mi> </mml:mrow> </mml:math> -complete even if $$\varvec{\tau = 2}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>τ</mml:mi> <mml:mo>=</mml:mo> <mml:mn>2</mml:mn> </mml:mrow> </mml:math> . In contrast, in the general case, solving any of these problems is $$\varvec{\texttt {NP}}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>NP</mml:mi> </mml:mrow> </mml:math> -complete, even under very strict hypotheses. We finally give $$\varvec{\texttt {XP}}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>XP</mml:mi> </mml:mrow> </mml:math> algorithms parametrized by $$\varvec{\tau }$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>τ</mml:mi> </mml:mrow> </mml:math> for walks, and by $$\varvec{\tau +tw(G)}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>τ</mml:mi> <mml:mo>+</mml:mo> <mml:mi>t</mml:mi> <mml:mi>w</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> for trails and local trails, where $$\varvec{tw(G)}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>t</mml:mi> <mml:mi>w</mml:mi> <mml:mo>(</mml:mo> <mml:mi>G</mml:mi> <mml:mo>)</mml:mo> </mml:mrow> </mml:math> refers to the treewidth of $$\varvec{G}$$ <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> <mml:mrow> <mml:mi>G</mml:mi> </mml:mrow> </mml:math> .