Is there a search algorithm I can apply to a dataset that I do not have a specific F(x,y) function for?

1 view (last 30 days)
Hello,
I am looking for the best search algorithm for the following set of data:
I have a set of temperature values T(x,y) which I want to find a minimum of; it is important to note that I do not have a specific function (such as T(x,y)= x^2+y^2), just the points. I haven't found a search function that works on raw data (without a function handle), but I'm a little out of my element so I may have misunderstood the documentation.
What I would like to do is to have the algorithm start at the maximum T value, then show the path it takes to the minimum T value. I want to be able to overlay the path on data for presentation. For what it's worth, the data is relatively well behaved, so there is a well defined global maximum and few peaks between the maximum and minimum.
Thank you for any direction you can offer,
Matt
Edit1: This does take place on a square grid.

Accepted Answer

Walter Roberson
Walter Roberson on 23 Jan 2018
To get a path between min and max, first find out which nodes are min and max, and then create a graph() representation of the system and use shortestpath() to find the way between them.
A key bit here is that you have to decide which nodes are connected to which. You did not say that you have a grid of points, so we as onlookers cannot assume that nodes are connected in any particular manner: in what you have given so far, it is not clear that the path could not simply go from max to min in one angled step.
  4 Comments
Matthew
Matthew on 23 Jan 2018
Thanks Walter,
I am accounting for the diagonals, but I was not aware of the 'setdiff' function. I think I can apply this to solve my problem.
Matt P.
Walter Roberson
Walter Roberson on 23 Jan 2018
I think I posted code to construct an appropriate mesh about 4 or 5 months ago, but it would take me a while to find it.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!