Last active
August 29, 2015 14:08
-
-
Save treadstone90/d5c5cb06b15999c6c7d6 to your computer and use it in GitHub Desktop.
Par Top Down_
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait PTopDownUpdater extends FrontierUpdater { | |
def update(frontier: Seq[Int], parents: Array[Int]): Seq[Int] = { | |
val next = ArrayBuffer[Int]() | |
frontier.par.foreach { node => | |
graph.getNeighbors(node).filter(parents(_) == -1).foreach { neighbor => | |
next += neighbor | |
parents(neighbor) = node | |
} | |
} | |
next | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment