This script demonstrates how graph theory can be used to segment retinal layers in optical coherence tomography images. It is based on Chiu SJ, et al, Automatic segmentation of seven retinal layers in SDOCT images congruent with expert manual segmentation, Optics Express, 2010. http://goo.gl/Z8zsY