concept road in category algorithms

appears as: road, roads, roads
Algorithms and Data Structures in Action

This is an excerpt from Manning's book Algorithms and Data Structures in Action.

Figure 8.2 Indexing 2-D space with regular, equal-sized tiles. While finding the tile where a point lies is easy, irregular distribution of points in dataset causes, on average, many cells to be empty, while a few of them have high density.

Initially, however, we will focus on a specific use case: considering the starting point as “given” (externally chosen, without the algorithm knowing much about it) and traversing the graph from it. Based on these assumptions, we will discuss the two most common traversal strategies used on graphs.

Listing 14.13 The A* algorithm
function aStar(graph, start, isGoal, distance, heuristic)            #1
  queue ← new PriorityQueue()                        #2
  queue.insert(start, 0)                            #3
  distances[v] ← inf (" v ϵ graph | v <> start)                #4
  fScore[v] ← inf (" v ϵ graph | v <> start)                #5
  parents[v] ← null (" v ϵ graph)                        #6
  distances [start] ← 0                            #7
  fScore[start] ← heuristic(start)
  while not queue.empty() do                        #8
v ← queue.top()                            #9
if isGoal(v) then                            #10
  return v, parents
     else
  for e in graph.adjacencyList[v] do                    #11
    u ← e.dest
    if distances[u] > distances[v] + distance(e) then        #12
      distances[u] ← distance(e) + distances[v]            #13
      fScore[u] ← distances[u] + heuristic(u)            #14
      parents[u] ← v
      queue.update(u, fScore[u])
  return null, parents                            #15