implement DFS and WFS by using networkx