Closed ywu496 closed 3 years ago
Yes, in this case, you will be visiting node 4 twice because there is a shared edge between two cycles.
@ywu496 you don't necessarily the node 4 twice, instead you make two separate recursive calls from the node 4 while making 1 visit.
For the graph below, is it considered two cycles(1<-- 2 <-- 3 <-- 4 <--1 and 1 <-- 5 <-- 4 <-- 1) If it is considered two circles, is it possible to visit all nested circles without traversing any node more than once(I had to traverse the node 4 twice using incoming edges for traversing)?