int ALL_NODES = NO_X + NO_Y;
for (int x = 0; x < NO_X; x++) {
int tmpY = 0;
for (int y = NO_X; y < ALL_NODES; y++, tmpY++) {
if (costMatrix[tmpY][x] < floatMax) {
graph.addEdge(x, y, costMatrix[tmpY][x]);
} else {
// we would not need this line, if we would have a better graph.getOneNodeWithAnEdge()
// see within the while(true) loop
graph.addEdge(x, y, floatMax);
}