Processing graphs and intervals in the sliding window model