class Graph
  def euler_path?
    return false if !connected?
    odd=0
    each_vertex do |x|
      if degree(x) % 2 == 1
        odd += 1
      end
    end
    odd <= 2
  end
end

mygraph = Graph.new([0,1],[1,2],[1,3],[2,3],[3,0])
flag1 =   mygraph.euler_circuit?   # false
flag2 =   mygraph.euler_path?      # true

