Class ContractionHierarchyPrecomputation.ContractionTask

java.lang.Object
org.jgrapht.alg.shortestpath.ContractionHierarchyPrecomputation.ContractionTask
All Implemented Interfaces:
Runnable
Enclosing class:
ContractionHierarchyPrecomputation<V,E>

private class ContractionHierarchyPrecomputation.ContractionTask extends Object implements Runnable
Task that is used to perform computing of initial priorities, independent set and shortcuts, updating neighbours priorities and marking upward edges. To achieve good load balancing segment of vertices in vertices is divided into chunks using taskId.
  • Field Details

    • taskId

      int taskId
      Id of this task.
    • segmentStart

      int segmentStart
      Start if the working segment in vertices inclusively.
    • segmentsEnd

      int segmentsEnd
      End if the working segment in vertices exclusively.
    • consumer

      Performs needed action with vertices.
  • Constructor Details

    • ContractionTask

      public ContractionTask(int taskId)
      Constructs an instance of the task for the given taskId.
      Parameters:
      taskId - id of this task
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • workerSegmentStart

      private int workerSegmentStart(int segmentStart, int segmentEnd)
      Computes start of the working chunk for this task.
      Parameters:
      segmentStart - working segment start
      segmentEnd - working segment end
      Returns:
      working chunk start
    • workerSegmentEnd

      private int workerSegmentEnd(int segmentStart, int segmentEnd)
      Computes end of the working chunk for this task.
      Parameters:
      segmentStart - working segment start
      segmentEnd - working segment end
      Returns:
      working chunk end