Question: MATLAB problem: Write a MATLAB function to use Label Correcting Algorithm to solve a shortest path problem to go from node 1 to node

MATLAB problem: Write a MATLAB function to use Label Correcting Algorithm to solve a shortest path problem to go from node 1 to node N. The input is an N x N matrix, A, such that Aij > 0 is the distance from i to j. If Aij = -1, then there is no link from i to j. The function should have the format [route, cost] = shortestpath (A, method) where route is a vector with a shortest path sequence of integers starting with 1 and ending with N cost is the cost of the shortest path A is the input matrix of edge lengths method is a flag to indicate the solution method to select nodes from OPEN (see notes) 1 = first in/first out 2 last in/first out - 3 minimum label
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
