private String formatNodes(ViterbiNode[][] startsArray, ViterbiNode[][] endsArray) {
		this.nodeMap.clear();
		this.foundBOS = false;

		StringBuilder sb = new StringBuilder();
		for (int i = 1; i < endsArray.length; i++) {
			if(endsArray[i] == null || startsArray[i] == null) {
				continue;
			}
			for (int j = 0; j < endsArray[i].length; j++) {
				ViterbiNode from = endsArray[i][j];
				if(from == null){
					continue;
				}
				sb.append(formatNodeIfNew(from));
				for (int k = 0; k < startsArray[i].length; k++) {
					ViterbiNode to = startsArray[i][k];
					if(to == null){
						break;
					}
					sb.append(formatNodeIfNew(to));
					sb.append(formatEdge(from, to));
				}
			}
		}
		return sb.toString();
	}