private boolean SPFACheck() {
    Arrays.fill(isVertexVisited, false);
    Arrays.fill(vertexMinimumCost, INFINITY);

    Queue<Integer> queue = new LinkedList<>();
    vertexMinimumCost[S_VERTEX] = 0;
    isVertexVisited[S_VERTEX] = true;
    queue.offer(S_VERTEX);
    while (!queue.isEmpty()) {
      int currentVertex = queue.poll();
      isVertexVisited[currentVertex] = false;
      for (int currentEdge = vertexHeadEdge[currentVertex];
          currentEdge >= 0;
          currentEdge = costFlowEdges.get(currentEdge).nextEdge) {
        CostFlowEdge edge = costFlowEdges.get(currentEdge);
        if (edge.capacity > 0
            && vertexMinimumCost[currentVertex] + edge.cost < vertexMinimumCost[edge.destVertex]) {
          vertexMinimumCost[edge.destVertex] = vertexMinimumCost[currentVertex] + edge.cost;
          if (!isVertexVisited[edge.destVertex]) {
            isVertexVisited[edge.destVertex] = true;
            queue.offer(edge.destVertex);
          }
        }
      }
    }

    return vertexMinimumCost[T_VERTEX] < INFINITY;
  }
Check whether there is an augmented path in the flow network by SPFA algorithm.

<p>Notice: Never use Dijkstra algorithm to replace this since there might exist negative
circles.

@return True if there exist augmented paths, false otherwise.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/router/leader/CostFlowSelectionLeaderBalancer.java