I have some graph $G$ and a list of vertices $(v_1, ..., v_N) \in V$. Using graph structures in Mathematica version 9.0, what is the most efficient way to determine whether or not $(v_1, ..., v_N)$ represents a cycle, and then, if so, to output a permutation cycle starting from some desired $v_i$?
Let me provide a specific example:
Say I have a ring of eight vertices where:
$v_1 \to v_2$
$v_2 \to v_3$
$v_3 \to v_4$
$v_4 \to v_5$
$v_5 \to v_6$
$v_6 \to v_7$
$v_7 \to v_8$
$v_8 \to v_1$
And also:
$v_2 \to v_4$
$v_4 \to v_6$
$v_6 \to v_8$
$v_8 \to v_2$
Say the above list is scrambled (i.e. we randomly assign the vertex labels). Without scrambling things here, and specifying that I want a permutation to start from $v_2$, how would I output a permutation:
$(v_2,v_3,v_4,v_5,v_6,v_7,v_8,v_1)$
Scrambling, we could maybe map the labels: $(v_1, v_2, v_3, v_4, v_5, v_6, v_7, v_8)$ to something like: $(v_{1111111111}, v_{11011}, v_{111110011}, v_{100101}, v_{11}, v_{1010111}, v_{111}, v_{101010101})$ where the labels convey no ordering information.