Made algorithm structures better for parallelization, added edge weights to undirected graphs.