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

조회 수: 3 (최근 30일)
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.

채택된 답변

Walter Roberson
Walter Roberson 2018년 1월 23일
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
Matthew
Matthew 2018년 1월 23일
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 2018년 1월 23일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by