def edges
      result = []
      c = edge_class
      each_edge { |u,v| result << c.new(u,v) }
      result
    end
def edges
      result = []
      c = edge_class
      each_edge { |u,v| result << c.new(u,v) }
      result
    end
Return the array of edges (DirectedEdge or UnDirectedEdge) of the graph
 using each_edge, depending whether the graph is directed or not.