"""simple docstring"""





from __future__ import annotations


class 					UpperCAmelCase_     :


      def __init__(       self		,      a							)	-> None:
             lowercase__      :		Tuple          =     vertices
             lowercase__      :		Any          =     [[0] * vertices for _ in range(UpperCamelCase__							)]


      def 		_UpperCAmelCase	(       self		,      a							)	-> None:
             print('Vertex \t Distance from Source'							)
             for vertex in range(self.vertices							):
                    print(UpperCamelCase__		,      '\t\t'		,      distances_from_source[vertex]							)


      def 		_UpperCAmelCase	(       self		,      a		,      a							)	-> int:
             lowercase__      :		Tuple          =     1e7
             lowercase__      :		Any          =     0

             # Search not nearest vertex not in the shortest path tree
             for vertex in range(self.vertices							):
                    if distances_from_source[vertex] < minimum and visited[vertex] is False:
                           lowercase__      :		Dict          =     distances_from_source[vertex]
                           lowercase__      :		Any          =     vertex
             return min_index


      def 		_UpperCAmelCase	(       self		,      a							)	-> None:
             lowercase__      :		Tuple          =     [int(1e7							)] * self.vertices  # distances from the source
             lowercase__      :		str          =     0
             lowercase__      :		List[Any]          =     [False] * self.vertices

             for _ in range(self.vertices							):
                    lowercase__      :		Optional[int]          =     self.minimum_distance(UpperCamelCase__		,      UpperCamelCase__							)
                    lowercase__      :		Union[str, Any]          =     True

                    # Update dist value of the adjacent vertices
                    # of the picked vertex only if the current
                    # distance is greater than new distance and
                    # the vertex in not in the shortest path tree
                    for v in range(self.vertices							):
                           if (
                               self.graph[u][v] > 0
                               and visited[v] is False
                               and distances[v] > distances[u] + self.graph[u][v]
                           ):
                                  lowercase__      :		Union[str, Any]          =     distances[u] + self.graph[u][v]

             self.print_solution(UpperCamelCase__							)


if __name__ == "__main__":
       _UpperCamelCase       :						Any     =   Graph(9)
       _UpperCamelCase       :						Optional[int]     =   [
           [0, 4, 0, 0, 0, 0, 0, 8, 0],
           [4, 0, 8, 0, 0, 0, 0, 11, 0],
           [0, 8, 0, 7, 0, 4, 0, 0, 2],
           [0, 0, 7, 0, 9, 14, 0, 0, 0],
           [0, 0, 0, 9, 0, 10, 0, 0, 0],
           [0, 0, 4, 14, 10, 0, 2, 0, 0],
           [0, 0, 0, 0, 0, 2, 0, 1, 6],
           [8, 11, 0, 0, 0, 0, 1, 0, 7],
           [0, 0, 2, 0, 0, 0, 6, 7, 0],
       ]
       graph.dijkstra(0)


"""simple docstring"""





from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


_UpperCamelCase       :						int     =   {
    "configuration_retribert": ["RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "RetriBertConfig"],
    "tokenization_retribert": ["RetriBertTokenizer"],
}

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _UpperCamelCase       :						Tuple     =   ["RetriBertTokenizerFast"]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _UpperCamelCase       :						int     =   [
           "RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
           "RetriBertModel",
           "RetriBertPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_retribert import RETRIBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, RetriBertConfig
       from .tokenization_retribert import RetriBertTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_retribert_fast import RetriBertTokenizerFast

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_retribert import (
                  RETRIBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  RetriBertModel,
                  RetriBertPreTrainedModel,
              )

else:
       import sys

       _UpperCamelCase       :						Tuple     =   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

