code: public void findSSSP() {
          Record<N, E> initRec = new Record<>(init, 0.0f);
          if (records.put(init, initRec) != null) {
              throw new IllegalStateException("Search has already been performed!");
          }
  
          SmartDynamicPriorityQueue<Record<N, E>> pq = BinaryHeap.create(graph.size());
          initRec.ref = pq.referencedAdd(initRec);
  
          while (!pq.isEmpty()) {
              // Remove node with minimum distance
              Record<N, E> rec = pq.extractMin();
              float dist = rec.dist;
  
              N node = rec.node;
  
              // edge scanning
              for (E edge : graph.getOutgoingEdges(node)) {
                  float w = edgeWeights.getEdgeWeight(edge);
                  float newDist = dist + w;
  
                  N tgt = graph.getTarget(edge);
                  Record<N, E> tgtRec = records.get(tgt);
                  if (tgtRec == null) {
                      // node has not been visited before, add a record
                      // and add it to the queue
                      tgtRec = new Record<>(tgt, newDist, edge, rec);
                      tgtRec.ref = pq.referencedAdd(tgtRec);
                      records.put(tgt, tgtRec);
                  } else if (newDist < tgtRec.dist) {
                      // using currently considered edge decreases current distance
                      tgtRec.dist = newDist;
                      tgtRec.reach = edge;
                      tgtRec.depth = rec.depth + 1;
                      tgtRec.parent = rec;
                      // update it's position in the queue
                      pq.keyChanged(tgtRec.ref);
                  }
              }
          }
      }
docs: Start the search. This method may only be invoked once.