04.09.2013 Views

Algorithm Design

Algorithm Design

Algorithm Design

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

438<br />

Chapter 7 Network Flow<br />

Figure 7.30 The set of nodes corresponding to a single pixel i in Exercise 36 (shown<br />

together with the source s and sink t).<br />

37.<br />

M<br />

k_ 0. Thus ce can be negative for edges e that have<br />

at least one end equal to either s or t. Give a pol~;nomial-time algorithm<br />

to find an s-t cut of minimum value in such a graph. (Despite the new<br />

nonnegativity.requirements, we still define the value of an s-t cut (A, B)<br />

to be the sum of the capacities of all edges e for which the taft of e is in<br />

A and the head of e is in B.)<br />

You’re working with a large database of employee records. For the purposes<br />

of this question, we’ll picture the database as a two-dimensional<br />

table T with a set R of rn rows and a set C of n columns; the rows correspond<br />

to individual employees, and the columns correspond to different<br />

attributes.<br />

To take a simple example, we may have four columns labeled<br />

name, phone number, start date, manager’s name<br />

and a table with five employees as shown here.<br />

Alanis 3-4563 6/13/95 Chelsea<br />

Chelsea 3-2341 1/20/93 Lou<br />

Elrond 3-2345 12/19/01 Chelsea<br />

Hal 3-9000 1/12/97 Chelsea<br />

Raj 3-3453 7/1/96 Chelsea<br />

Given a subset S of the columns, we can obtain a new, smaller table<br />

by keeping only the entries that involve columns from S. We will call this<br />

new table the projection of T onto S, and denote it by T[$]. For example,<br />

if S = {name, start date}, then the projection T[$] would be the table<br />

consisting of just the first and third columns.<br />

There’s a different operation on tables that is also useful, which is<br />

to permute the columns. Given a permutation p of the columns, we can<br />

obtain a new table of the same size as T by simply reordering the columns<br />

according to p. We will call this new table the permutation of T by p, and<br />

denote it by Tp.<br />

All of this comes into play for your particular application, as follows.<br />

S~ that you’re<br />

439

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!