Discrete Structures
Lecture Notes, 8 Dec 2010
Last Update: 8 December 2010
Note:
or
material is highlighted
|
Note: A username and password may be required to access certain
documents.
Please
contact
Bill Rapaport.
Index to all lecture notes
…Previous lecture
§9.6, esp. pp. 653–655
§9.8, esp. p. 668;
§4.3(!), esp. p. 302;
§10.1, esp. p. 685–686:
Graphs (cont'd) and Rooted Trees
- The Traveling Salesman Problem (TSP) is "NP":
- ∃ no known algorithm for solving it in Polynomial time
by a deterministic Turing Machine (e.g., your laptop)
- A problem is computable in P-time
in the worst case, the
time it takes to compute a solution for it
on a deterministic Turing Machine
is a polynomial function of
the size of its input n.
- i.e.) time is no worse than aknk +
ak–1nk–1 +
… + a1n + a0,
for some integer k and
real constants ai
- e.g.) exponential time (order of 2²)
is not in P
- It can only be computed in Non-deterministic Polynomial time
- i.e.) solvable in polynomial time by a
non-deterministic TM
- A non-deterministic TM
a TM that does all
possible "next steps" simultaneously until it finds a solution.
- hence, ≡ SAT
- SAT = finding an assignment of truth values that "sat"isfies
a proposition of propositional logic
- i.e.) computing a truth table with n atomic propositions
- P = NP?
- The greatest unsolved problem of CS
- All functions divide into:
- those not computable even in principle
- those that are computable
(by a Turing Machine, or by a recursive function),
which divide into:
- those computable in practice
(i.e., polynomial time, or "P")
- those not computable in practice
(i.e., non-deterministic
polynomial time, or "NP")
- Read
Goldman's Theorem
- (humorous novel about P=NP written by a guy I went
to elementary school with :-)
- and TSP is NP-hard:
- at least as hard as—and possibly harder than—any
other NP problem
- and TSP is NP-complete:
- if can solve it in P-time,
then can solve all other problems in
P-time
-
The 4-Color Theorem:
- Thm (4CT): No map needs >4 colors
- Convention: Two "countries" that share a linear boundary
must be colored differently.
- How many colors does this map need?
- It can be colored with 5 colors,
but does it need 5?
uses colors 1,…,5
- No:
only needs colors 1,…,4
- Can represent a map as a graph:
- vertices represent countries;
edges represent boundaries
- Then can use graph theory + a computer! to prove 4CT
- Appel & Haken (1976) had to consider 2000 special cases
- Univ. of Illinois postmark: "4 Colors Suffice!"
- Does this change the nature of mathematical proof?
(Do we need to prove that the computer program that proved 4CT
was correct?)
- Trees & Rooted Trees:
- Def:
- E.g.)
- But this is not a tree (has a circuit):
- Nor is this (it's not connected;
it's a "forest": a graph consisting of two
(or more) trees)
- This "rooted", directed tree (with a "start" vertex, or "root")
is a tree:
(think of each edge as being directed "downwards")
- Recursive Def of "Rooted Tree":
Base Case:
Recursive Case:
Let T1, … , Tn be (a forest of) disjoint
rooted trees with roots r1, … , rn
- ("disjoint" means that their vertex sets are disjoint)
Let r be a new vertex ≠ each ri
Then the directed graph consisting of r with an edge
from r to each ri
a rooted tree with root r
- Set-Theoretical Recursive Def of Rooted Tree:
- Just as a test of your mathematical reading skills ;-)
- Base Case:
Let r be a vertex.
Then
T = ( {r}, ∅ ) is a tree rooted at r
- Recursive Case:
∀ i ∈ {1, … , n}:
Let ri be a vertex.
Let Vi be a set of vertices.
Let Ei be a set of edges.
Let Ti = (Vi,
Ei) be a tree rooted at ri.
Let T1, … , Tn be a forest of disjoint
trees (rooted at r1, … , rn).
Let r be a vertex ≠ each ri.
Then:
Tn+1 = ( Vn+1 = ∪i∈{1,…n}Vi ∪
{r},
En+1 =
∪i∈{1,…n}Ei ∪
∪i∈{1,…n}{(r,ri)} )
is a tree rooted at r.
- E.g.)
T1 = • r1
T2 = • r2
T3 = • r3
are rooted trees with roots ri by the base case.
T4 =
is a rooted tree with root r4 by the recursive case
(and T1, T2, T3 are subtrees of T4)
and if T5 =
is a rooted tree with root r5,
then T7 =
is a rooted tree with root r7
- Terminology for Rooted Trees:
- Recall that a rooted tree is a digraph!
- Consider this rooted tree:
Then here is the "feminist"/"male chauvinist"/neutral terminology:
- "a" is the mother/father/parent of "b" and "c"
- "b" is a daughter/son/child of "a"
- "b" and "c" are sister/brother/sibling vertices
- "b" and "d" are descendants of "a"
- "a" is an ancestor of "b",…,"e"
and, switching metaphors:
- "a" is the root
- "d", "e", and "c" are leaves
- "b" is the root of a subtree with leaves "d" and "e"
Next lecture…
Text copyright © 2010 by William J. Rapaport
(rapaport@buffalo.edu)
Cartoon links and screen-captures appear here for your enjoyment.
They are not meant to infringe on any copyrights held by the creators.
For more information on any cartoon, click on it, or contact me.
http://www.cse.buffalo.edu/~rapaport/191/F10/lecturenotes-20101208.html-20101208