






from __future__ import annotations


class        SCREAMING_SNAKE_CASE	:
     '''simple docstring'''


     def __init__( self				:		Dict    ,       UpperCAmelCase_				:		int					):
       SCREAMING_SNAKE_CASE				:					Any		  =			vertices
       SCREAMING_SNAKE_CASE				:					Optional[int]		  =			[[0] * vertices for _ in range(UpperCAmelCase_					)]


     def  _A				( self				:		Optional[int]    ,       UpperCAmelCase_				:		list[int]					):
       print("Vertex \t Distance from Source"					)
       for vertex in range(self.vertices					):
         print(UpperCAmelCase_    ,       "\t\t"    ,       distances_from_source[vertex]					)


     def  _A				( self				:		Optional[int]    ,       UpperCAmelCase_				:		list[int]    ,       UpperCAmelCase_				:		list[bool]					):
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			1E7
       SCREAMING_SNAKE_CASE				:					Union[str, Any]		  =			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:
           SCREAMING_SNAKE_CASE				:					List[str]		  =			distances_from_source[vertex]
           SCREAMING_SNAKE_CASE				:					Union[str, Any]		  =			vertex
       return min_index






     def  _A				( self				:		Tuple    ,       UpperCAmelCase_				:		int					):
       SCREAMING_SNAKE_CASE				:					List[Any]		  =			[int(1E7					)] * self.vertices  # distances from the source
       SCREAMING_SNAKE_CASE				:					str		  =			0
       SCREAMING_SNAKE_CASE				:					Any		  =			[False] * self.vertices

       for _ in range(self.vertices					):
         SCREAMING_SNAKE_CASE				:					Optional[Any]		  =			self.minimum_distance(UpperCAmelCase_    ,       UpperCAmelCase_					)
         SCREAMING_SNAKE_CASE				:					Optional[int]		  =			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]
           ):
             SCREAMING_SNAKE_CASE				:					int		  =			distances[u] + self.graph[u][v]

       self.print_solution(UpperCAmelCase_					)


if __name__ == "__main__":
   snake_case			 =						Graph(9)
   snake_case			 =						[
       [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)














import re


def      lowerCamelCase__	(   lowercase ):

  """simple docstring"""






  def docstring_decorator(lowercase ):
    SCREAMING_SNAKE_CASE				:					List[Any]		  =			fn.__doc__
    SCREAMING_SNAKE_CASE				:					Tuple		  =			func_doc.split("\n" )
    SCREAMING_SNAKE_CASE				:					Tuple		  =			0
    while i < len(lowercase ) and re.search(R"^\s*Examples?:\s*$"  ,   lines[i] ) is None:
      i += 1
    if i < len(lowercase ):
      SCREAMING_SNAKE_CASE				:					int		  =			example_docstring
      SCREAMING_SNAKE_CASE				:					Tuple		  =			"\n".join(lowercase )
    else:
      raise ValueError(
          F'''The function {fn} should have an empty \'Examples:\' in its docstring as placeholder, '''
          F'''current docstring is:\n{func_doc}''' )
    SCREAMING_SNAKE_CASE				:					int		  =			func_doc
    return fn

  return docstring_decorator






