private void expand(Node crt) {
		while (crt != null && !crt.isVisited()) {
			crt.setVisited(true);

			for (Cord c : crt.getNb()) {
				if (c == null)
					continue;
				Node nd = nodes[c.i][c.j];
				if (nd == null)
					continue;
				Integer dist = nd.costFrom(crt, panel, to.getDirectP());
				if (dist == null)
					continue;
				int nc = crt.getCost() + dist;
				if (nd.getCost() == null || nd.getCost() > nc) {
					nd.update(crt, nc);
				}
			}

			crt = getNextToExpand();
		}
	}