public boolean checkCycle(Integer lastAddedNodeIndex) {
		Queue<Integer> q = new LinkedList<Integer>();
		HashSet<Integer> visited = new HashSet<Integer>();
		HashSet<Integer> neighbours;
		HashMap<Integer, Integer> parent = new HashMap<Integer, Integer>();
		stationsMediator tmpMediator = stationMediator;

		q.add(lastAddedNodeIndex);
		while (q.size() > 0) {
			Integer currentIndex = q.poll();
			visited.add(currentIndex);
			neighbours = tmpMediator.getNeighbourStations(currentIndex);
			for (Integer nIndex : neighbours) {
				if (parent.get(currentIndex) != nIndex) {
					parent.put(nIndex, currentIndex);
				}
				if (visited.contains(nIndex)
						&& parent.get(currentIndex) != nIndex
						&& currentIndex != lastAddedNodeIndex) {
					return true;
				} else if (parent.get(currentIndex) != nIndex) {
					q.add(nIndex);
				}
			}
		}

		return false;
	}