Geeksforgeeks

Error

×

Leaderboard

Showing:

Handle | Score |
---|---|

@Ibrahim Nash | 6381 |

@blackshadows | 6329 |

@mb1973 | 5388 |

@Quandray | 5231 |

@akhayrutdinov | 5111 |

@saiujwal13083 | 4510 |

@sanjay05 | 3762 |

@marius_valentin_dragoi | 3522 |

@sushant_a | 3459 |

@verma_ji | 3357 |

@KshamaGupta | 3318 |

Complete Leaderboard | |

Handle | Score |

@1905439 | 553 |

@terabaap123 | 508 |

@smitadiwedi1991 | 279 |

@DevanandJayakumar | 250 |

@atishagusain | 244 |

@gupta_10 | 226 |

@nipun edara | 224 |

@shubhamkhullar7 | 224 |

@sharmachandan487 | 204 |

@balunagar | 204 |

@arshjit_singh7 | 190 |

Complete Leaderboard |

Given an adjacency matrix and 2 integers S and T. The task is to find minimum capacity s-t cut of the given network.

An s-t cut is a cut that requires the source ‘s’ and the sink ‘t’ to be in different subsets, and it consists of edges going from the source’s side to the sink’s side. The capacity of an s-t cut is defined by the sum of the capacity of each edge in the cut-set.

**Input:**

The first line consists of T test cases. The first line of every test case consists of V number of vertices. The second line of every test case consists of V*V spaced integers consisting of the weight of edge from ith to jth index. The third line of every test case consists of S and T.

**Output:**

Single line output all the vertices which take the minimum cut from one vertex to other.If there is no mincut edge print -1.

**Constraints:**

1<=T<=10

1<=N<=50

**Example:
Input:**

1

6

0 16 13 0 0 0 0 0 10 12 0 0 0 4 0 0 14 0 0 0 9 0 0 20 0 0 0 7 0 4 0 0 0 0 0 0

0 5

1 3 4 3 4 5

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes
Find minimum s-t cut in a flow network

...