Professional Documents
Culture Documents
Ford-Fulkerson Algorithm C++ Code
Ford-Fulkerson Algorithm C++ Code
Ford-Fulkerson Algorithm C++ Code
#include <limits.h>
#include <string.h>
#include <queue>
using namespace std;
#define V 6
bool visited[V];
memset(visited, 0, sizeof(visited));
queue <int> q;
q.push(s);
visited[s] = true;
parent[s] = -1;
while (!q.empty())
{
int u = q.front();
q.pop();
int rGraph[V][V];
int parent[V];
int max_flow = 0;
max_flow += path_flow;
}
cout<<"\nResidual graph:\n";
for(int i=0;i<V;i++){
cout<<endl;
for(int j=0;j<V;j++){
cout<<"\t"<<rGraph[i][j];
}
}
return max_flow;
}
int main()
{