public static void main(String[] args) {
    AccessibilityGraphImpl graph = new AccessibilityGraphImpl();

    Location location1 = graph.addAccessibleLocation(0, 0);
    Location location2 = graph.addAccessibleLocation(0, 1);
    Location location3 = graph.addAccessibleLocation(1, 0);
    Location location4 = graph.addAccessibleLocation(1, 1);

    List<Location> locations = Arrays.asList(location1, location2, location3, location4);

    Location start = graph.addAccessibleLocation(-1, 0);
    Location finish = graph.addAccessibleLocation(2, 0);

    for (Location loc : graph) {
      for (Location loc1 : graph) {
        graph.addAccessibilityRelation(loc, loc1);
      }
    }

    BruteForceTSPSolver solver = new BruteForceTSPSolver(graph);
    List<Location> computeTSP = solver.computeTSP(start, finish, locations, 10);

    System.out.println(computeTSP);

    System.out.println(getCost(computeTSP, graph));

    computeTSP = Arrays.asList(start, location1, location2, location4, location3, finish);
    System.out.println(getCost(computeTSP, graph));
  }
  private static void create2Rooms() throws Exception {
    AccessibilityGraphImpl room1 =
        GraphFactory.createRectangularGridGraph(300, 300, 3, 3, 10, 10.0);
    AccessibilityGraphImpl room2 =
        GraphFactory.createRectangularGridGraph(300, 300, 3, 3, 10, 400.0);

    room1.copyFrom(room2);
    Location vertex1 = room1.getNearestLocation(new Point2D.Float(160, 310));
    Location vertex2 = room1.getNearestLocation(new Point2D.Float(160, 450));

    System.out.println(vertex1);
    System.out.println(vertex2);

    room1.addAccessibilityRelation(vertex1, vertex2);

    new GraphGUI(room1);

    room1.write("src/main/resources/graphs/2rooms.txt");

    room1.writeGrid("src/main/resources/grids/2rooms.txt");
  }