# Finding a simple cycle that goes through two vertices

Given a directed graph $G$ and two vertices $u$ and $w$, how can we find a simple cycle that goes through $u$ and $w$?

One can try putting together paths from $u$ to $w$ and $w$ to $u$ — but these might have edges or nodes in common, even if they are chosen to be shortest paths.

• What are your thoughts? We're not here to solve your exercises for you. Rather, we're here to help you solve them on your own. Therefore we need to know what exactly you tried and where you got stuck. – Yuval Filmus Mar 14 '16 at 19:55
• Well, one can try putting together paths from u to w and w to u -- but these might have edges or nodes in common, even if they are chosen to be shortest paths... – Michael R Mar 14 '16 at 20:47
• Not reading any particular textbook or learning any concepts DW -- just thought of the question on my own and didn't know how to answer. – Michael R Mar 14 '16 at 21:51