




'''simple docstring'''



import math







class 		lowercase_   :


   """simple docstring"""

   def __init__(   self :     Optional[Any]  ,				__lowerCamelCase :     str=0   ):  # a graph with Node 0,1,...,N-1

      """simple docstring"""
      _SCREAMING_SNAKE_CASE	=				n
      _SCREAMING_SNAKE_CASE	=				[
          [math.inf for j in range(0  ,				__lowerCamelCase   )] for i in range(0  ,				__lowerCamelCase   )
      ]  # adjacency matrix for weight
      _SCREAMING_SNAKE_CASE	=				[
          [math.inf for j in range(0  ,				__lowerCamelCase   )] for i in range(0  ,				__lowerCamelCase   )
      ]  # dp[i][j] stores minimum distance from i to j



   def 							lowerCAmelCase_      (   self :     Dict  ,				__lowerCamelCase :     int  ,				__lowerCamelCase :     Optional[Any]  ,				__lowerCamelCase :     Tuple   ):

      """simple docstring"""
      _SCREAMING_SNAKE_CASE	=				w



   def 							lowerCAmelCase_      (   self :     str   ):

      """simple docstring"""
      for k in range(0  ,				self.n   ):
         for i in range(0  ,				self.n   ):
            for j in range(0  ,				self.n   ):
               _SCREAMING_SNAKE_CASE	=				min(self.dp[i][j]  ,				self.dp[i][k] + self.dp[k][j]   )



   def 							lowerCAmelCase_      (   self :     str  ,				__lowerCamelCase :     Union[str, Any]  ,				__lowerCamelCase :     List[str]   ):

      """simple docstring"""
      return self.dp[u][v]


if __name__ == "__main__":
 lowerCamelCase_			=						Graph(5)
 graph.add_edge(0, 2, 9)
 graph.add_edge(0, 4, 10)
 graph.add_edge(1, 3, 5)
 graph.add_edge(2, 3, 7)
 graph.add_edge(3, 0, 10)
 graph.add_edge(3, 1, 2)
 graph.add_edge(3, 2, 1)
 graph.add_edge(3, 4, 6)
 graph.add_edge(4, 1, 3)
 graph.add_edge(4, 2, 4)
 graph.add_edge(4, 3, 9)
 graph.floyd_warshall()
 graph.show_min(1, 4)
 graph.show_min(0, 3)







'''simple docstring'''



from typing import TYPE_CHECKING

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


lowerCamelCase_			=						{
    'configuration_bridgetower': [
        'BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BridgeTowerConfig',
        'BridgeTowerTextConfig',
        'BridgeTowerVisionConfig',
    ],
    'processing_bridgetower': ['BridgeTowerProcessor'],
}

try:
 if not is_vision_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase_			=						['BridgeTowerImageProcessor']

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowerCamelCase_			=						[
     'BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST',
     'BridgeTowerForContrastiveLearning',
     'BridgeTowerForImageAndTextRetrieval',
     'BridgeTowerForMaskedLM',
     'BridgeTowerModel',
     'BridgeTowerPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_bridgetower import (
     BRIDGETOWER_PRETRAINED_CONFIG_ARCHIVE_MAP,
     BridgeTowerConfig,
     BridgeTowerTextConfig,
     BridgeTowerVisionConfig,
 )
 from .processing_bridgetower import BridgeTowerProcessor

 try:
  if not is_vision_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .image_processing_bridgetower import BridgeTowerImageProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_bridgetower import (
      BRIDGETOWER_PRETRAINED_MODEL_ARCHIVE_LIST,
      BridgeTowerForContrastiveLearning,
      BridgeTowerForImageAndTextRetrieval,
      BridgeTowerForMaskedLM,
      BridgeTowerModel,
      BridgeTowerPreTrainedModel,
  )


else:
 import sys

 lowerCamelCase_			=						_LazyModule(__name__, globals()['__file__'], _import_structure)

