@Override
	public boolean isValidRoute(String route) {
		// TODO Auto-generated method stub
		if (route == null || route.equals("")) {
			return false;
		}

		String[] stations = route.split(DELIMITER_BETWEEN_STATIONS);
		if (stations == null || stations.length == 0) {
			return false;
		}

		// step1, validate all stations in the route
		int size = stations.length;
		for (int i = 0; i < size; i++) {
			String station = stations[i];
			if (!isValidStation(station)) {
				return false;
			}
		}

		// setp2, validate the edge
		for (int i = 0, j = 1; i < size - 1 && j < size; i++, j++) {
			String fromStation = stations[i];
			String toStation = stations[j];
			int p1 = getPosition(fromStation);
			int p2 = getPosition(toStation);
			if (mMatrix[p1][p2] == 0) {
				return false;
			}
		}

		return true;
	}