from __future__ import annotations





class 					__snake_case    :




					def __init__(  self       ,			__UpperCamelCase						)	->    None:



									'''simple docstring'''







									snake_case__   :      Dict   				= vertices
									snake_case__   :      int   				= [[0] * vertices for _ in range(__UpperCamelCase						)]




					def      __a     (  self       ,			__UpperCamelCase						)	->    None:



									'''simple docstring'''







									print('Vertex \t Distance from Source'						)
									for vertex in range(self.vertices						):
													print(__UpperCamelCase       ,			'\t\t'       ,			distances_from_source[vertex]						)




					def      __a     (  self       ,			__UpperCamelCase       ,			__UpperCamelCase						)	->    int:



									'''simple docstring'''







									snake_case__   :      Optional[int]   				= 1E7
									snake_case__   :      int   				= 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:
																	snake_case__   :      Tuple   				= distances_from_source[vertex]
																	snake_case__   :      Tuple   				= vertex
									return min_index




					def      __a     (  self       ,			__UpperCamelCase						)	->    None:



									'''simple docstring'''







									snake_case__   :      Optional[Any]   				= [int(1E7						)] * self.vertices  # distances from the source
									snake_case__   :      str   				= 0
									snake_case__   :      Optional[int]   				= [False] * self.vertices

									for _ in range(self.vertices						):
													snake_case__   :      List[str]   				= self.minimum_distance(__UpperCamelCase       ,			__UpperCamelCase						)
													snake_case__   :      List[str]   				= 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]
																	):
																					snake_case__   :      Tuple   				= distances[u] + self.graph[u][v]

									self.print_solution(__UpperCamelCase						)


if __name__ == "__main__":
				lowerCAmelCase__	:  Union[str, Any]						=  Graph(9)
				lowerCAmelCase__	:  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)



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowerCAmelCase__	:  int						=  {
    '''configuration_switch_transformers''': [
        '''SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''SwitchTransformersConfig''',
        '''SwitchTransformersOnnxConfig''',
    ]
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowerCAmelCase__	:  List[Any]						=  [
				    '''SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''SwitchTransformersEncoderModel''',
				    '''SwitchTransformersForConditionalGeneration''',
				    '''SwitchTransformersModel''',
				    '''SwitchTransformersPreTrainedModel''',
				    '''SwitchTransformersTop1Router''',
				    '''SwitchTransformersSparseMLP''',
				]


if TYPE_CHECKING:
				from .configuration_switch_transformers import (
				    SWITCH_TRANSFORMERS_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    SwitchTransformersConfig,
				    SwitchTransformersOnnxConfig,
				)

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_switch_transformers import (
								    SWITCH_TRANSFORMERS_PRETRAINED_MODEL_ARCHIVE_LIST,
								    SwitchTransformersEncoderModel,
								    SwitchTransformersForConditionalGeneration,
								    SwitchTransformersModel,
								    SwitchTransformersPreTrainedModel,
								    SwitchTransformersSparseMLP,
								    SwitchTransformersTopaRouter,
								)


else:
				import sys

				lowerCAmelCase__	:  Union[str, Any]						=  _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


