Added HasEdge function to the Graph structure