Just don't like the Ruby syntax, not very friendly to the eye Smiley

def bfs(e)
    q = []
    e.mark
    yield e
    q.push e
    while not q.empty?
        u = q.shift
        u.edge_iterator do |v|
        if not v.marked?
            v.mark
            yield v
            q.push v
        end   
    end
end
bfs(e) {|v| puts v}