CSE390D Notes for Monday, 12/2/24

definition: A graph G = (V, E) consists of V, a nonempty set of vertices (or nodes) and E, a set of edges. Each edge has either one or two vertices associated with it, called its endpoints. An edge is set to connect its endpoints. adjacent: 2 vertices adjacent in undirected graph if e connects them {u, v} edge is said to be incident incident: edge is incident to each vertex deg(v) = # of edges incident to it (special case for self-loops--2) handshaking theorem: what is sum(v in V) deg(v)? = 2 * |E| example: what is true of vertices with odd degree? must be an even # of them directed graphs: edges are (u, v) ordered u is adjacent to v v is adjacent from u in-degree = deg^-(v) = # of edges ending in v out-degree = deg^+(v) = # of edges starting with v sum(v in V) deg^-(v) = sum(v in V) deg^+(v) = |E| bipartite graph: vertices can be partioned into two disjoint sets such that all edges connect a vertex in one set to a vertex in the other set ---------------------------------------------------------------------- special graphs: Kn is complete graph on n vertices (all possible connections, but no self loops) Kn,m is complete graph on n and m vertices (bipartite graph with all possible connections between two sets of vertices) Cn is a cycle of length n (same starting and ending vertex) subgraph of G = (V, E) H = (W, F), W subset of V, F subset of E representation adjacency list adjacency matrix ---------------------------------------------------------------------- connectivity path from v1 to vn is sequence of edges (v1, v2, v3, ..., vn) where (vi, vi+1) is an edge simple path if edges are unique circuit: starting and ending vertex the same simple circuit: no repeated edges graph is connected if there is a path between every pair of vertices Euler circuit: simple circuit including all edges (exactly once) Euler path: simple path including all edges (exactly once) properties of graph with Euler circuit? all deg are even Hamiltonian path: simple path with every vertex once Hamiltonian circuit: simple circuit with every vertex once (except first/last) ---------------------------------------------------------------------- A Tree is: connected, acyclic graph Assumes undirected, nonempty. Goldilocks point between disconnected and cyclic: add an edge, you get a cycle remove an edge, it's disconnected equivalent definition: unique path between any two vertices rooted tree: one node identified as root think of the tree put together with paper clips for edges, pick up the tree by the root children, grandchildren, siblings, etc m-ary tree is a rooted tree where each vertex has at most m children we're used to 2-ary trees we're also used to ordered trees leaf: a vertex of a rooted tree that has no children ---------------------------------------------------------------------- is it true that every tree has a leaf? yes prove by contradiction let T be a rooted tree that has no leaf T has n vertices start at the root go to a child go to a child go to a child if it ends, we've got a leaf, so it can't end do that n times end up visiting n+1 vertices pigeon hole principle: 2 vertices the same, cycle, contradiction ---------------------------------------------------------------------- important property of trees: |V| = |E| + 1 in fact, any 2 of (connected, acyclic, |V| = |E| + 1) means tree how would we prove this? induction on vertices P(1): only one tree of one vertex, it has no edges, 1 = 0 + 1 assume P(k) for some k in Z+, prove P(k+1) Prove that P(k+1) holds P(k): vertices = edges + 1 for trees of k vertices P(k + 1): vertices = edges + 1 for trees of k+1 vertices Let T be a tree of k+1 vertices it must have a leaf L let T' = T - (leaf/edge) T' is a tree of k vertices therefore, vertices = edges + 1 in T' (vertices = k, edges = k-1) but T has 1 more vertex and 1 more edge (vertices=k+1, edges=k) therefore the property holds of T this completes the proof ---------------------------------------------------------------------- graph isomorphism: are two graphs the same? planarity Kuratowski's theorem A graph is nonplanar if it contains a subgraph of K3,3 or K5 graph coloring coloring is assignment of colors to vertices, no adjacent pair assigned the same color chromatic number of a graph is least number of colors needed for a coloring of this graph four color theorem: chromatic number of a planar graph is no more than 4
Stuart Reges
Last modified: Mon Dec 2 14:09:59 PST 2024