Can anybody give me a C Code to find all possible paths between two nodes?I have a adjacency matrix.(adjacency matrix occurs 0 and 1)
all paths between 1 and 4 are:
1-2-3-4
1-2-4
1-3-4
1-3-2-4
Code:int visited[2415]={0};How should I change this code?Code:void DFS(int i,int target) { int j; if(i<=target) printf("%d ",i); visited[i]=1; for(j=0;j<2415;j++) if(!visited[j]&&graf[i][j]==1) DFS(j,t); }