MATLAB: Find all the paths between each couple of nodes in a graph

all possible pathsfind path graph

how can I find all the possible paths between each couple of nodes in a graph? Thanks in advance

Best Answer

Create the adjacency matrix and raise it to successive matrix powers.
If the graph is not a directed graph, then there will be an infinite number of possible paths. There might well be an infinite number anyhow.
For example,
A BCD BCD BCD BCD BCD BCD BCD BCD E is a quite plausible path between A and E if A->B, B->C, C->D, D->B and D->E
Perhaps you wanted to ask a slightly different question.