%% Highlight Shortest Path
% Create and plot a graph. Return a handle to the GraphPlot object, h.

n = 10;
A = delsq(numgrid('L',n+2));
G = graph(A,'omitselfloops'); 
G.Edges.Weight = ones(numedges(G),1);
h = plot(G);

%
% Highlight the shortest path between nodes 74 and 21 by changing the color of the nodes and edges along the path to green.

path = shortestpath(G,74,21);
highlight(h,path,'NodeColor','g','EdgeColor','g')

% Copyright 2015 The MathWorks, Inc.