Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| courses:cs211:winter2018:journals:martineza:home [2018/04/02 14:23] – [Section 7.1: Maximum Flow] martineza | courses:cs211:winter2018:journals:martineza:home [2018/04/03 01:08] (current) – [Section 7.7: Extensions to Maximum Flow] martineza | ||
|---|---|---|---|
| Line 97: | Line 97: | ||
| - | ====Section 3.3: Implementing Graph Traversals==== | + | ====Section 3.3: Implementing Graph Traversals ==== |
| **SUMMARY: | **SUMMARY: | ||
| The book seeks to implement BFS and DFS in O(m+n) running time, where m represents edges and n represents nodes. A graph with n nodes and m edges can be represented by an nXn adjacency matrix, which allows us to check if there is an edge between 2 nodes in the graph. Adjacency lists are another way to represent represent a graph and are preferable to a matrix when edges are sparse; a list also only uses O(m+n) space, which is preferable to O(n< | The book seeks to implement BFS and DFS in O(m+n) running time, where m represents edges and n represents nodes. A graph with n nodes and m edges can be represented by an nXn adjacency matrix, which allows us to check if there is an edge between 2 nodes in the graph. Adjacency lists are another way to represent represent a graph and are preferable to a matrix when edges are sparse; a list also only uses O(m+n) space, which is preferable to O(n< | ||
| Line 388: | Line 388: | ||
| **REFLECTION: | **REFLECTION: | ||
| - | I give this section a 9/10. The concept of a residual graph just blew me away -- what other applications are these graphs good for? It's really interesting how the type of data structure you have makes a world of difference in the running time of your algorithm. The class lecture was good for introducing the material and then the chapter in the book went into a LOT of detail. I still don't really understand how it can be O(m*C) running time because doesn' | + | I give this section a 9/10. The concept of a residual graph just blew me away -- what other applications are these graphs good for? It's really interesting how the type of data structure you have makes a world of difference in the running time of your algorithm. The class lecture was good for introducing the material and then the chapter in the book went into a LOT of detail. I still don't really understand how it can be O(m*C) running time because doesn' |
| - | ====Section 7.2: ==== | + | ====Section 7.2: Minimum Cuts ==== |
| - | ====Section 7.5: ==== | + | **SUMMARY:** |
| + | We can prove that the Ford-Fulkerson Algorithm gives us the optimal solution by looking at cuts. A cut is when you divide the graph into 2 sets A and B so that the source is in A and the sink is in B -- the capacity of a cut is just the total of all capacities of edges that go from A to B. The total value of the flow from any cut in the s-t path is equal to the flow out of A minus the flow into A. For each graph, there exists a minimum cut that limits the overall maximum flow. The logic behind the correctness of the Ford-Fulkerson Algorithm depends heavily on the capacities of edges being integers -- if they are not integers, the running time of the algorithm might be much longer than O(m*C). However, the Max-Flow Min-Cut theorem holds even if the capacities were real numbers. | ||
| - | ====Section 7.7: ==== | ||
| + | **REFLECTION: | ||
| + | I'm giving this section a 5/10 for readability because it seems like they took some very common sense things and turned them into really complicated math proofs. It just makes sense that at some point in the graph you're going to have a bottleneck that limits the overall input. It could be at the very beginning if all the edges coming out of the source have the smallest total capacity of any cut in the graph or at the very end if all the edges going into the sink have that. Or it could be at any point in between. I would like more clarification of why real numbers could make it potentially a bad algorithm, since it seems highly likely that we would not only be working with integers in a real world implementation of this algorithm. | ||
| + | |||
| + | ====Section 7.5: Bipartite Matching==== | ||
| + | |||
| + | **SUMMARY: | ||
| + | In the Bipartite Matching Problem, we are trying to find the largest possible matching in graph G such that every edge in the set of edges has one end in set X and one end in set Y. We can compute this by turning the undirected graph into a directed graph where all edges have a capacity of 1. Then, we find the maximum flow over this new graph and this results in the largest matching in G. The overall running time of this (converting to directed graph and running the Ford-Fulkerson Algorithm) is O(n*m), which is the same as running BFS or DFS. Hall's Theorem states that if the maximum flow over the graph is less than n, there is no bipartite matching possible. | ||
| + | |||
| + | **REFLECTION: | ||
| + | I found this section very difficult to read 4/10, because they used symbols that I have never before, such as the upside down L. I really wish I knew math terminology because I feel like that would make reading this textbook much easier at times. One question I have is: when is Bipartite Matching useful? What real world applications does it relate to? We haven' | ||
| + | ====Section 7.7: Extensions to Maximum Flow==== | ||
| + | |||
| + | **SUMMARY: | ||
| + | Many problems can be solved in polynomial time because they can be reduced to problems of maximum flow. One such extension is meeting the demand of multiple sinks using the flow produced by multiple sources (eg. multiple factories shipping products to multiple stores). By manipulating the graph and adding a " | ||
| + | |||
| + | **REFLECTION: | ||
| + | I give this section a 7/10. It wasn't super-interesting but it also wasn't terribly complicated like the last couple of sections I've read. I'm interested to see these ideas explained in class -- I feel like some of these concepts would be more clear with step-by-step illustrations. The algorithms we looked at here are for seeing if there exists a way to solve the problem at hand, but can they actually say what the most efficient way is? Do companies actually use algorithms like this to ensure top efficiency in product delivery? | ||
