


from queue import PriorityQueue
from typing import Any

import numpy as np


def 		lowercase_  (     _UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			):


			'''simple docstring'''







			for nxt, d in graph[v]:
						if nxt in visited_forward:
									continue
						__lowercase 					=   cst_fwd.get(_UpperCamelCase       ,			np.inf  )
						__lowercase 					=   cst_fwd[v] + d
						if new_cost_f < old_cost_f:
									queue.put((new_cost_f, nxt)  )
									__lowercase 					=   new_cost_f
									__lowercase 					=   v
						if nxt in visited_backward:
									if cst_fwd[v] + d + cst_bwd[nxt] < shortest_distance:
												__lowercase 					=   cst_fwd[v] + d + cst_bwd[nxt]
			return shortest_distance


def 		lowercase_  (     _UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase  ):


			'''simple docstring'''







			__lowercase 					=   -1

			__lowercase 					=   set()
			__lowercase 					=   set()
			__lowercase 					=   {source: 0}
			__lowercase 					=   {destination: 0}
			__lowercase 					=   {source: None}
			__lowercase 					=   {destination: None}
			__lowercase 					=   PriorityQueue()
			__lowercase 					=   PriorityQueue()

			__lowercase 					=   np.inf

			queue_forward.put((0, source)  )
			queue_backward.put((0, destination)  )

			if source == destination:
						return 0

			while not queue_forward.empty() and not queue_backward.empty():
						__lowercase					, __lowercase 					=   queue_forward.get()
						visited_forward.add(_UpperCamelCase  )

						__lowercase					, __lowercase 					=   queue_backward.get()
						visited_backward.add(_UpperCamelCase  )

						__lowercase 					=   pass_and_relaxation(
						    _UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			)

						__lowercase 					=   pass_and_relaxation(
						    _UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			_UpperCamelCase       ,			)

						if cst_fwd[v_fwd] + cst_bwd[v_bwd] >= shortest_distance:
									break

			if shortest_distance != np.inf:
						__lowercase 					=   shortest_distance
			return shortest_path_distance


a : Union[str, Any]		=				{
    '''B''': [['''C''', 1]],
    '''C''': [['''D''', 1]],
    '''D''': [['''F''', 1]],
    '''E''': [['''B''', 1], ['''G''', 2]],
    '''F''': [],
    '''G''': [['''F''', 1]],
}
a : Optional[int]		=				{
    '''B''': [['''E''', 1]],
    '''C''': [['''B''', 1]],
    '''D''': [['''C''', 1]],
    '''F''': [['''D''', 1], ['''G''', 1]],
    '''E''': [[None, np.inf]],
    '''G''': [['''E''', 2]],
}

if __name__ == "__main__":
	import doctest

	doctest.testmod()






def 		lowercase_  (     _UpperCamelCase       ,			_UpperCamelCase  ):


			'''simple docstring'''







			return price * (1 + tax_rate)


if __name__ == "__main__":
	print(f'''{price_plus_tax(100, 0.25) = }''')
	print(f'''{price_plus_tax(125.50, 0.05) = }''')


