



'''simple docstring'''




import math







class       _lowerCAmelCase				:


	def __init__(self			, lowercase=0				):  # a graph with Node 0,1,...,N-1
				A_      :		Any      =	n
				A_      :		Union[str, Any]      =	[
				    [math.inf for j in range(0			, a_				)] for i in range(0			, a_				)
				]  # adjacency matrix for weight
				A_      :		str      =	[
				    [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        _a      (self			, lowercase			, lowercase			, lowercase				):
				A_      :		int      =	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				):
													A_      :		Tuple      =	min(self.dp[i][j]			, self.dp[i][k] + self.dp[k][j]				)


	def        _a      (self			, lowercase			, lowercase				):
				return self.dp[u][v]


if __name__ == "__main__":
						lowerCamelCase				:Tuple							       =   Graph(5)
						graph.add_edge(0, 2, 9)
						graph.add_edge(0, 4, 1_0)
						graph.add_edge(1, 3, 5)
						graph.add_edge(2, 3, 7)
						graph.add_edge(3, 0, 1_0)
						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_tokenizers_available, is_torch_available


lowerCAmelCase									=   {
    """configuration_graphormer""": ["""GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GraphormerConfig"""],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCAmelCase									=   [
					    """GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """GraphormerForGraphClassification""",
					    """GraphormerModel""",
					    """GraphormerPreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_graphormer import GRAPHORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, GraphormerConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_graphormer import (
										    GRAPHORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
										    GraphormerForGraphClassification,
										    GraphormerModel,
										    GraphormerPreTrainedModel,
										)


else:
					import sys

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



