def find_min(Q,distances):
	"""
	@Q : A dictinnary containing open nodes
	@distance : A dictionnary containing the minimale distances to reach a certain node
	@return : The index of the node with the smalest distance
	"""
	mini=float("inf")
	sommet=-1
	for e in Q:
		if distances[e] < mini:
			mini=distances[e]
			sommet=e

	return sommet