20877 >> Nikhil Devanur Rangarajan: Okay. So we're very happy to have Cora Borradaile visit us from Oregon State University. She finished her Ph.D. three years ago at Brown University, working with Phil Cline. And she'll talk about finding all min ST-cuts and planar graphs. And she's done lots of works on planar graphs and flow and other things. >> Glencora Borradaile: Thank you. So this is joint work with Petroski Sankowski and Christian Wulff-Nilsen, and I want to say that the talk is -- I haven't actually done a run through, I'm pretty sure it's pretty short. So there's plenty of time for questions. And please interrupt me if you have a question along the way because I'm not quite sure how much people know about planar graphs or care. So I do know that you all know what the min ST-cut problem is. You're given a graph. All the graphs in this talk are weighted. Edge weighted. And the problem is to find a set of edges that you can remove that will separate S from T in the graph and you can think of this as either a set of edges or a bipartition of the vertices where the bipartition is the partition you get when you remove the set of edges of S from T. So this problem has been studied usually from max flows. Of course you know the max flow min cut theorem. The value of the max flow is equal to the min cut. And the best algorithms for weighted min cut in general graphs do follow from max flow. So you really just know the max flow problem and you find the saturated edges and that gives you a minimum cut. So there's the running time of the best known algorithm for finding max flow, max ST flow in a general graph and so also the min cut. Okay. So min cuts, min ST-cuts have some nice properties that we'll be taking advantage of. So one thing that we are not really taking advantage of the fact that min ST-cuts are nonunique, but it will come up at the end why our running time has several logarithmics in the polylogarithmic part. There could be two min cuts that have the same value and both separate S from T. But thankfully -- so if we are considering a few different min cuts in this graph. So we want to separate, we want to know what the ST-cut is-- I'm sorry, the min cut that separates S from T and U from V and X from Y. If we look at all these cuts, there's a set of min cuts such they're noncrossing. This follows from the submodularity of the min cut function. And because there exists, if you looked at the min cuts between every pair of vertices in this graph, this is an undirected graph now. For directed graphs this is not the case. For undirected graph, if you look at all the min cuts, as a bipartition of the vertices for every single pair of vertices in this graph, then there are exactly N minus 1 distinct cuts. Just following from the fact that these sets have to be noncrossing. So does everyone -- usually can't see without my prescription glasses on, expressions on people's faces. So is that clear to everyone? That you would have N minus one cuts. >>: Can you explain that? >> Glencora Borradaile: Okay. So I won't go through the proof of why the cuts are noncrossing. That you can work through kind of a pain to go through the inequalities. But if you have -- you have an N vertices in the graph and now you want to find how many possible ways are there -- how many possible sets are there in a maximal set of crossing, of non-crossing subsets such that each set somehow separates different vertices. So this is the sort of nesting principle. Every pair of sets in your collection of subsets has to -- they have to be different so they have to enclose different things. So the way you can pack in as many cuts as possible, there's only N minus 1 of them. Okay. ->>: Trees number of trees. >> Glencora Borradaile: Yes. Exactly. Okay. So in 1961, Gomory and Hu -- Hu actually did his Ph.D. at Brown as well. Or was it Gomory? I forget. I think it was Hu. Gave a very nice simple algorithm base using this idea to find all the min ST-cuts in the graph, represented in a nice way. In fact using a tree. And it's called the Gomory-Hu tree. I'll show you how we find that Gomory-Hu tree. How many people have heard of the Gomory-Hu tree before? So not everyone and less than half if you guys are honest. Okay. So it's a very simple algorithm to find all the min ST-cuts in the graph. And it just uses the fact that there is a set of N minus 1 cuts that don't cross that represent all the min ST-cuts in the graph. So what you do is you just pick two vertices. Okay. So suppose we found one cut. So this red set represents one cut that we've already found. And we want to find another cut to add to our set. We know there are now N minus 2 cuts that will nest with this cut. So what you do is you pick two vertices. You're not going to pick a vertex here and a vertex here because you might just end up finding this cut again and that would be a waste of time. But if you picked two vertices that are on a common side of the cut that you've already found, then you're guaranteed to find a new cut, right? One that isn't this red thing, because this red thing doesn't separate S from T. >>: Are all cuts extensible to non[indiscernible]? >> Glencora Borradaile: Min cuts. Yes. So, in fact, yeah, the way you prove that there are noncrossing cuts is you take two min cuts that are crossing and you argue that either this set of vertices minus this set is a min cut or this set plus this set is a min cut, depending on where your terminals are for the min cuts. >>: So this set may not be in the eventual family ->> Glencora Borradaile: No, this will be. Yes. Sorry. I misunderstood what you were asking. Yes. This set will be in the family. So this cut that we've already found is a min cut for some pair of vertices. Let's say, for example, this pair. So this might be the only min cut for this pair. And if we found -- if there was another pair of vertices, say here, the min cut for this pair of vertices would either have to be one side of the cut would either have to be enclosed by this set or enclose it. >>: Can I ask a question? >> Glencora Borradaile: Sure. >>: Are all min cuts, do you know ->> Glencora Borradaile: You can always extend. >>: You can always extend? >> Glencora Borradaile: Yes. So we pick two vertices that have not been separated by the cuts we've found so far. We find the min cut. And we repeat. So you pick two vertices that are not separated by any cut you've already found. So, for example, you can pick two vertices in here or you can pick a vertex here and a vertex here. Right? Actually, no, you wouldn't pick those two because they're already. There's no path between them. No, no, there is. You can pick this vertex and this vertex or this vertex and this vertex. You just repeat this process until every pair of vertices in your graph is separated by some cut that you found so far. And by Gomory-Hu's argument for any pair of vertices in this graph, for example, this pair, one of the cuts from the graph -- one of the cuts in your collection of N minus 1 cuts has to be the min cut for that pair of vertices. >>: So you're restricting the min cut to the subdued graph on that vertices on that side? >> Glencora Borradaile: Yes, that's a good question. So when we pick -- so, for example, when I say find a min cut between S and T, Gomory-Hu would say we want to find something that definitely nests with the stuff we found already. And if you didn't, you might because min cuts are nonunique you might find a set that does cross this one. So in order to overcome that, what Gomory-Hu suggests is to identify all the nodes in this cut and find the min cut in the remaining graph, and that won't cross. Okay. So we find this collection of cuts. And we can represent this collection of cuts using a tree in the natural way, right? So it will be a tree on N vertices and each edge will represent one of the cuts. So if I fade out the graph. So this would be the tree. So every edge represents the unique cut that separates the vertices. So for a given cut, you want an edge in the graph that separates the stuff inside the cut from the stuff outside the cut. Okay. So now we want to -- we can forget about the cuts. And we can just represent these cuts with a tree. So remember cuts are weighted, though, right? Every cut has a different value depending on the total weight of the edges crossing the cut. So we want to store that information in this tree. And the way you do it you just give each edge of the tree a weight that corresponds to the weight of the edges crossing the cut that it represents. So this tree is also weighted. Okay. So given this tree, if we now want to find the min cut between any two pair of vertices. So say I now given this supposed Oracle I want find the min cut between S and T, I just look at the path in the tree between S and T, and what edge do you think I'm interested in? The least edge. Minimum weight edge. For example, this might be the minimum weight edge on this path and the cut corresponding to that edge -- it's not very well drawn because this edge is going in and then back out of the cut. So just ignore that. But if you just look at the bipartition of the vertices that you get by deleting the edge from the tree, that's exactly the bipartition of the vertices that corresponds to a min cut between S and T. So the tree represents everything. The tree represents all N minus 1 cuts. It represents all pair min ST-cuts in the graph as well as the weight and the bipartition in the vertices for those cuts. >>: The tree has to be appropriate every node is larger than [indiscernible]. >> Glencora Borradaile: Every node is larger? >>: [indiscernible]. >> Glencora Borradaile: Yes, the weights are on the edges of the trees. >>: Also seems not sure if the edge ->> Glencora Borradaile: The cuts -- no, it's an -- yeah, it's an unrooted tree. >>: Summary from -- maybe a misunderstanding. But like if you took the min cut in the draft, then this is like smallest, this is the smallest volume. And then ->> Glencora Borradaile: Right but the ->>: And inside ->> Glencora Borradaile: So that's the global min cut of the graph. But we find min ST-cuts. So we're finding the min cut that separates two identified terminal vertices in each iteration. >>: But the global state is ->> Glencora Borradaile: You could start with the global min cut. I don't know if it would gain you anything. >>: Global min cut separates all the vertices. So this would be the min. So [indiscernible] maybe it only occurs in the global min cut and then look at the two pieces recursively? >> Glencora Borradaile: Find a global min cut on both sides. But then what are you finding the min cut, what graph are you finding the min cut in? Because the min cuts you need to find need to be able to share edges with other cuts. So, for example, if we look at our set of cuts, so, for example, this cut and this cut share both this edge and this edge. So you need to -- if you're going to sort of focus on one side of a cut and you're just going to find the global min cut, then I think you just repeatedly find the same cut over and over again. You'd have to exclude something from it. And I'm not sure what that would be. >>: Maybe there is one global tree which has [indiscernible]. >> Glencora Borradaile: I don't think -- they can have arbitrary relationships between -- like this min cut could have a much bigger weight than this one, and bigger weight than the one inside it. I don't see why not. So if anything, if history says anything, okay, so this is a property. And Ford and Fulkerson were very impressed with this. Right after the publication of this paper they stated that, thus one could hardly ask for anything better. And really so nothing much more is known about Gomory-Hu trees. So this is the formal statement of a Gomory-Hu tree. You're given an undirected graph. There's a tree on the same set of vertices. It's not a spanning tree. Such that for every pair of vertices in the graph, the min ST-cut in T is a single edge, right? Of course. And it has the same value of the bipartition of B as in an ST-cut in the original graph. That's the formal statement. And how did we find this tree? We found this by repeatedly picking vertices, terminal vertices that are not separated and finding them in ST-cut between them. Between them we find one cut in each iteration S minus one min cut computations to find this tree. So you could ask, well, can you find this faster than that, okay, faster than that, faster than N minus 1 times whatever your best min cut algorithm is, and Balghat et al. and one of the co-authors is here. There's four authors on the paper, I think. So they gave the first algorithm for a Gomory-Hu tree that beats this order N, this bound of N times the time for a min cut for unweighted graphs. It uses an interesting construction based on packing Steiner trees, if I remember. And Gusfield, Gusfield, in 1990, gave a nicer implementation of the algorithm. So as you asked, right, so in order to find noncrossing cuts, the easiest way to do it is to contract the side of the cut, the vertices that you're not really looking at. So you don't cross cuts that you've already found. Gusfield showed that you could not avoid doing that and you can find noncrossing cuts and you can fix them up afterwards. You just have to find N minus one noncrossing cuts in the original graph. So that's the state of the art for Gomory-Hu trees. Okay. And some people might know I'm a little bit obsessed with planar graphs. No fault of Phil, my advisor. So if you think about this problem in planar graphs, well, the best min cut algorithm for planar graphs takes order N log N time. It's the same running time as for finding the maximum flow in a planar graph. You can do slightly better than N times N log time. Or N squared log N time. By some work on the minimum cycle basis and planar graphs. So as we'll see, there's a big close correspondence between cuts and cycles and planar graphs. So you can get to order N squared time for planar graphs using some results of the '90s. So anyway, the details are not so important at this stage. Okay. So I'd like to beat this order N squared. Order N squared isn't so surprising for planar graphs because if your terminals happen to be adjacent in the planar graph you can find the min cut in linear time. You just find a shortest separating cycle that goes between them. We'll see this reduction again. So getting order N squared is not too surprising to me. Because nodes tend to be close together in planar graphs. Anyway, so what you really want to do is much better than order N squared. So the three of us were able to show that you can find this tree for a planar graph. Planar undirected weighted graph in order N poly N log time. And the poly log is logged to the fourth, if you are willing to assume that shortest paths are unique. So you get noncrossing cuts easily. If you're willing to do randomization to assume that shortest paths are unique, then you can get this N log to the fourth N time. To derandomize that we can get N log to the seventh N. I'm not going to focus on that. For the rest of the talk I'm going to assume in our planar graph that shortest paths are unique. Okay. Okay. So we use some ingredients that come from the study of planar graph algorithms. So I'll start by giving you ingredients separately. They're interesting in their own right. At least I find them interesting in their own right. And then once we get through these ingredients I'll tell you what the algorithm is. It's quite simple once you've mastered these ingredients. Okay. So the four main ingredients, I hope some of you are already familiar with some of them. So planar duality. A specific type of min cut algorithm for planar graphs, which we will use. We're going to have to emulate the execution of this algorithm in order to beat order N squared to get order N poly log N for all the min ST-cuts. We use the fact that planar graphs have small ballot separators. And this notion of a dense distance graph which I'll explain and they depend on the planar graph separators. Okay. So planar duality. Now, my graphs are much nicer to draw on the screen. Everyone knows what a planar graph is, right? Okay. So here we have a planar graph. So N vertices M edges the number of edges on the order of number of vertices, planar graphs are sparse. Each of the regions here is called a face. So every planar graph has a dual graph, which is -- which you find by building a graph that has a vertex for every face of the original graph and an edge that connects faces that are adjacent. So you put a vertex in every face and you take every edge in the original graph and you turn it 90 degrees. That's the standard way to think of it. Okay. So in 1933, Whitney showed that simple cuts in planar graphs are equivalent to simple cycles by planar duality. If you have a cut in your original graph, a simple cut in your original graph, you get a simple cycle in your dual graph. So, for example, it's not very clear to see, but suppose that the shaded blue side is a simple cut, and I've got, look at the blue, the edges that go between the blue shaded part and the not shaded part in the original graph. So these blue edges. If you look at those edges and the dual. So if you take all those edges and turn them by 90 degrees, you get the green edges. And now let's clean this up a little bit. Oh, I didn't -- darn. If you look at the green edges, you can see that they form a simple cycle. So this is really nice, because it means that instead of looking for a cut in the graph, we can look for a cycle in a dual graph and minimum cycles are just composed of shortest paths. So we can just use shortest path computations to find a minimum cut. So in fact from now on you can forget about cuts and we're just going to be looking at cycles. Minimum cost separating cycles. Okay. So I mean stated formally you can say that the min ST-cut, if you look at the face corresponding to S and the face corresponding to T in the dual graph, okay. So there's a face corresponding to S. We'll call that face S star and there's a face corresponding to T. We'll call it T star. If we want to find the minimum cut, instead we find the minimum cost cycle that separates S from T. And by separates, we mean there's no way you can draw in this embedding a path from S star to T star that doesn't cross this green cycle. So instead of finding ST-cuts we're finding separating cycles. >>: Choose whatever I ->> Glencora Borradaile: Good question. So a planar graph has a dual. You find the dual by introducing a vertex for every face. And now if you take that dual graph that you get and do the same construction, you get your original graph back. >>: Uh-huh. Okay. >> Glencora Borradaile: So that's exactly what you get. So if you're looking at S, we're going to get a face that will have a vertex here, a vertex here, a vertex here and edges connecting them. That creates a face in the dual graph. And that's the face that you want. See, like that. Okay. So in 1983, Reif showed how to use this property to find a minimum cut. So instead of finding a minimum cut, he's going to look for a minimum cycle. Let's see how to do that. What I have drawn here is some face S star. These are the edges that bound the face S star and some other face T star with edges that bound it. And suppose that this green cycle is a minimum separating cycle. Okay. So you want to somehow find that green cycle. And I want to find this green cycle by finding shortest paths. So I want to somehow split this green cycle so it becomes shortest path. I want to cut it somewhere. If I cut this green cycle here and find shortest path from here from one side of this little cut to the other side of this cut and ensure that it goes around this and not around that as well, then that will be exactly the cycle that I want and it will be one shortest path computation, right? Okay. So how are we going to cut through that green cycle? Well, any guesses? What we can do is we can cut through it along the shortest path. Okay. It's a min cut. This minimum separating cycle should be shortest locally, right? Between here and here it should be shortest path, between here and here it should be shortest, right? So what I draw here I drew a shortest path from some vertex on the boundary of this face S star to some other vertex on the boundary of this face T star. And could it do this? I mean, could this shortest path like cross this green cycle multiple times? >>: You take shortcut along ->> Glencora Borradaile: Exactly, you could if shortest path were unique. But because these separating cycles are nonunique. But it does mean that there is a separating cycle that doesn't cross this red shortest path too many times. It can only cross it once. And exactly what you said, you just shortcut along the shortest path. So instead of finding this separating cycle, we'll look for this one. So if we could find, if we knew where this point was, should be able to find this separating cycle. So let me clean up this picture again. So let's say that the shortest path from some vertex bounding the face S star to some vertex bounding face T star is this red path here. And I said I don't want to find cycles that cross this red path. I want to make sure I go around it. I'm going to do something we always do in planar graphs. We get out our construction paper and our pair of scissors and we cut along our graph like this. So I just cut from this face S star to the face T star right along the middle of the edge very carefully and create this new face that joins S star and T star. Okay. So now I know that the minimum separating cycle is going to go from one of these vertices around here to one of these vertices. And I don't know which one of the vertices. So let's just find the shortest path for each of those vertices. So we want to find shortest paths from each of these vertices to their copy on the other side. And so there's one such cycle. So now if I did that, then I would get -- if I just did it naively for each of these vertices, that would take linear time using the linear time shortest path algorithm that Reif didn't know existed at the time but does now. And we'd have at most N vertices along this path. I would take order N squared time. But we can do better than that by recursing on each side of the graph. So the sum of the two graphs that you end up with have linear sides. So you just start with the middle vertex. Find the minimum separating cycle, and then repeat on both sides. So then you get -- you can do this by binary search. You end up with N log N time using the best known algorithm for shortest path and planar graphs. So you repeat the process. And you find all the cuts. And then you just take the minimum one of these -- sorry. You find all the cycles, take the minimum length cycle. That's your minimum separating cycle in your original graph. So it's very simple, right? And it had nothing to do with flows, which is how you usually find minimum cuts, minimum ST-cuts. Okay. So that was the first and second ingredient. We have planar duality. We use planar duality to simplify how we find min ST-cuts in planar graphs. So the third property are the fact you can decompose planar graphs very nicely. So this gray blob is my planar graph. And you can find a small number of vertices on the order of root N vertices. So not exactly root N but on the order of root N vertices that you can remove those vertices and you end up with two graphs. So the set of vertices is a vertex separator. Delete those vertices or duplicate them and cut the graph apart. And you end up with two sub graphs, the blue graph and the red graph, and each of those graphs is a planar graph, and it has at most two-thirds of the vertices of the original graph. It's a small number of vertices that separate the graph into roughly equal sized parts. So who hasn't seen this? That's a shy question to ask. So there's a few people. That's good. I like telling people new things. Okay. So the small balance separators are used a lot to design divide and conquer algorithms for planar graphs. The natural thing to do is to repeat this process. Well I have two smaller planar graphs. Let's find a separator in each of those parts and repeat, right? You repeat this until you end up with just these trivial planar graphs. It's one edge or however small you want it to be. And you stop. Okay. So this recursive decomposition has been used to solve lots of problems in planar graphs. Shortest path algorithms, et cetera. Okay. So a lot of them, they have different flavors. The particular flavor for those who are in the know is in the flavor of Fackcharoenphol, if you want to know those details. So we're going to say -- so whenever we take two, the two pieces, the red piece will -- this vertex will also belong to this red piece, this vertex will also belong to the blue piece. We're going to duplicate the vertices whenever separate the graph. We'll say that a face belongs to the graph if one of the edges on the boundary of that face is in one of the subgraphs. Okay. So we do this recursive decomposition. Like this. And you get a nice recursive tree and people who saw my talk on Friday have seen these pictures before. Okay. So the recursion tree has log N depth, right? Because in each step you divide the graph into roughly equal sized parts so you get a log N depth tree and we're going to stop when each of our graphs is exactly one piece. Sorry, one edge. So each of the graphs down here is just one single little edge. You can find this decomposition in N log N time. Okay. So that's small balance separators. So our third ingredient, before we get to the algorithm. This talk is a little bit longer than I expected. Okay. So Reif's algorithm for finding min cuts is really looking for shortest paths, right? So we need to somehow compute shortest paths in our graph. This is what we're going to find. We're not finding min cuts we're finding shortest paths. So in order to quickly find a min separating cycle, whenever we need to, we want to not recompute shortest paths every time. We want to somehow reuse computation that we've already done before. Okay. So these ideas on the next two slides are all from Fakcharoenphol Rao's paper. They give an order N log cubed N time algorithm to find shortest paths in planar graphs where you might have had negative edge lengths. They do the same thing; they want to precompute distances and use them over and over and over again. So the way we're going to do that is we're going to take our planar graph and focus on one separator in the planar graph and one piece. So this blue thing is a piece. And corresponding to this separator that we found. And there are about root N vertices around the boundary of this piece, which means that the number of distances across this piece is order N, right? For every pair of vertices on the boundary and the separator, they're order N distances inside. So we'll refer to all the internal distances of this piece. So we want to precompute all order N distances inside the piece between vertices on the boundary of the piece. Corresponding to the separator. So these kind of distances. I didn't draw the whole thing. This would be just a mess of black. Okay. So Fakcharoenphol Rao used this idea. They showed how to compute all of these distances, inside each piece between vertices on the separators that created the piece for every single piece in the whole recursive decomposition -- oops -- order N log squared N time. Sorry. They showed how to do it in order N log cubed N time. Phil Klein gave a nice algorithm for solving the following problem: You're given a planar graph and the boundary of the planar graph. So you just take one of the faces of the boundary. You can think of the boundary being the vertex separator, you want to find all the distances, all the distances from any vertex on that boundary to any vertex on the graph. He gives a data structure for this that takes N log N time to precompute. So using this, you can just do that for every level. Every level will take order N log N time since you have log N depth in your recursion tree, you get N log N squared time. So that's an easier way to see this result. Okay. So that gives us -- so the original planar graph got decomposed into these two pieces. We now have all the distances inside this piece and all the distances inside this piece which are really the distances outside this piece. We actually need the distances outside the piece for all the pieces in our graph as well. And it's easy at the first level. Right? The distances outside this piece are the distances inside this piece. But the distances outside this piece are the distances, are composed of distances inside this piece and distances outside this piece. So the way Fakcharoenphol Rao computed all the internal distances was by working up the recursion tree. Once you found all the internal distances you can start at the top and work your way down and find all the distances outside the piece as well. They showed how to do that -- so these are the kind of distances that I'm talking about. They showed how to do that in order N log cubed N time. And I think you can also -- you should be able to do it in order N log N squared time but this is not going to be a bottleneck. So we find all the external distances as well. So that's the last ingredient. What did we have? We had planar graphs have duals. Cuts correspond to cycles in the dual. So let's forget about cuts and the original graph will immediately go to the dual and we just want to find minimum separating cycles. Minimum separating cycles are composed of shortest paths. Since we want to find all these minimum separating cycles in our graph quickly, we don't want to keep recomputing shortest paths that we've already found. So we're going to use the recursive decomposition of our planar graph, precompute a whole bunch of distances. It's not going to be all the distances we need but it will be a lot of distances and hopefully we'll be able to put all this together and find what we need to find. All the minimum separating cycles. Okay. Okay. So now we're ready for the algorithm. And we've already forgotten what we're trying to solve. We need to find N minus 1 minimum separating cycles that nest. Each of those separating cycles should separate something new. Right? So what we do is we're going to run the Gomory-Hu algorithm except instead of finding cuts, we're finding cycles in the dual. But we're really just finding, running the Gomory-Hu algorithm in the dual finding minimum separating cycles. So we're finding cycles that separate faces, faces that haven't been separated before. That's the equivalent of cuts that haven't been cut apart before. How are we going to choose those faces? Well, we're going to use the recursive decomposition and we're going to work bottom up in the recursive decomposition tree. So we're going to at the bottom level we're going to separate all the faces that belong to a common piece and then we'll move up a level. We'll find all -- we'll separate all the faces that haven't been separated in the previous level that aren't separated in that common piece. I'll illustrate this to make it clear. We're going to use Reif's method for finding the minimum separating cycle. And we're going to emulate Reif's method. We aren't going to run it exactly as he did, because that would take too long. Every min cut would take order N log N time. We have to find N minus 1 min cuts. Too much time. We'll emulate his method using the precomputed distances that we've already found. Okay. So at the bottom-most level, each of our pieces, right, each of the graphs that we're working in, are very small. They consistent of a single edge. But we actually want -- and this single edge has two faces. It has a face on the left and a face on the right. And we want to find the minimum separating cycle that separates those two faces. But we don't want to just find it in this graph because that would be nonsense. That would just be this single edge. So you want to find the minimum separating cycle that separates these two faces in the entire graph. So you are always finding minimum separating cycles in the entire graph, and that's what takes time. So the bottom-most level we just have to separate two faces for each of these pieces, the two faces that are adjacent. Now, when we go up a level, we have a more complicated piece. So let's focus on that. When we go -- say we've computed, we've separated all the faces in these pieces and we're popping up a level, what do we need to do? So this is actually not that interesting. So this is just -- we have some set of separating cycles. You've seen this before, right? Sort of. We have some set of separating cycles and we want to add a new cycle, right? To our Gomory-Hu tree. That we're slowly building up. So what does that correspond to? That corresponds to adding that cycle corresponds to adding a new node in our Gomory-Hu tree that happens to be between the yellow cycle and the red cycle. You sort of insert it into the tree here. This is a badly placed slide. Okay. So now we're at some state in our algorithm and this bean-shaped object that's been perforated represents some piece at some point in our recursive decomposition. And that piece has two children pieces that's obtained by removing these vertices. So this is the vertex separator that separates this bean-shaped piece into two sub pieces. And recursively we know that any two faces that's inside, that's adjacent to some edge in this right child has been separated already. And any two faces that shares an edge in the left child has already also been separated. So what problem do we need to solve in this parent piece? Okay. We found some set of cycles already. And the cycles enter and exit the piece. We're finding the cycles in the entire graph, right? There's some global graph happening. So say this is a set of cycles that we've already found. What faces do we need to separate? Well, would we ever have to separate these two blue faces when we're solving this parent piece? >>: Convenience. >> Glencora Borradaile: Right. Exactly. These two faces are both in the left child. Right? So we must have already separated them. So these two faces -- this picture couldn't happen, right? Because there would be a cycle in our set of cycles that we found already that separates them. But we could have still have many pairs of faces that haven't been separated. So this is perfectly legal. Right? The blue faces are the faces that need to be separated. Okay. It's not that difficult, though, because we don't need to separate this face from this face. Because there's already a cycle separating them. And if we're emulating the Gomory-Hu algorithm we know we just have to ignore it. But we might have to separate this face from this face and this face from this face and this one from this one and that one from that one. But since we want to find cycles that nest with the cycles that we found already, we can just focus on the intersection of some region between two cycles or two or more cycles such as this piece. So, for example, this is a sub problem that I'm going to focus on. It's the region between two cycles that we've already found before. And we need to separate two faces in that region. So there could be many sub problems that you have to solve when you're focused on any piece in your recursive decomposition. You're not just solving one min ST cut computation. You might have to solve many. However, the region of the graph that you're solving that problem in is somehow disjoint -- they sum up to something linear in the size of the problem. So you can separate those problems. You can find this min separating cycle separately from this min separating cycle. Okay. So let's focus on that sub problem. And I'm going to simplify it, the picture of it. So here's a piece. The intersection of a piece with one of those sub problems. And here are the two faces that we need to separate, S and T. Or S star and T star if I was being consistent, which I'm not. Okay. So if we were going to use Reif's method we would find the shortest path from S to T and we would, for every vertex along the shortest path, we would find the minimum separating -- the minimum -- the shortest path from that vertex to itself that doesn't cross this red path. So you can imagine again cutting along this path and solving the problem. >>: There's one thing I'm confused about. So what is this cycle? Is it the same as in the previous slide. >> Glencora Borradaile: No, no. Okay. That's a good question. So this is a vertex separator. So this outer cycle represents the boundary vertices corresponding to this piece. I'm not drawing a very clear picture because it was a little bit more complicated in the previous picture. So you can imagine -- so the short answer -- the short answer should be yes. So imagine that this outer cycle is a separator that defines this piece. Separators can be a little bit more complicated than I'm drawing in this talk. And so we're going to ignore this separator and just focus on that outer separator. So the only vertices in the separator you really need to think about are the ones that are in this red sheeted region. And I'm going to simplify it by drawing it as a cycle, as a circle. >>: Internal divider. >> Glencora Borradaile: We ignore when we go up to the parent. >>: I see. >> Glencora Borradaile: Yes, for this argument ->>: But now ->> Glencora Borradaile: Yes, exactly. >>: So the black stuff comes from your recursion and the red stuff comes from the tree. >> Glencora Borradaile: Exactly. >>: How do you ensure that the cuts are fine and not crossing? You need to take these as single faces. >> Glencora Borradaile: Yes. Yes. >>: That's what you do. >> Glencora Borradaile: Yes. No. So the -- okay. So, no. Good question. The way we insure that we find cuts that don't cross is by assuming that shortest paths are unique. So shortest paths are unique, you can't find cycles that are crossing, but you can avoid this assumption easily. Okay. So this is a sub problem drawn much more simply now. So we have some piece defined by boundary vertices. And we need to separate S from T. We want to use Reif's method. So we find shortest path from S to T and for every vertex along the shortest path we want to find the minimum cost cycle that starts and ends at it. So we can do that. That's easy. Right? You just find -- we have all -- remember, we have all the distances outside the graph precomputed. So the cycle, if you just use Dijkstra's algorithm, you can find the shortest path in this graph defined by this piece, plus all the distances you've already found outside, there's only a linear number of those edges. So you just run Dijkstra's algorithm, right? You find that cycle and you recurse on both sides, and that would take order N log squared N time because now you're using Dijkstra's algorithm. So what's the problem with this algorithm? This seems easy, right? I could stop now. Is there any problem with the red path that I drew? You think that's the most general case? >>: It might go out. >> Glencora Borradaile: It might go out. This red path from face S to face T is not necessarily contained within this piece, in which case it's contained somewhere else. There's some vertex through which you need to find the shortest path that's in some other piece of your decomposition. You don't even know how to find it; you can't touch it, it would take too much time. You would be solving, instead of using the precomputed distances, you would have to access some information while outside. So that's the only technical contribution of this paper. No, I'm just joking. [chuckling] so we need to handle this case. So shortest path from S to T could leave the piece and come back in, it could leave and come back in many, many times, right? Okay. This sounds so bad. So for any vertex on this path inside the piece, it's okay. We can just find the shortest path using Dijkstra. We have to make sure that we don't use that blue edge. But we can just make sure that you can find those blue edges very quickly because the parts of this red path that leave this piece form a parentheses around the boundary. So you can easily determine if you're about to use that blue edge in Dijkstra's algorithm and just not use it. Set that distance to be infinity. So to find all the distances between any vertex on this red path. Inside the graph we can really just use normal Reif's standard algorithm using Dijkstra's method. Reif plus Dijkstra would give you order N log N squared time for any vertex on the inside. So we just need to find edges on the outside. So we can find all the cycles through vertices on the red path inside of the piece and log N squared N times. So now we need to find the shortest separating cycle that goes through that vertex all the way up there quickly. But there could be lots of those vertices. They don't belong to the piece. So we couldn't bound how many of those vertices we'd have to find cycles through. Because they don't belong to the piece. So recursively you wouldn't be getting anything. But we do know that any cycle that goes through a vertex on this red path outside the graph can only use one of these external distances. It can only use one of these edges that correspond to a distance on the outside of the graph. So we can find for every such edge E, we can find all those edges that cross the red path. And for each edge we could find the shortest path between its end points that doesn't cross this red path. Is that clear? >>: That can be [indiscernible]. >> Glencora Borradaile: How many could there be. >>: Still just N. >> Glencora Borradaile: Still just N. >>: Yes. >> Glencora Borradaile: Right. Okay. But we can compute all the shortest paths from this vertex to this vertex using only the modified distances. And I think I'm missing a detail that is used in Fakcharoenphol Rao's paper that I'm not illustrating here. But you can compute all such of these point-to-point distances in a total of N log N squared time. Now, to do this, we can't -- we're not going to use Dijkstra's algorithm on the inside of the piece. What we'll do is we'll recompute the internal distances in the graph where we cut open the graph along this red path. But that we can do in log N squared N time. That's where this comes in. So you just recompute the internal distances and combine the internal distances with external distances and you get all these cycles in log N squared N time. Okay. All right. So I'm just repeating myself here ad nauseam. Okay. So how do we get our final algorithm? I claim that this algorithm takes order N log to the fourth N time. We had to compute internal and external distances. Those all took less than this. So recursively we take order N log N squared time to emulate Reif's algorithm, Reif's technique for both the internal and external, the cycles that go through nodes in the shortest path that's inside the piece and outside the piece. We get log N factor for the depth. The planar separator decomposition tree. And there's a technical bit. So pieces -- when you do this recursive decomposition, your pieces are not necessarily nicely connected. So the shortest path that you use for Reif's technique could leave one part of the piece and reenter another part of the piece which case you have to somehow -- so a single piece could be composed of two bits in your graph and you might have to separate a face S on this side and a face T on this side so the shortest path might do this and you have to somehow find cycles through this node that separate it. But that cycle has can -- seems to have nothing to do with the pieces to handle that special case we need an extra log N factor time. I don't think it's the right answer. Okay. So as I say we assume that shortest paths are unique. We assume this so we know whenever we find a cycle, because we're finding them using these dense distances that we've precomputed. We want to make sure that the cycles we find don't cross each other. If shortest paths are unique, that's not a problem. If they're not unique, then you can either perturb all the weights of the edges in the graph enough, and with very high probability shortest paths will be unique. If you want to do it deterministically, it will take an extra -- the way we're doing it right now is taking an extra log cubed N time. That's probably overkill. So you could fix that if you were interested. So that's the result. And there are obvious questions that I'd like to answer. I don't like N log to the fourth N time or N log to the seventh N time. It's not the final answer -- I don't think it is. So you can improve the handling of nonunique shortest paths. And this idea for the disconnected pieces, I think you could get quite easily down to N log cubed N time and maybe N log N squared time wouldn't be such a surprise to me. N log N, if you could get N log N, I would probably say that's got to be the right answer and I would be really excited. Anytime I give a talk on planar graph algorithms someone asks, usually Eric Domain, can you do it in bounded genus graphs. It seems to be a lot more difficult, this problem. In a bounded genus graph, in a bounded genus graph, for those not in the know, planar graph you can draw on a sphere, that's a surface of genus 0. Surface of genus 1 is a donut. Surface of genus 2 has another handle on the surface and so on. If you can draw a graph on that surface, on a surface of surface genus G, such that no two edges cross then the graph has genus G, at most genus G. What does a minimum cut look like in that graph? Well, I mean it's some set of edges, right, bipartition of vertices. Bounded genus graphs also have a dual. You can do the same construction as you do for planar graphs and you'll get some other genus G graph. Can you find a minimum separating cycle in that graph instead of finding min cuts? So the question is: Is a min cut a min ST cut and a bounded genus graph equivalent to a simple cycle in the dual? >>: Probably not. >> Glencora Borradaile: I have the answer written there. The answer is no. I wish I had a donut. If you have this donut, and S is over here and T is over here, the cut could be edges on the two handles. Right? It's not necessarily a simple cycle. So that makes it quite a bit more difficult to solve the min cut problem. And there is an N log N time algorithm to find the min cut on a bounded genus graph. But it's not suitable for these techniques. Okay. Another question I have is, well, the best min cut algorithm for undirected planar graphs is an order N log N time algorithm and it's the algorithm that I showed you by Reif. And for a long time you could solve min cut faster in planar graphs than you could solve max flow. So max flow seemed to take a little bit longer for a long time. But now there's an N log N time max flow algorithm and the best min cut algorithm we also have is N log N time. Can you push min cut ->>: So you want the situation back to ->> Glencora Borradaile: Yes, exactly. It was much -- made much more sense then. If you like your computing a lot more and when you find a max flow. And it might not be true. Maybe you could show something that you can't, right? That would be interesting, too, that they'll take the same amount of time. That would be really interesting. And of course the big question is in general graphs, can you find this Gomory-Hu tree in time that beats N times the time for single min cut. You can when the graph is unweighted, but what about general graphs? Okay. And that's it. I'm happy to take questions. [applause]. >>: So can you say something about cactuses, also? [laughter]. >> Glencora Borradaile: They're prickly. So you want to find a representation for all global min cuts in a planar graph. >>: So could it be possible. >> Glencora Borradaile: I don't know. Not that I know of. I mean, someone might have said something about it. But I don't know. >>: [inaudible]. >> Glencora Borradaile: In general graphs. >>: Number of edges. >> Glencora Borradaile: But it's the same for planar graphs it's, if you can do linear the number of edges then you can do linear, they're sparse graphs. >>: Yes. >> Glencora Borradaile: Is it just -- it's just recursively using Carter's algorithm. >>: No, [indiscernible]. >> Glencora Borradaile: Oh, okay. Okay. Okay. Thanks. [applause]