Fix weight comparison in edge BFS