Function to obtain the maximum Flow
int [ ] getMaxFlow ( int cap [ ] [ ] , int cost [ ] [ ] , int src , int sink ) { this . cap = cap ; this . cost = cost ; N = cap . length ; found = new boolean [ N ] ; flow = new int [ N ] [ N ] ; dist = new int [ N + 1 ] ; dad = new int [ N ] ; pi = new int [ N ] ; int totflow = 0 , totcost = 0 ;