         edgeLengths: edgeLengths,
         workList: [PriorityQueueElement<Distance, VertexId>](),
         workListIndex: Dictionary(),
-        effectivelyInfinite: effectivelyInfinite
+        effectivelyInfinite: Distance.effectiveInfinity
       ) { e, g in
         try callback(e, &g)
         if case .examineVertex(let vertex) = e, vertex == goalVertex {

      edgeLengths: edgeLengths,
      workList: [PriorityQueueElement<Distance, VertexId>](),
      workListIndex: Dictionary(),
      effectivelyInfinite: effectivelyInfinite,
      callback: callback)

    return distancesToVertex
  }

  /// Returns the distances from `startVertex` to every other vertex using Dijkstra's search
  /// algorithm using edge weights from `edgeLengths`; `callback` is called at key events during the
  /// search.
  public mutating func dijkstraSearch<
    Distance: FixedWidthInteger,
    EdgeLengths: PropertyMap
  >(
    startingAt startVertex: VertexId,
    edgeLengths: EdgeLengths,
    callback: DijkstraSearchCallback
  ) rethrows -> DictionaryPropertyMap<Self, VertexId, Distance>
  where
    EdgeLengths.Graph == Self,
    EdgeLengths.Key == EdgeId,
    EdgeLengths.Value == Distance
  {
    try dijkstraSearch(
      startingAt: startVertex,
      edgeLengths: edgeLengths,
      effectivelyInfinite: Distance.max,
      callback: callback)
  }

  /// Returns the distances from `startVertex` to every other vertex using Dijkstra's search
  /// algorithm using edge weights from `edgeLengths`; `callback` is called at key events during the
  /// search.
  public mutating func dijkstraSearch<
    Distance: FloatingPoint,
    EdgeLengths: PropertyMap
  >(
    startingAt startVertex: VertexId,
    edgeLengths: EdgeLengths,
    callback: DijkstraSearchCallback
  ) rethrows -> DictionaryPropertyMap<Self, VertexId, Distance>
  where
    EdgeLengths.Graph == Self,
    EdgeLengths.Key == EdgeId,
    EdgeLengths.Value == Distance
  {
    try dijkstraSearch(
      startingAt: startVertex,
      edgeLengths: edgeLengths,
      effectivelyInfinite: Distance.infinity,
      callback: callback)
  }

  /// Returns distances from `startVertex` in `self` using `edgeLengths` starting from `startVertex`
  /// and terminating once `endVertex` has been encountered; `callback` is invoked at key events
  /// during the search.
  public mutating func dijkstraSearch<
    Distance: Comparable & AdditiveArithmetic,
    EdgeLengths: PropertyMap
  >(
    startingAt startVertex: VertexId,
    endingAt goalVertex: VertexId,
    edgeLengths: EdgeLengths,
    effectivelyInfinite: Distance,
    callback: DijkstraSearchCallback
  ) rethrows -> DictionaryPropertyMap<Self, VertexId, Distance>
  where

    EdgeLengths.Value == Distance
  {
    var vertexVisitationState = makeDefaultColorMap(repeating: .white)
    var distancesToVertex = DictionaryPropertyMap(repeating: Distance.effectiveInfinity, forVerticesIn: self)

    try dijkstraSearch(
      startingAt: startVertex,
