gistlib
main.mfunction path = reconstructPath(cameFrom, current) path = [current]; while isfield(cameFrom, num2str(current)) current = cameFrom.(num2str(current)); path = [current, path]; end end 215 chars9 lines
function path = reconstructPath(cameFrom, current) path = [current]; while isfield(cameFrom, num2str(current)) current = cameFrom.(num2str(current)); path = [current, path]; end end
gistlibby LogSnag