Algorithm Analysis (CSC 301 2015F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Algorist]
Related Courses: [Walker (2014F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Overview
Make a matrix of all minimum-path lengths between two vertices.
Negative edge weights permitted, no negative cycles.
Build a series of matrices. Matrix k gives shortest paths involving only intermediate nodes numbered 1 .. k.
How do we build matrix k+1 from matrix k?
for (i = 1 to n)
for (j = 1 to n)
M(k+1)[i,j] = min(M(k)[i,k] + M(k)[k,j], M(k)[i,j])
What's the algorithm?
for (k = 1 to n)
for (i = 1 to n)
for (j = 1 to n)
M(k+1)[i,j] = min(M(k)[i,k] + M(k)[k,j], M(k)[i,j])
Why?
Treat the graph as a network. Edges are capacities.
Give a source and a target, find the maximum "flow" from the source to the target.
Find a path from source to target. (augmenting path) Find the smallest size of an edge on that path For each edge on that path Decrement the edge in the original graph Increment the corresponding edge in the flow graph
INCORRECT!