private static int breadthFirstSearch(int from, int to) {
		
		int maxDistance = 0;
		Integer[] object;
		LinkedList<Integer[]> cola = new LinkedList<Integer[]>();
		
		LinkedList<Integer> visited = new LinkedList<Integer>();
		
		int[] precedents = new int[listaNombres.size()];
		int[] distances = new int[listaNombres.size()];
		
		
		Iterator<Integer[]> itr;
		int precedent = from,
			distance = -1,
			indexOfObject;
		boolean found = false;
		
		cola.add(grafo.get(listaNombres.indexOf(from)).getFirst());
		
		while(!cola.isEmpty() && !found) {
			
			object = cola.removeFirst();
			
			indexOfObject = listaNombres.indexOf(precedent);
			
			//setting up the visited node
			visited.add(listaNombres.indexOf(object[0]));
			
			
			//inserting in the precedents list the last removed object
			precedents[indexOfObject] = indexOfObject;
			distances[indexOfObject] = distance;
			
			
			//setting up the precedent
			precedent = listaNombres.indexOf(object[0]);
			distance = object[1];
			
			if(object[0] == to) {
				found = true;
			}
			
			itr = grafo.get(indexOfObject).iterator();
			
			while(itr.hasNext()) {
				
				object = itr.next();
				
				if(!visited.contains(listaNombres.indexOf(object[0]))) {
					
					cola.add(object);
					
					
				}
				
			}
			
		}
		
		if(found) {
			maxDistance = doBackTrack(precedents, distances, to);
		}
		
		return maxDistance;
	}