bfs iterator support for weighted edges