Clone graph by using a hashmap