Graph Theory - Diane Souvaine
Notes by Harrison Kaiser; Drawings by Diane Souvaine Email [email protected] Website https://www.cs.tufts.edu/~dls/advising.php Note: Check Piazza for Grade Scope Sign Up
Scribe
Everyone scribes once - numbers should work out. Should send notes to: [email protected] sends to both Prof and TA • LaTeX preferably • Must be PDF • Send both source (latex, markdown, word, ect..) and PDF • Within 24 hours
Assignments
One every week. Due Thursday.
Lecture - Begins with a fresh piece of chalk
May need to tell prof to slow down, or speak quieter. She is losing hearing may be too loud. Chalk Broke - “Good Start”
Graph G :(V (G),E(G)) together with an incidence function ΨG
• If e ∈ E(G) and u, v ∈ V (G) 3 ΨG{u, v} (later “uv” or “vu”) Then e joins u and v, and u,v are the endpoints of e • # vertices in G, v(G) = the “order” of G • # edges in G, e(G) is the “size” of G Note: most often edges outnumber vertices
Application Examples
• points/vertices people; lines/edges join pairs of friends • points/vertices airports; lines/edges non-stop flights • points/vertices communication hubs; lines/edges communication links
1 Abstract Examples
1) G = (V (G),E(G)) where V (G) = {u, v, w, x, y} E(G) = {a, b, c, d, e, f, g, h}
ΨG(a) = uv ΨG(b) = uu ΨG(c) = vw ΨG(d) = wx ΨG(e) = vx ΨG(f) = wx ΨG(g) = ux ΨG(h) = xy
Figure 1: a messy drawing of the abstract graph v,w are incident on e AND c is indecent on v,w b is a self loop of u
2) “Wheel Graph” v1 − v5 connected in cycle v0 connected to all e1 = v1v2 e2 = v2v3 e3 = v3v4 e4 = v4v5 e5 = v5v1 e6 = v0v1 e7 = v0v2 e8 = v0v3 e9 = v0v4 e9 = v0v5 Can be drawn planar or non-planar See (optional game): www.planarity.net
“Maxims”
• Graphs can be represented graphically BUT • No Single correct way to draw a graph (edges can be curved or straight) • In practice we are sloppy and refer to diagram of a graph as a graph • G or H refer to graphs, BUT whenever feasible We write V or E instead of V (H) or E(H) or V (G) or E(G) When not confusing – save characters “a good computer scientist is lazy computer scientist” • Typically n = |V (G)| and m = |E(G)|
2 Figure 2: a cleaner (planar) drawing of the abstract graph
Terminology
• incidence • adjacency • neighbors (all the vertices you can get to from the given vertex) • infinite graph (in this class only finite graphs) • finite graph • degree (number of neighbors) • null graph (no vertices) • trivial graph (one vertex - [no edges? many edges? - difference of opinion]) • non-trivial • parallel edges - two edges with the same endpoints • simple graph (no loops or parallel edges) Can get rid of ΨG and just rename the edges by endpoints
Types of Graphs
• complete graph (every vertex connect to every other one) CS Name - Clique (or with a number to say the number of verities i.e. 5 Clique) • empty (no edges – allowed to have vertices)
3 Figure 3: a planar and non-planar embedding of the wheel graph
4 • bipartite partition vertices into two sets such that all edges go from a vertex in one set a vertex in the other G[X,Y ] (X,Y is the bipartition) • complete bipartite graph bipartite graph with all possible edges • star one vertex connect to all others, no other edges • (k-)path one vertex then the next then the next. . . . the last • (k-)cycle a loop no other edges “triangle” “hexagon” . . . • connected all vertices have a way to “get to” all other ones through successive neighbors • disconnected not all vertices have a way to “get to” all other ones through successive neighbors • planar graph vs planar embedding An embedding is a drawing of a graph A planar graph must have a planar embedding (although it doesn’t need to be embedded in a planar way) A non-planar graph is defined to not have a planar (drawing) embedding A non-planar graph can sometimes be embedded on a surface (e.g. a torus (donut)) Recommend Again: www.planarity.net
Incidence and Adjacency Matrix
Incidence Matrix
MG := mve
a b c d e f g h u 1 2 0 0 0 0 1 0 v 1 0 1 0 1 0 0 0 w 0 0 1 1 0 1 0 0 x 0 0 0 1 1 1 1 1 y 0 0 0 0 0 0 0 1
Adjacency Matrix
AG := auv
u v w x y u 2 1 0 1 0 v 1 0 1 1 0 w 0 1 0 2 0
5 u v w x y x 1 1 2 0 1 y 0 0 0 1 0
For Simple Graphs
Adjacency List - For each vertex list neighbors
For Bipartite Graph
G[X,Y ], |X| = r, |Y | = s Can define any r x s bipartite adjacency matrix BG(bij) such that bij is the number of edges from X[i] to Y [j]
| Break |
Vertex Degrees
• dG(v) = # edges of G incident w/ G where each loop counts twice
• if G is simple dG(v) = # neighbors of v
• if dG(v) = 0 for some v, v is “isolated” • δ(G) = min degree over all vertices of G • ∆(G) = max degree over all vertices of G 1 P • d(G) = n v∈V d(v) is average degree of the vertices of G
Theorem 1
P For any graph G, v∈V d(v) = 2m
Proof
Consider the incidence matrix M the sum of the entries in a row for v is d(v) the total sum for all the rows is P v∈d(b) the sum of the entries in a column for e is 2 the total sum for all of the columns is 2m Q.E.D.
6 Figure 4: graph for which we show the incidence and adjacency matrices
Corollary
Number of vertices of odd degree is even
Proof
Note that d(v) = 1 (mod 2) for d(v) odd = 0 (mod 2) for d(v) even Consider P v∈V d(v) = 2m (mod 2) = 0 and The sum of the even degrees (mod 2) is 0 therefore The sum of the odd degrees (mod 2) is 0 therefore the number odd degree vertices is even Q.E.D.
7 Proposition
Let G[X,Y ] with no isolated vertices (note this is not necessarily connected) such that d(x) >= d(y) for all x,y in E where x ∈ X, y ∈ Y Then |X| <= |Y | with equality iff d(x) = d(y)∀x, y ∈ E
Proof
Consider the bipartite adjacency matrix BG
Divide row corresponding to x by d(x)∀x ∈ X get B˜G
All row sums in B˜G are 1. P 1 The column sum for each y is d(x) for each neighbor x of y 1 1 But this sum <= 1 since d(x) <= d(y) got all x, y ∈ E The total of all column sums <= |Y | or P P 1 P P 1 P P 1 |X| = x∈X y∈Y,xy∈E d(x) = x∈X,y∈Y xy∈E d(x) <= x∈X,y∈Y xy∈E d(y) = P P 1 y∈Y x∈X,xy∈E d(y) = |Y | So |X| <= |Y |
Regular Graph
G is k-regular if d(v) = k∀v ∈ V A graph is regular if it is k-regular for some k
Examples
A complete graph on k vertices is k − 1 regular The complete bipartite graph with k vertices in each part is k-regular
3-Regular graphs
Cubic Graph
The name cubic comes from the cube, in fact many graph names come from polyhedron.
8 Figure 5: cubic graph
Peterson graph
Figure 6: three embeddings of Peterson graph
The Peterson graph is a simple graph whose vertices are the 2 element subsets of a 5 element set and whose edges are the pairs of disjoint 2 element subsets {1, 2, 3, 4, 5} V = [12, 34, 51, 23, 45, 13, 15, 52, 41, 24] E = {uv|u ∩ v = ∅} Many interesting drawings that reveal: a star, many 6 cycles, many 9 cycles “Girth” of a graph is the length of the shortest cycle and if there is no cycle, the girth is infinite what is the girth of the Peterson graph – looks like it may be 5 – proof?
Isomorphisms
Graphs G and H are identical i.e. G = H if V (G) = V (H), E(G) = E(H), ΨG = ΨH i.e. exactly the same labeling (may be drawn differently)
9 Identical Graphs can be represented by identical diagrams (but also identical adjacently matrix) What about non-identical graphs with essentially same diagram? What about labels changing? Graphs G & H are isomorphic written G =~ H, if there are bijections Θ: V (G) → V (H) and Φ: E(G) → E(H) such that ΨG(e) = uv iff ΨH (Φ(e)) = Θ(u)Θ(v) Such a pair of mappings is called a isomorphism between G and H. To show that two graphs are isomorphic we must indicate the isomorphism.
Complement Graph
Defined only on simple graphs – non-edges become edges / edges become non- edges
Complete Bipartite
Example - K3,3
Complete Graph
Examples - K5, K6
10