how to find a route in a graph

146 Views Asked by At

"Dr C is a tourist by nature, and wishes to visit each place once and return to her starting point. Dr D is an explorer, and wishes to traverse every road just once, in either direction; he is prepared to start and finish in different places. Can suitable routes for Drs C and D be found?

The adjaceny list is $$ 0: 1 3 5 7$$

$$1: 0 2 6 8$$ $$2: 1 3 7$$ $$3: 0 2 4 8$$ $$4: 3 5 $$ $$5: 0 4 6 8$$ $$6: 1 5 7$$ $$7: 0 2 6 8$$ $$8: 1 3 5 7$$

Should i do trial and error method or should i try to sketch the graph (will be easier to find the route but if you can do it by checking the adjacency list then i would want to learn it) ?