Unformatted Document Excerpt
Coursehero >>
Illinois >>
University of Illinois, Urbana Champaign >>
CS 473
Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
20: Algorithms
Lecture All-Pairs Shortest Paths
The tree which fills the arms grew from the tiniest sprout; the tower of nine storeys rose from a (small) heap of earth; the journey of a thousand li commenced with a single step. -- Lao-Tzu, Tao Te Ching, chapter 64 (6th century BC), translated by J. Legge (1891) And I would walk five hundred miles, And I would walk five hundred more, Just to be the man who walks a thousand miles To fall down at your door. -- The Proclaimers, "Five Hundred Miles (I'm Gonna Be)", Sunshine on Leith (2001) Almost there. . . Almost there. . . -- Red Leader [Drewe Henley], Star Wars (1977)
20
20.1
All-Pairs Shortest Paths
The Problem
In the previous lecture, we saw algorithms to find the shortest path from a source vertex s to a target vertex t in a directed graph. As it turns out, the best algorithms for this problem actually find the shortest path from s to every possible target (or from every possible source to t) by constructing a shortest path tree. The shortest path tree specifies two pieces of information for each node v in the graph: dist(v) is the length of the shortest path (if any) from s to v; pred(v) is the second-to-last vertex (if any) the shortest path (if any) from s to v. In this lecture, we want to generalize the shortest path problem even further. In the all pairs shortest path problem, we want to find the shortest path from every possible source to every possible destination. Specifically, for every pair of vertices u and v, we need to compute the following information: dist(u, v) is the length of the shortest path (if any) from u to v; pred(u, v) is the second-to-last vertex (if any) on the shortest path (if any) from u to v. For example, for any vertex v, we have dist(v, v) = 0 and pred(v, v) = NULL. If the shortest path from u to v is only one edge long, then dist(u, v) = w(u v) and pred(u, v) = u. If there is no shortest path from u to v--either because there's no path at all, or because there's a negative cycle--then dist(u, v) = and pred(v, v) = NULL. The output of our shortest path algorithms will be a pair of V V arrays encoding all V 2 distances and predecessors. Many maps include a distance matrix--to find the distance from (say) Champaign to (say) Columbus, you would look in the row labeled `Champaign' and the column labeled `Columbus'. In these notes, I'll focus almost exclusively on computing the distance array. The predecessor array, from which you would compute the actual shortest paths, can be computed with only minor additions to the algorithms I'll describe (hint, hint).
20.2
Lots of Single Sources
The obvious solution to the all-pairs shortest path problem is just to run a single-source shortest path algorithm V times, once for every possible source vertex! Specifically, to fill in the one-dimensional subarray dist[s, ], we invoke either Dijkstra's or Shimbel's algorithm starting at the source vertex s.
c Copyright 2010 Jeff Erickson. Released under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License (http://creativecommons.org/licenses/by-nc-sa/3.0/). Free distribution is strongly encouraged; commercial distribution is expressly forbidden. See http://www.cs.uiuc.edu/~jeffe/teaching/algorithms for the most recent revision.
1
Algorithms
Lecture 20: All-Pairs Shortest Paths
OBVIOUSAPSP(V, E, w): for every vertex s dist[s, ] SSSP(V, E, w, s)
The running time of this algorithm depends on which single-source shortest path algorithm we use. If we use Shimbel's algorithm, the overall running time is (V 2 E) = O(V 4 ). If all the edge weights are non-negative, we can use Dijkstra's algorithm instead, which decreases the running time to (V E + V 2 log V) = O(V 3 ). For graphs with negative edge weights, Dijkstra's algorithm can take exponential time, so we can't get this improvement directly.
20.3
Reweighting
One idea that occurs to most people is increasing the weights of all the edges by the same amount so that all the weights become positive, and then applying Dijkstra's algorithm. Unfortunately, this simple idea doesn't work. Different paths change by different amounts, which means the shortest paths in the reweighted graph may not be the same as in the original graph.
3 s 2 4 4 2 t
Increasing all the edge weights by 2 changes the shortest path s to t .
However, there is a more complicated method for reweighting the edges in a graph. Suppose each vertex v has some associated cost c(v), which might be positive, negative, or zero. We can define a new weight function w as follows: w (u v) = c(u) + w(u v) - c(v) To give some intuition, imagine that when we leave vertex u, we have to pay an exit tax of c(u), and when we enter v, we get c(v) as an entrance gift. Now it's not too hard to show that the shortest paths with the new weight function w are exactly the same as the shortest paths with the original weight function w. In fact, for any path u v from one vertex u to another vertex v, we have w (u v) = c(u) + w(u v) - c(v).
We pay c(u) in exit fees, plus the original weight of of the path, minus the c(v) entrance gift. At every intermediate vertex x on the path, we get c(x) as an entrance gift, but then immediately pay it back as an exit tax!
20.4
Johnson's Algorithm
Johnson's all-pairs shortest path algorithm finds a cost c(v) for each vertex, so that when the graph is reweighted, every edge has non-negative weight. Suppose the graph has a vertex s that has a path to every other vertex. Johnson's algorithm computes the shortest paths from s to every other vertex, using Shimbel's algorithm (which doesn't care if the edge weights are negative), and then sets c(v) dist(s, v), so the new weight of every edge is w (u v) = dist(s, u) + w(u v) - dist(s, v). 2
Algorithms
Lecture 20: All-Pairs Shortest Paths
Why are all these new weights non-negative? Because otherwise, Shimbel's algorithm wouldn't be finished! Recall that an edge u v is tense if dist(s, u) + w(u v) < dist(s, v), and that single-source shortest path algorithms eliminate all tense edges. The only exception is if the graph has a negative cycle, but then shortest paths aren't defined, and Johnson's algorithm simply aborts. But what if the graph doesn't have a vertex s that can reach everything? No matter where we start Shimbel's algorithm, some of those vertex costs will be infinite. Johnson's algorithm avoids this problem by adding a new vertex s to the graph, with zero-weight edges going from s to every other vertex, but no edges going back into s. This addition doesn't change the shortest paths between any other pair of vertices, because there are no paths into s. So here's Johnson's algorithm in all its glory.
JOHNSONAPSP(V, E, w) : create a new vertex s for every vertex v w(s v) 0 w(v s) dist[s, ] SHIMBEL(V, E, w, s) abort if SHIMBEL found a negative cycle for every edge (u, v) E w (u v) dist[s, u] + w(u v) - dist[s, v] for every vertex u dist[u, ] DIJKSTRA(V, E, w , u) for every vertex v dist[u, v] dist[u, v] - dist[s, u] + dist[s, v]
The algorithm spends (V ) time adding the artificial start vertex s, (V E) time running SHIMBEL, O(E) time reweighting the graph, and then (V E + V 2 log V ) running V passes of Dijkstra's algorithm. Thus, the overall running time is (V E + V 2 log V).
20.5
Dynamic Programming
There's a completely different solution to the all-pairs shortest path problem that uses dynamic programming instead of a single-source algorithm. For dense graphs where E = (V 2 ), the dynamic programming approach eventually leads to the same O(V 3 ) running time as Johnson's algorithm, but with a much simpler algorithm. In particular, the new algorithm avoids Dijkstra's algorithm, which gets its efficiency from Fibonacci heaps, which are rather easy to screw up in the implementation. In the rest of this lecture, I will assume that the input graph contains no negative cycles. As usual for dynamic programming algorithms, we first need to come up with a recursive formulation of the problem. Here is an "obvious" recursive definition for dist(u, v): dist(u, v) = 0 min dist(u, x) + w(x v)
x
if u = v otherwise
In other words, to find the shortest path from u to v, try all possible predecessors x, compute the shortest path from u to x, and then add the last edge u v. Unfortunately, this recurrence doesn't work! In order to compute dist(u, v), we first have to compute dist(u, x) for every other vertex x, but to compute any dist(u, x), we first need to compute dist(u, v). We're stuck in an infinite loop! To avoid this circular dependency, we need an additional parameter that decreases at each recursion, eventually reaching zero at the base case. One possibility is to include the number of edges in the 3
Algorithms
Lecture 20: All-Pairs Shortest Paths
shortest path as this third magic parameter. So let's define dist(u, v, k) to be the length of the shortest path from u to v that uses at most k edges. Since we know that the shortest path between any two vertices has at most V - 1 vertices, what we're really trying to compute is dist(u, v, V - 1). After a little thought, we get the following recurrence. 0 if u = v if k = 0 and u = v dist(u, v, k) = min dist(u, x, k - 1) + w(x v) otherwise
x
Just like last time, the recurrence tries all possible predecessors of v in the shortest path, but now the recursion actually bottoms out when k = 0. Now it's not difficult to turn this recurrence into a dynamic programming algorithm. Even before we write down the algorithm, though, we can tell that its running time will be (V 4 ) simply because recurrence has four variables--u, v, k, and x--each of which can take on V different values. Except for the base cases, the algorithm itself is just four nested for loops. To make the algorithm a little shorter, let's assume that w(v v) = 0 for every vertex v.
DYNAMICPROGRAMMINGAPSP(V, E, w): for all vertices u for all vertices v if u = v dist[u, v, 0] 0 else dist[u, v, 0] for k 1 to V - 1 for all vertices u for all vertices v dist[u, v, k] for all vertices x if dist[u, v, k] > dist[u, x, k - 1] + w(x v) dist[u, v, k] dist[u, x, k - 1] + w(x v)
In fact, this algorithm is almost the same as running Shimbel's algorithm once from each source vertex. The main difference is the innermost loop, which in Shimbel's algorithm would read "for all edges x v". This simple change improves the running time to (V 2 E), assuming the graph is stored in an adjacency list. Other differences are just as in the dynamic programming development of Shimbel's algorithm--we don't need the inner loop over vertices v, and we only need a two-dimensional table. After the kth iteration of the main loop in the following algorithm, the value of dist[u, v] lies between the true shortest path distance from u to v and the value dist[u, v, k] computed in the previous algorithm.
SHIMBELAPSP(V, E, w): for all vertices u for all vertices v if u = v dist[u, v] 0 else dist[u, v] for k 1 to V - 1 for all vertices u for all edges x v if dist[u, v] > dist[u, x] + w(x v) dist[u, v] dist[u, x] + w(x v)
4
Algorithms
Lecture 20: All-Pairs Shortest Paths
20.6
Divide and Conquer
But we can make a more significant improvement. The recurrence we just used broke the shortest path into a slightly shorter path and a single edge, by considering all predecessors. Instead, let's break it into two shorter paths at the middle vertex on the path. This idea gives us a different recurrence for dist(u, v, k). Once again, to simplify things, let's assume w(v v) = 0. dist(u, v, k) = w(u v) min dist(u, x, k/2) + dist(x, v, k/2)
x
if k = 1 otherwise
This recurrence only works when k is a power of two, since otherwise we might try to find the shortest path with a fractional number of edges! But that's not really a problem, since dist(u, v, 2 lg V ) gives us the overall shortest distance from u to v. Notice that we use the base case k = 1 instead of k = 0, since we can't use half an edge. Once again, a dynamic programming solution is straightforward. Even before we write down the algorithm, we can tell the running time is (V 3 log V)--we consider V possible values of u, v, and x, but only lg V possible values of k.
FASTDYNAMICPROGRAMMINGAPSP(V, E, w): for all vertices u for all vertices v dist[u, v, 0] w(u v) for i 1 to lg V k = 2i for all vertices u for all vertices v dist[u, v, i] for all vertices x if dist[u, v, i] > dist[u, x, i - 1] + dist[x, v, i - 1] dist[u, v, i] dist[u, x, i - 1] + dist[x, v, i - 1]
This algorithm is not the same as V invocations of any single-source algorithm; we can't replace the innermost loop over vertices with a loop over edges. However, we can remove the last dimension of the table, using dist[u, v] everywhere in place of dist[u, v, i], just as in Shimbel's algorithm, thereby reducing the space from O(V 3 ) to O(V 2 ).
FASTSHIMBELAPSP(V, E, w): for all vertices u for all vertices v dist[u, v] w(u v) for i 1 to lg V for all vertices u for all vertices v for all vertices x if dist[u, v] > dist[u, x] + dist[x, v] dist[u, v] dist[u, x] + dist[x, v]
20.7
Aside: `Funny' Matrix Multiplication
There is a very close connection observed (first by Shimbel, and later independently by Bellman) between computing shortest paths in a directed graph and computing powers of a square matrix. Compare the following algorithm for multiplying two n n matrices A and B with the inner loop of our first dynamic programming algorithm. (I've changed the variable names in the second algorithm slightly to make the similarity clearer.) 5
Algorithms
Lecture 20: All-Pairs Shortest Paths
MATRIXMULTIPLY(A, B): for i 1 to n for j 1 to n C[i, j] 0 for k 1 to n C[i, j] C[i, j] + A[i, k] B[k, j] APSPINNERLOOP: for all vertices u for all vertices v D [u, v] for all vertices x D [u, v] min D [u, v], D[u, x] + w[x, v]
The only difference between these two algorithms is that we use addition instead of multiplication and minimization instead of addition. For this reason, the shortest path inner loop is often referred to as `funny' matrix multiplication. DYNAMICPROGRAMMINGAPSP is the standard iterative algorithm for computing the (V - 1)th `funny power' of the weight matrix w. The first set of for loops sets up the `funny identity matrix', with zeros on the main diagonal and infinity everywhere else. Then each iteration of the second main for loop computes the next `funny power'. FASTDYNAMICPROGRAMMINGAPSP replaces this iterative method for computing powers with repeated squaring, exactly like we saw at the beginning of the semester. The fast algorithm is simplified slightly by the fact that unless there are negative cycles, every `funny power' after the V th is the same. There are faster methods for multiplying matrices, similar to Karatsuba's divide-and-conquer algorithm for multiplying integers. (Google for `Strassen's algorithm'.) Unfortunately, these algorithms us subtraction, and there's no `funny' equivalent of subtraction. (What's the inverse operation for min?) So at least for general graphs, there seems to be no way to speed up the inner loop of our dynamic programming algorithms. Fortunately, this isn't true. There is a beautiful randomized algorithm, due to Noga Alon, Zvi Galil, Oded Margalit*, and Moni Noar,1 that computes all-pairs shortest paths in undirected graphs in O(M (V ) log2 V ) expected time, where M (V ) is the time to multiply two V V integer matrices. A simplified version of this algorithm for unweighted graphs was discovered by Raimund Seidel.2
20.8
Floyd and Warshall's Algorithm
Our fast dynamic programming algorithm is still a factor of O(log V ) slower than Johnson's algorithm. A different formulation due to Floyd and Warshall removes this logarithmic factor. Their insight was to use a different third parameter in the recurrence. Number the vertices arbitrarily from 1 to V . For every pair of vertices u and v and every integer r, we define a path (u, v, r) as follows: (u, v, r) := the shortest path from u to v where every intermediate vertex (that is, every vertex except u and v) is numbered at most r.
N. Alon, Z. Galil, O. Margalit*, and M. Naor. Witnesses for Boolean matrix multiplication and for shortest paths. Proc. 33rd FOCS 417-426, 1992. See also N. Alon, Z. Galil, O. Margalit*. On the exponent of the all pairs shortest path problem. Journal of Computer and System Sciences 54(2):255262, 1997. 2 R. Seidel. On the all-pairs-shortest-path problem in unweighted undirected graphs. Journal of Computer and System Sciences, 51(3):400-403, 1995. This is one of the few algorithms papers where (in the conference version at least) the algorithm is completely described and analyzed in the abstract of the paper.
1
6
Algorithms
Lecture 20: All-Pairs Shortest Paths
If r = 0, we aren't allowed to use any intermediate vertices, so (u, v, 0) is just the edge (if any) from u to v. If r > 0, then either (u, v, r) goes through the vertex numbered r, or it doesn't. If (u, v, r) does contain vertex r, it splits into a subpath from u to r and a subpath from r to v, where every intermediate vertex in these two subpaths is numbered at most r - 1. Moreover, the subpaths are as short as possible with this restriction, so they must be (u, r, r - 1) and (r, v, r - 1). On the other hand, if (u, v, r) does not go through vertex r, then every intermediate vertex in (u, v, r) is numbered at most r - 1; since (u, v, r) must be the shortest such path, we have (u, v, r) = (u, v, r - 1).
u
intermediate nodes r
v
=
intermediate nodes r-1
u
-- int no erm de ed s iat r-1 e
or -- r
v
e iat ed rm r-1 e int des no
Recursive structure of the restricted shortest path (u, v, r).
This recursive structure implies the following recurrence for the length of (u, v, r), which we will denote by dist(u, v, r): dist(u, v, r) = w(u v) min dist(u, v, r - 1), dist(u, r, r - 1) + dist(r, v, r - 1) if r = 0 otherwise
We need to compute the shortest path distance from u to v with no restrictions, which is just dist(u, v, V ). Once again, we should immediately see that a dynamic programming algorithm will implement this recurrence in (V 3 ) time.
FLOYDWARSHALL(V, E, w): for all vertices u for all vertices v dist[u, v, 0] w(u v) for r 1 to V for all vertices u for all vertices v if dist[u, v, r - 1] < dist[u, r, r - 1] + dist[r, v, r - 1] dist[u, v, r] dist[u, v, r - 1] else dist[u, v, r] dist[u, r, r - 1] + dist[r, v, r - 1]
Just like our earlier algorithms, we can simplify the algorithm by removing the third dimension of the memoization table. Also, because the vertex numbering was chosen arbitrary, so there's no reason to refer to it explicitly in the pseudocode.
FLOYDWARSHALL2(V, E, w): for all vertices u for all vertices v dist[u, v] w(u v) for all vertices r for all vertices u for all vertices v if dist[u, v] > dist[u, r] + dist[r, v] dist[u, v] dist[u, r] + dist[r, v]
Now compare this algorithm with FASTSHIMBELAPSP. Instead of O(log V ) passes through all triples of vertices, FLOYDWARSHALL2 only requires a single pass, but only because it uses a different nesting order for the three for-loops! 7
Algorithms
Lecture 20: All-Pairs Shortest Paths
Exercises
1. Let G = (V, E) be a directed graph with weighted edges; edge weights could be positive, negative, or zero. (a) How could we delete some node v from this graph, without changing the shortest-path distance between any other pair of nodes? Describe an algorithm that constructs a directed graph G = (V , E ) with weighted edges, where V = V \ {v}, and the shortest-path distance between any two nodes in H is equal to the shortest-path distance between the same two nodes in G, in O(V 2 ) time. (b) Now suppose we have already computed all shortest-path distances in G . Describe an algorithm to compute the shortest-path distances from v to every other node, and from every other node to v, in the original graph G, in O(V 2 ) time. (c) Combine parts (a) and (b) into another all-pairs shortest path algorithm that runs in O(V 3 ) time. (The resulting algorithm is not the same as Floyd-Warshall!) 2. All of the algorithms discussed in this lecture fail if the graph contains a negative cycle. Johnson's algorithm detects the negative cycle in the initialization phase (via Shimbel's algorithm) and aborts; the dynamic programming algorithms just return incorrect results. However, all of these algorithms can be modified to return correct shortest-path distances, even in the presence of negative cycles. Specifically, if there is a path from vertex u to a negative cycle and a path from that negative cycle to vertex v, the algorithm should report that dist[u, v] = -. If there is no directed path from u to v, the algorithm should return dist[u, v] = . Otherwise, dist[u, v] should equal the length of the shortest directed path from u to v. (a) Describe how to modify Johnson's algorithm to return the correct shortest-path distances, even if the graph has negative cycles. (b) Describe how to modify the Floyd-Warshall algorithm (FLOYDWARSHALL2) to return the correct shortest-path distances, even if the graph has negative cycles. 3. All of the shortest-path algorithms described in this note can also be modified to return an explicit description of some negative cycle, instead of simply reporting that a negative cycle exists. (a) Describe how to modify Johnson's algorithm to return either the matrix of shortest-path distances or a negative cycle. (b) Describe how to modify the Floyd-Warshall algorithm (FLOYDWARSHALL2) to return either the matrix of shortest-path distances or a negative cycle. If the graph contains more than one negative cycle, your algorithms may choose one arbitrarily.
8
Algorithms
Lecture 20: All-Pairs Shortest Paths
4. Let G = (V, E) be a directed graph with weighted edges; edge weights could be positive, negative, or zero. Suppose the vertices of G are partitioned into k disjoint subsets V1 , V2 , . . . , Vk ; that is, every vertex of G belongs to exactly one subset Vi . For each i and j, let (i, j) denote the minimum shortest-path distance between vertices in Vi and vertices in Vj : (i, j) = min dist(u, v) u Vi and v Vj . Describe an algorithm to compute (i, j) for all i and j in time O(V 2 + kE log E). 5. Recall3 that a deterministic finite automaton (DFA) is formally defined as a tuple M = (, Q, q0 , F, ), where the finite set is the input alphabet, the finite set Q is the set of states, q0 Q is the start state, F Q is the set of final (accepting) states, and : Q Q is the transition function. Equivalently, a DFA is a directed (multi-)graph with labeled edges, such that each symbol in is the label of exactly one edge leaving any vertex. There is a special `start' vertex q0 , and a subset of the vertices are marked as `accepting states'. Any string in describes a unique walk starting at q0 ; a string in is accepted by M if this walk ends at a vertex in F . Stephen Kleene4 proved that the language accepted by any DFA is identical to the language described by some regular expression. This problem asks you to develop a variant of the FloydWarshall all-pairs shortest path algorithm that computes a regular expression that is equivalent to the language accepted by a given DFA. Suppose the input DFA M has n states, numbered from 1 to n, where (without loss of generality) the start state is state 1. Let L(i, j, r) denote the set of all words that describe walks in M from state i to state j, where every intermediate state lies in the subset {1, 2, . . . , r}; thus, the language accepted by the DFA is exactly L(1, q, n).
qF
Let R(i, j, r) be a regular expression that describes the language L(i, j, r). (a) What is the regular expression R(i, j, 0)? (b) Write a recurrence for the regular expression R(i, j, r) in terms of regular expressions of the form R(i , j , r - 1). (c) Describe a polynomial-time algorithm to compute R(i, j, n) for all states i and j. (Assume that you can concatenate two regular expressions in O(1) time.) 6. Let G = (V, E) be an undirected, unweighted, connected, n-vertex graph, represented by the adjacency matrix A[1 .. n, 1 .. n]. In this problem, we will derive Seidel's sub-cubic algorithm to compute the n n matrix D[1 .. n, 1 .. n] of shortest-path distances using fast matrix multiplication. Assume that we have a subroutine MATRIXMULTIPLY that multiplies two n n matrices in (n ) time, for some unknown constant 2.5
Automata theory is a prerequisite for the undergraduate algorithms class at UIUC. Pronounced `clay knee', not `clean' or `clean-ee' or `clay-nuh' or `dimaggio'. 5 The matrix multiplication algorithm you already know runs in (n3 ) time, but this is not the fastest algorithm known. The current record is 2.376, due to Don Coppersmith and Shmuel Winograd. Determining the smallest possible value of is a long-standing open problem; many people believe there is an undiscovered O(n2 )-time algorithm for matrix multiplication.
4 3
9
Algorithms
Lecture 20: All-Pairs Shortest Paths
(a) Let G 2 denote the graph with the same vertices as G, where two vertices are connected by a edge if and only if they are connected by a path of length at most 2 in G. Describe an algorithm to compute the adjacency matrix of G 2 using a single call to MATRIXMULTIPLY and O(n2 ) additional time. (b) Suppose we discover that G 2 is a complete graph. Describe an algorithm to compute the matrix D of shortest path distances in O(n2 ) additional time. (c) Let D2 denote the (recursively computed) matrix of shortest-path distances in G 2 . Prove that the shortest-path distance from node i to node j is either 2 D2 [i, j] or 2 D2 [i, j] - 1. (d) Suppose G 2 is not a complete graph. Let X = D2 A, and let deg(i) denote the degree of vertex i in the original graph G. Prove that the shortest-path distance from node i to node j is 2 D2 [i, j] if and only if X [i, j] D2 [i, j] deg(i). (e) Describe an algorithm to compute the matrix of shortest-path distances in G in O(n log n) time.
c Copyright 2010 Jeff Erickson. Released under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License (http://creativecommons.org/licenses/by-nc-sa/3.0/). Free distribution is strongly encouraged; commercial distribution is expressly forbidden. See http://www.cs.uiuc.edu/~jeffe/teaching/algorithms for the most recent revision.
10
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more.
Course Hero has millions of course specific materials providing students with the best way to expand
their education.
Below is a small sample set of documents:
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 21: Maximum Flows and Minimum Cuts [Fa'10]Col. Hogan: One of these wires disconnects the fuse, the other one fires the bomb. Which one would you cut, Shultz? Sgt. Schultz: Don't ask me, this is a decision for an officer. Col. Hogan: Al
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 22: Max-Flow Algorithms [Fa'10]A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it. - The First Law of Mentat, in Frank Herbert's Dune (1965) There's a diff
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 23: Applications of Maximum Flow [Fa'10]For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly sm
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 18: Extensions of Maximum Flow [Fa'10]"Who are you?" said Lunkwill, rising angrily from his seat. "What do you want?" "I am Majikthise!" announced the older one. "And I demand that I am Vroomfondel!" shouted the younger one. Majikthise
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 25: Linear Programming [Fa '10]The greatest flood has the soonest ebb; the sorest tempest the most sudden calm; the hottest love the coldest end; and from the deepest desire oftentimes ensues the deadliest hate. - Socrates Th' extremes
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 25: Linear Programming [Fa '10]The greatest flood has the soonest ebb; the sorest tempest the most sudden calm; the hottest love the coldest end; and from the deepest desire oftentimes ensues the deadliest hate. - Socrates Th' extremes
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 26: Linear Programming Algorithms [Fa'10]Simplicibus itaque verbis gaudet Mathematica Veritas, cum etiam per se simplex sit Veritatis oratio. [And thus Mathematical Truth prefers simple words, because the language of Truth is itself si
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 27: Lower Bounds [Sp'10]It was a Game called Yes and No, where Scrooge's nephew had to think of something, and the rest must find out what; he only answering to their questions yes or no, as the case was. The brisk fire of questioning
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 28: Adversary Arguments [Sp'10]An adversary means opposition and competition, but not having an adversary means grief and loneliness. - Zhuangzi (Chuang-tsu) c. 300 BC It is possible that the operator could be hit by an asteroid and yo
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 29: NP-Hard Problems [Fa'10]The wonderful thing about standards is that there are so many of them to choose from. - Real Admiral Grace Murray Hopper If a problem has no solution, it may not be a problem, but a fact - not to be solved,
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsLecture 30: Approximation Algorithms [Fa'10]Le mieux est l'ennemi du bien. [The best is the enemy of the good.] - Voltaire, La Bgueule (1772) Who shall forbid a wise skepticism, seeing that there is no practical question on which any thing mor
University of Illinois, Urbana Champaign - CS - 473
Appendix I: Proof by Induction [Fa10]AlgorithmsJeder Genieende meint, dem Baume habe es an der Frucht gelegen;aber ihm lag am Samen.[Everyone who enjoys thinks that the fundamental thing about trees is the fruit,but in fact it is the seed.] Friedric
University of Illinois, Urbana Champaign - CS - 473
Appendix II: Solving Recurrences [Fa10]AlgorithmsChange is certain. Peace is followed by disturbances; departure of evil men by theirreturn. Such recurrences should not constitute occasions for sadness but realities forawareness, so that one may be ha
University of Illinois, Urbana Champaign - CS - 473
AlgorithmsDepartment of Computer ScienceUniversity of Illinois at Urbana-ChampaignInstructor: Jeff EricksonTeaching Assistants: Spring 1999: Mitch Harris and Shripad Thite Summer 1999 (IMCS): Mitch Harris Summer 2000 (IMCS): Mitch Harris Fall 2000
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 0, due August 31, 2000 at the beginning of className: Net ID:Alias:Neatly print your name (rst name rst, with no comma), your network ID, and a short alias into the boxes above. Do not sign your name
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 0, due August 31, 2000 at the beginning of className: Net ID:Alias:Neatly print your name (rst name rst, with no comma), your network ID, and a short alias into the boxes above. Do not sign your name
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2002Homework 0, due September 5, 2002 at the beginning of className: Net ID:Alias:UGNeatly print your name (rst name rst, with no comma), your network ID, and an alias of your choice into the boxes above. Circle
University of Illinois, Urbana Champaign - CS - 473
CS 473G: Combinatorial Algorithms, Fall 2005Homework 0Due Thursday, September 1, 2005, at the beginning of class (12:30pm CDT)Name:Net ID:Alias:I understand the Homework Instructions and FAQ. Neatly print your full name, your NetID, and an alias of
University of Illinois, Urbana Champaign - CS - 473
CS 473U: Undergraduate Algorithms, Fall 2006Homework 0Due Friday, September 1, 2006 at noon in 3229 Siebel CenterName:Net ID:Alias:I understand the Homework Instructions and FAQ. Neatly print your full name, your NetID, and an alias of your choice
University of Illinois, Urbana Champaign - CS - 473
CS 573: Graduate Algorithms, Fall 2008Homework 0Due in class at 12:30pm, Wednesday, September 3, 2008Name:Net ID:Alias:I understand the course policies. Each student must submit their own solutions for this homework. For all future homeworks,group
University of Illinois, Urbana Champaign - CS - 473
CS 573Homework 0 (due September 1, 2010)Fall 2010CS 573: Graduate Algorithms, Fall 2010Homework 0Due Wednesday, September 1, 2010 in class This homework tests your familiarity with prerequisite material (http:/www.cs.uiuc.edu/class/fa10/cs573/stuff
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Spring 1999Final Exam (May 7, 1999)Name: Net ID:Alias:This is a closed-book, closed-notes exam!If you brought anything with you besides writing instruments and your two 8 1 11 cheat sheets, please leave it at the fro
University of Illinois, Urbana Champaign - CS - 473
CS473ugHead Banging Session #39/19/06 - 9/21/061. Championship Showdown What excitement! The Champaign Spinners and the Urbana Dreamweavers have advanced to meet each other in the World Series of Basketweaving! The World Champions will be decided by a
University of Illinois, Urbana Champaign - CS - 473
CS473ugHead Banging Session #510/03/06 - 10/05/061. Simulating Queues with Stacks A queue is a rst-in-rst-out data structure. It supports two operations push and pop. Push adds a new item to the back of the queue, while pop removes the rst item from th
University of Illinois, Urbana Champaign - CS - 473
CS473ugHead Banging Session #810/24/06 - 10/26/061. Alien Abduction Mulder and Scully have computed, for every road in the United States, the exact probability that someone driving on that road wont be abducted by aliens. Agent Mulder needs to drive fr
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 0, due August 31, 2000 at the beginning of className: Net ID:Alias:Neatly print your name (rst name rst, with no comma), your network ID, and a short alias into the boxes above. Do not sign your name
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 0 (due 1/26/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/ cs373 Homework 0 (due January 26, 1999 by the beginning of class)Name: Net ID:Alias:Neatly print your name (rst name rst, with no c
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 1 (due September 12, 2000 at midnight)Name: Net ID: Name: Net ID: Name: Net ID:Alias:U 3/4 1Alias:U 3/4 1Alias:U 3/4 1Starting with Homework 1, homeworks may be done in teams of up to three peop
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 1 (due 2/9/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/~cs373 Homework 1 (due February 9, 1999 by noon)Name: Net ID:Alias:Everyone must do the problems marked . Problems marked are for 1-u
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 2 (due September 28, 2000 at midnight)Name: Net ID: Name: Net ID: Name: Net ID:Alias:U 3/4 1Alias:U 3/4 1Alias:U 3/4 1Starting with Homework 1, homeworks may be done in teams of up to three peop
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 2 (due 2/18/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/~cs373 Homework 2 (due Thu. Feb. 18, 1999 by noon)Name: Net ID:Alias:Everyone must do the problems marked . Problems marked are for
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 3 (due October 17, 2000 at midnight)Name: Net ID: Name: Net ID: Name: Net ID:Alias:U 3/4 1Alias:U 3/4 1Alias:U 3/4 1Starting with Homework 1, homeworks may be done in teams of up to three people
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 3 (due 3/11/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/~cs373 Homework 3 (due Thu. Mar. 11, 1999 by noon)Name: Net ID:Alias:Everyone must do the problems marked . Problems marked are for
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Fall 2000Homework 4 (due October 26, 2000 at midnight)Name: Net ID: Name: Net ID: Name: Net ID:Alias:U 3/4 1Alias:U 3/4 1Alias:U 3/4 1Homeworks may be done in teams of up to three people. Each team turns in just
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 4 (due 4/1/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/~cs373 Homework 4 (due Thu. Apr. 1, 1999 by noon)Name: Net ID:Alias:Everyone must do the problems marked . Problems marked are for 1-
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 5 (due 4/22/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/~cs373 Homework 5 (due Thu. Apr. 22, 1999 by noon)Name: Net ID:Alias:Everyone must do the problems marked . Problems marked are for
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Spring 1999Midterm 1 (February 23, 1999)Name: Net ID:Alias:This is a closed-book, closed-notes exam!If you brought anything with you besides writing instruments and your 8 1 11 cheat sheet, please leave it at the fro
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Spring 1999Midterm 2 (April 6, 1999)Name: Net ID:Alias:This is a closed-book, closed-notes exam!If you brought anything with you besides writing instruments and your 8 1 11 cheat sheet, please leave it at the front o
University of Illinois, Urbana Champaign - CS - 473
CS 373: Combinatorial Algorithms, Spring 2001Homework 0, due January 23, 2001 at the beginning of className: Net ID:Alias:Neatly print your name (rst name rst, with no comma), your network ID, and a short alias into the boxes above. Do not sign your n
University of Illinois, Urbana Champaign - CS - 473
CS 373U: Combinatorial Algorithms, Spring 2004Homework 0Due January 28, 2004 at noonName:Net ID:Alias:I understand the Homework Instructions and FAQ. Neatly print your full name, your NetID, and an alias of your choice in the boxes above.Grades wi
University of Illinois, Urbana Champaign - CS - 473
CS 473G: Graduate Algorithms, Spring 2007Homework 0Due in class at 11:00am, Tuesday, January 30, 2007Name:Net ID:Alias:I understand the Course Policies. Neatly print your full name, your NetID, and an alias of your choice in the boxes above, andst
University of Illinois, Urbana Champaign - CS - 473
CS 473Homework 0 (due January 27, 2009)Spring 2009CS 473: Undergraduate Algorithms, Spring 2009Homework 0Due in class at 11:00am, Tuesday, January 27, 2009 This homework tests your familiarity with prerequisite materialbig-Oh notation, elementaryal
University of Illinois, Urbana Champaign - CS - 473
CS 473Homework 0 (due January 26, 2009)Spring 2010CS 473: Undergraduate Algorithms, Spring 2010Homework 0Due Tuesday, January 26, 2009 in class This homework tests your familiarity with prerequisite materialbig-Oh notation, elementaryalgorithms and
University of Illinois, Urbana Champaign - CS - 473
CS 373Homework 0 (due 1/26/99)Spring 1999CS 373: Combinatorial Algorithms, Spring 1999http:/www-courses.cs.uiuc.edu/ cs373 Homework 0 (due January 26, 1999 by the beginning of class)Name: Net ID:Alias:Neatly print your name (rst name rst, with no c
Tulane - GEOL - 212
2 Component Phase DiagramsEENS 2110MineralogyTulane UniversityProf. Stephen A. NelsonTWO COMPONENT (BINARY) PHASE DIAGRAMSThis document last updated on 07-Feb-2011Experimental Determination of 2-Component Phase DiagramsAs an example, we're going t
Tulane - GEOL - 212
Contact MetamorphismEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityContact MetamorphismThis document last updated on 30-Mar-2011As discussed previously, contact metamorphism occurs as a result of a high geothermalgradient produced local
Tulane - GEOL - 212
General Classification of Igneous RocksEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityGeneral Classification of Igneous RocksThis document last updated on 11-Jan-2011Classification of igneous rocks is one of the most confusing aspects of
Tulane - GEOL - 212
Magmatic DifferentiationEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityMagmatic DifferentiationThis document last updated on 23-Jan-2011Chemical Variation in Rock SuitesSoon after geologists began doing chemical analyses of igneous rock
Tulane - GEOL - 212
Metamorphic Mineral AssemblagesEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityMetamorphic Mineral AssemblagesThis document last updated on 21-Mar-2011The mineral assemblages that occur in metamorphic rocks depend on four factors:The bul
Tulane - GEOL - 212
Metamorphic ReactionsEENS 212PetrologyProf. Stephen A. NelsonTulane UniversityMetamorphic Reactions, Isograds, and Reaction MechanismsThis document last updated on 22-Mar-2011Types of Metamorphic ReactionsChemical reactions that take place during
Tulane - GEOL - 212
Metamorphic TexturesEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityMetamorphic Rock TexturesThis document last updated on 10-Mar-2011Metamorphic rocks exhibit a variety of textures. These can range from textures similar to theoriginal p
Tulane - GEOL - 212
Regional MetamorphismEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityRegional MetamorphismThis document last updated on 31-Mar-2011Regional metamorphism is metamorphism that occurs over broad areas of the crust. Mostregionally metamorpho
Tulane - GEOL - 212
Textures of Igneous RocksEENS 212 Prof. Stephen A. NelsonPetrology Tulane UniversityTextures of Igneous RocksThis document last updated on 12-Feb-2004Introduction to Igneous Rocks An igneous rock is any crystalline or glassy rock that forms from cool
Tulane - GEOL - 212
Thermodynamics and MetamorphismEENS 212Prof. Stephen A. NelsonThermodynamics and MetamorphismPetrologyTulane UniversityThis document last updated on 18-Mar-2010Equilibrium and ThermodynamicsAlthough the stability relationships between various phas
Tulane - GEOL - 212
Triangular Plots in Metamorphic PetrologyEENS 212Prof. Stephen A. NelsonTriangular Plots in Metamorphic PetrologyPetrologyTulane UniversityThis document last updated on 15-Mar-2010Like igneous rocks, most metamorphic rocks are composed of 9 or more
Tulane - EENS - 212
Igneous Rocks of Contintental LithosphereEENS 2120PetrologyProf. Stephen A. NelsonIgneous Rocks of the Continental LithosphereThis document last updated on 15-Feb-2011IntroductionA wide variety of igneous rocks occur in the continental lithosphere,
Tulane - EENS - 212
Convergent MarginsEENS 2120Prof. Stephen A. NelsonPetrologyTulane UniversityIgneous Rocks of the Convergent MarginsThis document last updated on 08-Feb-2011The convergent plate margins are the most intense areas of active magmatism above sea level
Tulane - EENS - 212
Earth's Interior & Formation of MagmasEENS 2120PetrologyTulane UniversityProf. Stephen A. NelsonStructure of the Earth and the Origin of MagmasThis document last updated on 17-Jan-2012Magmas do not form everywhere beneath the surface of the Earth.
Tulane - EENS - 212
Introduction & Textures & Structures of Igneous RocksEENS 2120PetrologyProf. Stephen A. NelsonIntroduction & Textures & Structures of Igneous RocksThis document last updated on 10-Jan-2011Petrology & PetrographyPetrology - The branch of geology dea
Tulane - EENS - 212
Ocean BasinsEENS 2120PetrologyProf. Stephen A. NelsonIgneous Rocks of the Ocean BasinsThis document last updated on 03-Feb-2011The Ocean BasinsThe ocean basins cover the largest area of the Earth's surface. Because of plate tectonics,however, most
Tulane - EENS - 212
Radiometric DatingEENS 2120Tulane UniversityPetrologyProf. Stephen A. NelsonRadiometric DatingThis document last updated on 12-Apr-2011Prior to 1905 the best and most accepted age of the Earth was that proposed by Lord Kelvinbased on the amount of