File Exchange

image thumbnail

FIND ALL THE POSSIBLE PATHS BETWEEN A START AND AN END NODE OF A GRAPH

version 1.0.0.0 (2.04 KB) by Abhishek Chakraborty
Graph Theory, Finds all the possible paths between source and sink node.

2 Downloads

Updated 01 May 2010

View License

In Graph Theory it is often required to find out all the possible paths, which can exist between a source node and a sink node.
So this function returns a all such possible paths, in a matrix format.
INPUTS:
1. 'X' Matrix: Form a Nx2 matrix, where N is the total number of 'Edges'. This Matrix will contain all the edges of the graph in the form of 'From Node' to 'To Node' fashion.
2. StartNode: Specify the Start or the Source Node.
3. EndNode: Specify End or the Sink Node.

Type: "PathFinder(X, StartNode, EndNode)" in the command window. Press Enter. An OUTPUT matrix will be generated where all the possible paths between the Source to Sink Node will be shown 'Row Wise'. A '0' will appear in row as an element to signify a blank space.

Note: The main Limitation of this function is that, as the total number of node increases, the execution time also increases. The total number of nodes is also limited to 20, due to memory considerations. I am still working on this, so any kind of suggestions/advice from your side will be highly appreciated.

Author-
Abhishek Chakraborty
abhishek.piku@gmail.com
Ph. No.: 00 91 99 86 11 58 91

Cite As

Abhishek Chakraborty (2021). FIND ALL THE POSSIBLE PATHS BETWEEN A START AND AN END NODE OF A GRAPH (https://www.mathworks.com/matlabcentral/fileexchange/27438-find-all-the-possible-paths-between-a-start-and-an-end-node-of-a-graph), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (9)

Hatem Ziadia


Hello Abhishek,

Can you give an example please tu use the function

Yangsheng Liu

only suitable for a tiny network with just several bus.

Nori Ade

what is the different with minimum cut set method?? can you describe?? thanks

Emilia Silvas

Hello Abhishek,

Can you give an example of the X matrix? It is not a normal transition matrix, and I have just that.

Thanks!

kaka

siamak

your code is so weak

Tanyer Alan

Erdal Bizkevelci

Abhishek Chakraborty

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!