"""simple docstring"""





lowerCAmelCase_     =	{
    '''A''': ['''B''', '''C''', '''E'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F''', '''G'''],
    '''D''': ['''B'''],
    '''E''': ['''A''', '''B''', '''D'''],
    '''F''': ['''C'''],
    '''G''': ['''C'''],
}



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  )->    list[str]:
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    set()
							# keep track of all the paths to be checked
							_SCREAMING_SNAKE_CASE		:						Dict			  =    [[start]]

							# return path if start is goal
							if start == goal:
														return [start]

							# keeps looping until all possible paths have been checked
							while queue:
														# pop the first path from the queue
														_SCREAMING_SNAKE_CASE		:						Tuple			  =    queue.pop(0  )
														# get the last node from the path
														_SCREAMING_SNAKE_CASE		:						List[str]			  =    path[-1]
														if node not in explored:
																					_SCREAMING_SNAKE_CASE		:						List[Any]			  =    graph[node]
																					# go through all neighbour nodes, construct a new path and
																					# push it into the queue
																					for neighbour in neighbours:
																												_SCREAMING_SNAKE_CASE		:						str			  =    list(__SCREAMING_SNAKE_CASE  )
																												new_path.append(__SCREAMING_SNAKE_CASE  )
																												queue.append(__SCREAMING_SNAKE_CASE  )
																												# return path if neighbour is goal
																												if neighbour == goal:
																																			return new_path

            # mark node as explored
																					explored.add(__SCREAMING_SNAKE_CASE  )

    # in case there's no path between the 2 nodes
							return []



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  )->    int:
							if not graph or start not in graph or target not in graph:
														return -1
							if start == target:
														return 0
							_SCREAMING_SNAKE_CASE		:						List[Any]			  =    [start]
							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    set(__SCREAMING_SNAKE_CASE  )
							# Keep tab on distances from `start` node.
							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    {start: 0, target: -1}
							while queue:
														_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    queue.pop(0  )
														if node == target:
																					_SCREAMING_SNAKE_CASE		:						List[str]			  =    (
																					    dist[node] if dist[target] == -1 else min(dist[target]     ,	dist[node]  )
																					)
														for adjacent in graph[node]:
																					if adjacent not in visited:
																												visited.add(__SCREAMING_SNAKE_CASE  )
																												queue.append(__SCREAMING_SNAKE_CASE  )
																												_SCREAMING_SNAKE_CASE		:						List[Any]			  =    dist[node] + 1
							return dist[target]


if __name__ == "__main__":
			print(bfs_shortest_path(demo_graph, '''G''', '''D'''))  # returns ['G', 'C', 'A', 'B', 'D']
			print(bfs_shortest_path_distance(demo_graph, '''G''', '''D'''))  # returns 4



"""simple docstring"""





from __future__ import annotations



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	)->    tuple:
							if (electron_conc, hole_conc, intrinsic_conc).count(0  ) != 1:
														raise ValueError("""You cannot supply more or less than 2 values"""  )
							elif electron_conc < 0:
														raise ValueError("""Electron concentration cannot be negative in a semiconductor"""  )
							elif hole_conc < 0:
														raise ValueError("""Hole concentration cannot be negative in a semiconductor"""  )
							elif intrinsic_conc < 0:
														raise ValueError(
														    """Intrinsic concentration cannot be negative in a semiconductor"""  )
							elif electron_conc == 0:
														return (
														    "electron_conc",
														    intrinsic_conc**2 / hole_conc,
														)
							elif hole_conc == 0:
														return (
														    "hole_conc",
														    intrinsic_conc**2 / electron_conc,
														)
							elif intrinsic_conc == 0:
														return (
														    "intrinsic_conc",
														    (electron_conc * hole_conc) ** 0.5,
														)
							else:
														return (-1, -1)


if __name__ == "__main__":
			import doctest

			doctest.testmod()


