=========================================================================== CSC 373H Lecture Summary for Week 10 Winter 2006 =========================================================================== Network flow examples: - Project selection: See section 7.11 in textbook. ------------------ Linear Programming ------------------ "linear program" = optimization problem that consists of: - "objective function": c_1 x_1 + c_2 x_2 + ... + c_n x_n c_i constants, x_i variables (all over real numbers) - "constraints": linear, i.e., of the form a_{i,1} x_1 + a_{i,2} x_2 + ... + a_{i,n} x_n <= / = / >= b_i for i = 1, 2, ..., m. - problem: find real values of x_i's that maximize/minimize objective function and satisfy all constraints. - "integer programming": all constants and variables are integers. NP-complete. - "0-1 integer programming": all variables are either 0 or 1. NP-complete. Examples: - "Political problem" example from "Introduction to Algorithms, 2nd ed." by Cormen et al., pp. 770-772. - Shortest paths: Given graph G=(V,E) with weights w(e) for all e in E, construct linear program with variables d_v for each v in V: maximize: d_t subject to: d_v <= d_u + w(u,v) for each (u,v) in E d_s = 0 Minimizing d_t doesn't work because it allows settings of d_v smaller than true distances (e.g., d_v = 0 for all v in V). Maximizing works because constraints force d_v to be no more than shortest distance and maximization forces d_v to be at least shortest distance, for all v.