






import math




class 			snake_case__   :

       '''simple docstring'''



       def __init__(							self			,						a__=0    ) ->      Tuple:  # a graph with Node 0,1,...,N-1






            '''simple docstring'''





            __snake_case			:Optional[Any]          =						n
            __snake_case			:Dict          =						[
                [math.inf for j in range(0			,						a__    )] for i in range(0			,						a__    )
            ]  # adjacency matrix for weight
            __snake_case			:Any          =						[
                [math.inf for j in range(0			,						a__    )] for i in range(0			,						a__    )
            ]  # dp[i][j] stores minimum distance from i to j



       def 					__lowercase						(							self			,						a__			,						a__			,						a__    ) ->      Union[str, Any]:






            '''simple docstring'''





            __snake_case			:Any          =						w



       def 					__lowercase						(							self    ) ->      List[Any]:






            '''simple docstring'''





            for k in range(0			,						self.n    ):
                 for i in range(0			,						self.n    ):
                      for j in range(0			,						self.n    ):
                           __snake_case			:Optional[int]          =						min(self.dp[i][j]			,						self.dp[i][k] + self.dp[k][j]    )



       def 					__lowercase						(							self			,						a__			,						a__    ) ->      Union[str, Any]:






            '''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)










from typing import TYPE_CHECKING

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


lowerCamelCase__							=     {"""configuration_dpt""": ["""DPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DPTConfig"""]}

try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     ["""DPTFeatureExtractor"""]
     lowerCamelCase__							=     ["""DPTImageProcessor"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     [
         """DPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """DPTForDepthEstimation""",
         """DPTForSemanticSegmentation""",
         """DPTModel""",
         """DPTPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .feature_extraction_dpt import DPTFeatureExtractor
          from .image_processing_dpt import DPTImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_dpt import (
              DPT_PRETRAINED_MODEL_ARCHIVE_LIST,
              DPTForDepthEstimation,
              DPTForSemanticSegmentation,
              DPTModel,
              DPTPreTrainedModel,
          )


else:
     import sys

     lowerCamelCase__							=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


