Let $G = (V, E)$ be a directed graph with non-negative edge cost $c: E \rightarrow \mathbb{R}_{\geq 0}$ and let $s, t \in V$ be two distinguished nodes. Moreover edges are labelled with one of three colors, i.e. we have a function $f: E \rightarrow \{\text{red, green, blue}\}$. A red-green-blue walk is a sequence of edges $e_1, \dots, e_k \in E$ with $e_i = (v_{i-1}, v_i)$ for $i \in \{1, \dots, k\}$ so that the colors of the visited edges are red-green-blue-red-green-blue-red-... (more formally $f(e_{3j+1}) = \text{red}, f(e_{3j+2}) = \text{green}, f(e_{3j+3}) = \text{blue}$ for integers $j$). The cost of such a walk is $\sum_{i=1}^k c(e_i)$.
a) What is the minimum cost red-green-blue walk from $s$ to $t$ in the depicted instance? Here we label each edge $e$ with the cost $c(e)$ and the color $f(e)$.
b) Design a polynomial time algorithm for finding the minimum cost red-green-blue walk from $s$ to $t$ in a general graph $G = (V, E)$. Explain the running time bound that you get. Argue why the algorithm is correct.