Printing cycle path

How can i print the path of the cycle.
The link for my code is given below:

Hey @shubham_garud5 it can be done using graph coloring . are you aware of graph coloring problem ?