If your graph is $G=(V,E)$ and $B\subseteq E$ are the blue edges, then you can run an appropriate cycle enumeration algorithm on $G-(B\setminus{ b_i })$ for each $b_i\in B$. This ensures that at most one blue edge occurs in the graph. Perhaps the selected algorithm can be adapted to start with the edge $b_i$. b_i$, ensuring that only graphs with exactly one blue edge are enumerated. Google reveals many such algorithms. I'm not sure which one suits your needs. No efficient algorithms exist, as along the way you would find Hamiltonian paths, which is an NP-complete problem. 1 If your graph is$G=(V,E)$and$B\subseteq E$are the blue edges, then you can run an appropriate cycle enumeration algorithm on$G-(B\setminus{ b_i })$for each$b_i\in B$. This ensures that at most one blue edge occurs in the graph. Perhaps the selected algorithm can be adapted to start with the edge$b_i\$.