Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on an undergraduate thesis that requires the use of graph theory(shortest path problem) in MATLAB. However, all the graph functions that I see in the MATLAB help bar do not make use of square grids. I am currently using the graphtraverse function for traversal by following adjacent nodes.

Is there any way where I can convert all the nodes into square grids?


share|cite|improve this question
up vote 4 down vote accepted

If you need something that you cannot find in MATLAB / official toolboxes it is a good idea to check out the MATLAB exchange (

For graph theory there is for example the following toolbox available (


share|cite|improve this answer

See here, how graph theory can be used to segment retinal boundaries in optical coherence tomography (OCT) images, with the full MATLAB code and explainations: Segmentation of Retinal Layers in OCT images with Graph Theory (Includes finding the shortast path)

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.