lems and slowed down the overall MABS process
considerably. Therefore we engineered the imple-
mentation by using a memory-efficient joint repre-
sentation of graph and radix heap nodes. A joint
node representation includes a state label (unlabeled,
labeled or scanned), a linked list of edges, the ele-
ment for storing the distances, the radix bucket a node
is stored in as well as two pointers (pred, succ) for
linking the elements in the radix heap. An edge is
a pair of a successor node ID and according weight
(cost/distance). We observed that the joint node rep-
resentation is more crucial to the performance of the
search than the proper choice of the data structure.
One reason is to avoid memory allocation, another is
that efforts for maintaining handles to the nodes can
be avoided.
We also employed a key-based priority queue, ex-
ploiting the maximum weight C of all edges. A
radix heap (Ahuja et al., 1990) maintains an array
of dlg(C + 1)e + 1 buckets of sizes 1, 1, 2, 4, 8, 16,
etc. Elements in the buckets are doubly-linked. More
precisely, we maintain buckets b[0..B] and bounds
u[0..B + 1] with B = dlog(C + 1)e + 1 and u[B + 1] =
∞. The invariants of the algorithms are: 1) all keys in
b[i] are in [u[i], u[i + 1]], 2) u[1] = u[0]+ 1, and 3) for
all i ∈ {1, . . . , B − 1} we have 0 ≤ u[i + 1] − u[i] ≤
2
i−1
.
The main difference to one-level buckets (Dial,
1969) is to use buckets of exponentially increasing
sizes. Therefore, only O(lgC) buckets are needed. If
edge weights are integers or floating point numbers
O(lgC) can be interpreted as a constant independent
from the number of nodes n and edges m.
For shortest path search, in the presence of a lower
bound heuristic function h, A* (Hart et al., 1968) can
be applied. Without reopening, A* resorts to a variant
of Dijkstra’s algorithm with f (s) = h(s) for start node
s and new weight w
0
(u, v) = w(u, v) − h(u) + h(v) for
all edges (u, v).
Theorem 1 (Time Optimality Shortest Paths Explo-
ration). Given that the edge weights are computer
words (64-bit integer or floating-point numbers) and
provided a matching number representation for stor-
ing the accumulated distances at each node, our im-
plementation of the Single-Source Shortest Paths Al-
gorithm of Dijkstra (or A* with consistent heuristic)
has optimal linear time complexity.
Proof. The radix heap assumes that all edge costs in
the graph are integers bounded above by C. The re-
sult is that Dijkstra’s algorithm can be implemented
with a time complexity of O(m + n lgC), where n is
the number of nodes and m is the number of edges.
Given that the logarithm of a 64-bit integer is bounded
by a constant lgC = 64, the running time on a mod-
ern computer is linear O(m + n). If edge weights are
doubles, lgC = lg(1.79769 · 10
308
) = O(1)
Furthermore, the radix heap is significantly sim-
pler to implement compared to the Fibonacci heap
and similar data structures. The radix heap achieves
this time complexity by taking advantage of the prop-
erty that shortest path distances fall into a finite range
during the computation shortest paths by Dijkstra’s
algorithm.
The practical savings were considerable. Erst-
while unanalyzable systems turned out to be quickly
analyzable, and even a full Dijkstra exploration was
much faster than the original implementation of A*.
In smaller graphs (200,000 nodes, 2,000,000 edges),
generating the graph turned out to be more com-
plex (4,443 ms) than actually searching it (1,668 ms).
But even larger graphs (1,000,000 nodes, 10,000,000
edges) could be generated (30,574 ms) and searched
(34,631 ms) in adequate time.
Recall, that shortest path queries are frequently
posed by different agents such as persons and vehi-
cles; buses in a dynamic world may have to recom-
pute shortest paths from every bus station to the next
(based on dynamic changes to the road network due
to traffic jams). Frequent shortest path queries are
also needed for preprocessing the graph in order to
solve so-called vehicle routing problems. The deci-
sion making then relies on efficient solutions to the
Traveling Salesman Problem (TSP), a touchstone for
many general approaches in combinatorial optimiza-
tion: Genetic algorithms, simulated annealing, tabu
search, ant system, just to name a few. The prob-
lem is strong NP-hard and difficult to approximate
unless the triangular inequality holds ((Christofides,
1976); (Arora, 1998)). In an application of a forward-
ing agency, the TSPs are generated via shortest paths
reductions of route networks. Each order to be served
corresponds to one city in the TSP.
On the first glance, in case a better shortest path
search performance is needed, A* is an obvious alter-
native to Dijkstra’s algorithm. For a consistent heuris-
tic evaluation function, it is optimal efficient and (up
to tie-breaking) A* will expand the minimum number
of nodes. For a heuristic that is strictly more informed
than the trivial 0-heuristic applied in Dijkstra’s algo-
rithms, it is guaranteed to expand less nodes. How-
ever, at this level of speed per node, the number of
expanded nodes is not the only key performance mea-
sure. We experienced that the time needed for com-
puting the lower bound heuristic during shortest path
search can negatively influence the overall perfor-
mance. The computation of shortest paths of several
hundred TSP matrices based on the distance calcu-
lations according to the Haversine formula resulted in
EnhancedShortestPathComputationforMultiagent-basedIntermodalTransportPlanninginDynamicEnvironments
327