Troubleshooting Java Code for Travelling Salesman Problem
Hello, I'm having trouble getting my Java code to solve the Travelling Salesman Problem. I'm following a TSP tutorial from here: https://www.interviewbit.com/blog/travelling-salesman-problem/ that uses the following code: // Initialize the matrix int[][] d = new int[][] { { 0, 10, 15, 20 }, { 10, 0, 35, 25 }, { 15, 35, 0, 30 }, { 20, 25, 30, 0 } }; // Initialize the array of visited cities boolean[] visited = new boolean[] { false, false, false, false }; // Initialize the current path int[] path = new int[4]; // Initialize minPathLength int minPathLength = Integer.MAX_VALUE; // Call the search method search(d, visited, 0, 0, 4, path, minPathLength); However, when I try to run the code, I get an error. Is there an issue with my code or is there something else I am missing? Any help would be greatly appreciated. Thanks in advance!