






import math

class   A__ :







    """simple docstring"""

    def __init__(	self      , __snake_case=0   ):  # a graph with Node 0,1,...,N-1
         snake_case					=    n
         snake_case					=    [
             [math.inf for j in range(0      , __snake_case   )] for i in range(0      , __snake_case   )
         ]  # adjacency matrix for weight
         snake_case					=    [
             [math.inf for j in range(0      , __snake_case   )] for i in range(0      , __snake_case   )
         ]  # dp[i][j] stores minimum distance from i to j
    def 		a_      (	self      , __snake_case      , __snake_case      , __snake_case   ):
         snake_case					=    w
    def 		a_      (	self   ):
         for k in range(0      , self.n   ):
              for i in range(0      , self.n   ):
                   for j in range(0      , self.n   ):
                        snake_case					=    min(self.dp[i][j]      , self.dp[i][k] + self.dp[k][j]   )




    def 		a_      (	self      , __snake_case      , __snake_case   ):
         return self.dp[u][v]


if __name__ == "__main__":
 _SCREAMING_SNAKE_CASE      :			Any      				=   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 ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_SCREAMING_SNAKE_CASE      :			Dict      				=   {"configuration_van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"]}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _SCREAMING_SNAKE_CASE      :			Dict      				=   [
     "VAN_PRETRAINED_MODEL_ARCHIVE_LIST",
     "VanForImageClassification",
     "VanModel",
     "VanPreTrainedModel",
 ]

if TYPE_CHECKING:
 from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_van import (
      VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
      VanForImageClassification,
      VanModel,
      VanPreTrainedModel,
  )

else:
 import sys

 _SCREAMING_SNAKE_CASE      :			str      				=   _LazyModule(__name__, globals()["__file__"], _import_structure)




