Here is a link to download matlab code to find MST
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=10922&objectType=FILE
About the definition of Path
In the defition of path, the restriction of "no repeated nodes" should be no repeated nodes except for the two end points. Otherwise, we can not say that circle is a special path.