Week 14 notes

Comp 163-002, Spring 2020, MWF, 12:35-1:25, no fixed abode

Week 14 starts Monday, April 20.

The primary goal of this course is to become familiar with some of the basic mathematical ideas used in programming.



Planar graphs

(started last week)

Concept of faces in a graph

Euler's Formula for Planar Graphs, p 259 (also works for polyhedra, which are, as graphs, planar; see p 262)

Theorem 4.3.1: K5 is not planar (done last week)

Suppose K5 is planar. Then the number of faces must be f=7, by Euler's Formula.

Each of those faces must be bounded by at least 3 edges. Each edge gets counted twice. So there must be at least 7*3/2 = 10.5 edges.

But there are only 10 edges.

Theorem 4.3.2: K3,3 is not planar.

Planar graphs can be drawn on the surface of a sphere, and vice-versa.

Theorem 4.3.4: There are exactly 5 regular polyhedra.

Non-graph version of the proof: faces must be regular polygons. This leaves only equilateral triangles, squares, and regular pentagons, as polygons with more sides cannot be stuck together in a 3D structure (regular hexagons can be stuck together but the result is planar).

For squares and pentagons, we can only have 3 faces meeting at a vertex. These result in the cube and the dodecahedron, respectively.

For equilateral triangles, we can have 3, 4 or 5 faces meeting at a vertex (6 is planar). These result in the tetrahedron, octahedron and icosahedron respectively.

Graph Coloring

Proper vertex coloring: color each vertex so that no two vertices connected by an edge have the same color.

Chromatic number: minumum number of colors needed = 𝜒(G)

Complete graph Kn: Chromatic number = n

Bipartite graph: chromatic number = 2

Theorem 4.4.2: For any planar graph, the chromatic number is less than or equal to 4.

The proof is very hard!

Investigate! on page 269 and Example 4.4.3 on page 270: graph coloring in practice

A clique in a graph is a subgraph isomorphic to Kn; that is, a set of n vertices such that each pair is connected by an edge. The clique number of a graph is the size of the largest clique subgraph.

Fact: 𝜒(G) = chromatic number >= clique number.

That gives us a lower bound on the chromatic number. What about an upper bound?

Let 𝚫(G) be the maximum degree of any vertex of G.

Fact: 𝜒(G) <= 𝚫(G)+1. Proof: start at the vertex of degree 𝚫(G). We can color that vertex and all its 𝚫(G) neighbors with 𝚫(G)+1 colors. Furthermore, we can keep going! Consider a vertex v that is a neighbor of a vertex we have colored. Some of the neighbors of v are colored and some are not. We have enough colors that we can always choose a color for v that is different from the color of any neighbor.

How often is 𝜒(G) = 𝚫(G)+1? Two cases come to mind:

Are there any other examples? Brooks' Theorem (p 272) says no.

For any graph G, 𝜒(G) <= 𝚫(G) unless G is one of the two examples above

Edge coloring:

Euler Paths and Circuits

Euler path: traverse every edge exactly once.

An Euler path exists if and only iff there are at most two vertices of odd degree, in which case those vertices must be the start and stop points of the path. (If there are no vertices of odd degree, then the path can start and stop at the same vertex; that is, it is a circuit.)

Hamiltonian Paths and Circuits

How about a path which visits each vertex exactly once? Such a path is a Hamilton (or Hamiltonian) path.

There is no easy test for whether a graph has a Hamilton path.