public ListGraph(int nNodes, List<Rectangle> obstacles, int width) {
		Logger log = Logger.getLogger("fr.upem.algoproject");
		this.array = new ArrayList[nNodes];
		for(Rectangle l: obstacles ) {
			for(int i=l.topleft.x; i <= l.bottomright.x; ++i) {
				for(int j = l.topleft.y; j <= l.bottomright.y; ++j) {
					log.finest((j * width + i) + "on rectangle " + l);
					array[j * width + i] = OBS;
				}
			}
		}
		for(int i=0; i < nNodes; ++i) {
			if(array[i] != OBS)
				array[i] = new ArrayList<>();
		}
	}