public static void main(String[] args) {
		JSAP jsap = initParameters();
		JSAPResult jsapResult  = jsap.parse(args);

		if(!jsapResult.success()) {
			printHelp(jsap);
		}

		boolean withShortedPath = jsapResult.getBoolean("shortedPath");
		//Boolean reduced = jsapResult.getBoolean("reduced");

		File inputFile = new File(jsapResult.getString("input"));
		File outputFile = new File(jsapResult.getString("output"));

		if(!inputFile.canRead()) {
			System.err.println("Can't read on " + inputFile.getPath());
			System.exit(-1);
		}


		Xml xml = XmlFactory.newXml(inputFile);
		Maze maze = new Maze(xml.getRectangle().getDimension());
		maze.initMaze(xml.getPoints().getStart(), xml.getPoints().getEnd(),
				xml.getRectangle().getObstacles().getObstacle());

		Integer start = xml.getPoints().getStart().getX() +
				xml.getPoints().getStart().getY() *
				xml.getRectangle().getDimension().getWidth();

		Integer stop = xml.getPoints().getEnd().getX() +
				xml.getPoints().getEnd().getY() *
				xml.getRectangle().getDimension().getWidth();

		if(withShortedPath) {
			NodeListGraph  nodeListGraph = NodeListGraphFactory.newNodeListGraph(maze);
			Dijkstra dijkstra = new Dijkstra(nodeListGraph);
			maze.colorShortedPath(dijkstra.getShortedPath(start, stop));
		}
		try {
			maze.createImage(outputFile);
		} catch (IOException e) {
			System.err.println("Erreur d'écriture de l'image !");
			e.printStackTrace();
			System.exit(-1);
		}
	}