Package io.openml.gearbox.controller
Class TravelingSalesmanController
java.lang.Object
io.openml.gearbox.controller.TravelingSalesmanController
REST controller that exposes an endpoint for solving the Traveling Salesman Problem.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>
Accepts a POST request with a list of cities and a distance matrix, and returns the optimal tour.
-
Constructor Details
-
TravelingSalesmanController
public TravelingSalesmanController()
-
-
Method Details
-
solveTsp
@PostMapping("/solve") public org.springframework.http.ResponseEntity<?> solveTsp(@RequestBody TravelingSalesmanController.Request request) Accepts a POST request with a list of cities and a distance matrix, and returns the optimal tour.- Parameters:
request
- The Request payload.- Returns:
- A ResponseEntity containing the TspResponse.
-