Efficient bubble enumeration in directed graphs