Trading off space for passes in graph streaming problems