april 12
iterative improvement
simplex
Problem is to find an extremum of a number of linear constraints.
Method is to look along vertices, looking for an improvement.
Understanding this one takes a fair amount of linear algebra;
I'm not going to emphasize it.
flow
source/sink; can be framed in a way similar to simplex
but also allows a quicker solution.
bipartite matching
Pairing elements from two sets.
Algorithm proceeds by
finding a better match than current one by looking
for zig-zags that start and end on an empty vertex.
stable marriage
Pairing people in a way that gives them
a stable "fit": any two people who leave
their mate and join won't both find a better match.
Text describes an algorithm that can always
find a stable match ... but also tends to
favor one gender over the other.
Variations: college admissions and other many-to-one
situations.
Limitations
lower bounds
- notion of "trivial lower bound" = size of input + size of output
- information content of output, e.g. log_2(n) for guessing game
- "adversary" bound: working against someone who chooses worst branch
- reducing to another, better understood problem
decision trees
- harder version of the fake coin problem
P, NP, NP-complete
P
Problems in set {P}
are decision problems (yes/no output)
whose worst case is O(polynomial(n));
they're also called "tractable" problems.
Those not in P are called "intractable".
NP
NP is a more confusing definition.
It does *not* mean "not polynomial"; a common confusion.
Instead it means "nondeterministic polynomial".
The books definition I find confusing;
more intuitive, I think, is the notion
that problems in NP have solutions
which can can be verified in polynomial time.
Another way of saying this is that a parallel
(i.e. non-deterministic; the next execution
step is not "determined" but instead branches)
computer can do the problem in polynomial time,
since one of the branches will terminate when
it finds the verifiable solution.
Again, formally only decision problems are
in P or NP, though practically most problems
can be framed in this way.
The text gives a number of famous examples
of NP problems, of which the traveling salesman
is probably the best known.
P is a strict subset of NP.
Note that some problems are not in NP;
an example is the halting problem.
(all decision problems) > NP > P
numerical algorithms
Or "dealing with round-off error"...