Grasp of the Fallen
Grasp of the Fallen / Engines / Artificial Intelligence / Pathfinding /

Breadth First

Updated: 6/15/2004

BreadthFirstSearch
  node   n, n', s
	s.parent = null
	// s is a node for the start
	push s on Open
	while Open is not empty
		pop node n from Open	
		if n is a goal node 
			construct path 
			return success
		for each successor n' of n
			if n' has been visited already,
				continue
			n'.parent = n
			push n' on Open
	return failure  // if no path found



Email a friend, post this to your blog or
share with social bookmarking sites:



©2004-2009 GraspoftheFallen.com - All Rights Reserved. An RPG game under development by Bruce Kirkpatrick | Have comments? Email Me