-1

I have this question :

Given directed and connectivity graph G=(V,E) with positive weights define E(t) to be the group of edges whose weight is at most t. Find an algorithm that calculates the minimal t that for him G(t) = (V,E(t)) is connectivity.

I thought about finding the Max-flow min-cut of the graph but I am not sure the is the right direction to the solution.

milo
  • 445
  • 5
  • 12
Daniel16
  • 113
  • 8
  • I think it wouldn't hurt t ask this question on the mathematics stack exchange site as well. – npinti Jan 17 '20 at 07:20

1 Answers1

0

At first, let's notice that if p < q, then E(p) is a subset of E(q). It implies that if p < q and G(p) is connected, then G(q) is connected (*).

Let's define a function boolean isConnected(int k) that checks if G(k) is connected (you can implement it by yourself). (*) implies that function isConnected returns false for k < answer, and returns true for k >= answer.

It means that you can use binary search algorithm to find an answer.

ardenit
  • 3,610
  • 8
  • 16