Conversion from Undirected Graph to Directed graph