COMP 761: Lecture 9 – Graph Theory I
Total Page:16
File Type:pdf, Size:1020Kb
COMP 761: Lecture 9 – Graph Theory I David Rolnick September 23, 2020 David Rolnick COMP 761: Graph Theory I Sep 23, 2020 1 / 27 Problem In Königsberg (now called Kaliningrad) there are some bridges (shown below). Is it possible to cross over all of them in some order, without crossing any bridge more than once? (Please don’t post your ideas in the chat just yet, we’ll discuss the problem soon in class.) David Rolnick COMP 761: Graph Theory I Sep 23, 2020 2 / 27 Problem Set 2 will be due on Oct. 9 Vincent’s optional list of practice problems available soon on Slack (we can give feedback on your solutions, but they will not count towards a grade) Course Announcements David Rolnick COMP 761: Graph Theory I Sep 23, 2020 3 / 27 Vincent’s optional list of practice problems available soon on Slack (we can give feedback on your solutions, but they will not count towards a grade) Course Announcements Problem Set 2 will be due on Oct. 9 David Rolnick COMP 761: Graph Theory I Sep 23, 2020 3 / 27 Course Announcements Problem Set 2 will be due on Oct. 9 Vincent’s optional list of practice problems available soon on Slack (we can give feedback on your solutions, but they will not count towards a grade) David Rolnick COMP 761: Graph Theory I Sep 23, 2020 3 / 27 A graph G is defined by a set V of vertices and a set E of edges, where the edges are (unordered) pairs of vertices fv; wg. Vertices are also called nodes. Example of a graph: V = fv1; v2; v3g and E = ffv1; v2g; fv1; v3g; fv2; v3gg. Can be drawn, where the locations of the vertices don’t matter: What is a graph? David Rolnick COMP 761: Graph Theory I Sep 23, 2020 4 / 27 Vertices are also called nodes. Example of a graph: V = fv1; v2; v3g and E = ffv1; v2g; fv1; v3g; fv2; v3gg. Can be drawn, where the locations of the vertices don’t matter: What is a graph? A graph G is defined by a set V of vertices and a set E of edges, where the edges are (unordered) pairs of vertices fv; wg. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 4 / 27 Example of a graph: V = fv1; v2; v3g and E = ffv1; v2g; fv1; v3g; fv2; v3gg. Can be drawn, where the locations of the vertices don’t matter: What is a graph? A graph G is defined by a set V of vertices and a set E of edges, where the edges are (unordered) pairs of vertices fv; wg. Vertices are also called nodes. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 4 / 27 Can be drawn, where the locations of the vertices don’t matter: What is a graph? A graph G is defined by a set V of vertices and a set E of edges, where the edges are (unordered) pairs of vertices fv; wg. Vertices are also called nodes. Example of a graph: V = fv1; v2; v3g and E = ffv1; v2g; fv1; v3g; fv2; v3gg. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 4 / 27 What is a graph? A graph G is defined by a set V of vertices and a set E of edges, where the edges are (unordered) pairs of vertices fv; wg. Vertices are also called nodes. Example of a graph: V = fv1; v2; v3g and E = ffv1; v2g; fv1; v3g; fv2; v3gg. Can be drawn, where the locations of the vertices don’t matter: David Rolnick COMP 761: Graph Theory I Sep 23, 2020 4 / 27 Road networks Social networks Electrical grids Chemical structures Relationships between concepts And a lot more... When do graphs show up? David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 Social networks Electrical grids Chemical structures Relationships between concepts And a lot more... When do graphs show up? Road networks David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 Electrical grids Chemical structures Relationships between concepts And a lot more... When do graphs show up? Road networks Social networks David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 Chemical structures Relationships between concepts And a lot more... When do graphs show up? Road networks Social networks Electrical grids David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 Relationships between concepts And a lot more... When do graphs show up? Road networks Social networks Electrical grids Chemical structures David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 And a lot more... When do graphs show up? Road networks Social networks Electrical grids Chemical structures Relationships between concepts David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 When do graphs show up? Road networks Social networks Electrical grids Chemical structures Relationships between concepts And a lot more... David Rolnick COMP 761: Graph Theory I Sep 23, 2020 5 / 27 The path graph Pn has n vertices v1; v2;:::; vn and (n − 1) edges fvi ; vi+1g for i = 1; 2;:::; n − 1. The cycle graph Cn for n ≥ 3 has n vertices v1; v2;:::; vn and n edges given by fvi ; vi+1g (mod n) for i = 1; 2;:::; n. Special graphs: Paths and Cycles David Rolnick COMP 761: Graph Theory I Sep 23, 2020 6 / 27 The cycle graph Cn for n ≥ 3 has n vertices v1; v2;:::; vn and n edges given by fvi ; vi+1g (mod n) for i = 1; 2;:::; n. Special graphs: Paths and Cycles The path graph Pn has n vertices v1; v2;:::; vn and (n − 1) edges fvi ; vi+1g for i = 1; 2;:::; n − 1. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 6 / 27 Special graphs: Paths and Cycles The path graph Pn has n vertices v1; v2;:::; vn and (n − 1) edges fvi ; vi+1g for i = 1; 2;:::; n − 1. The cycle graph Cn for n ≥ 3 has n vertices v1; v2;:::; vn and n edges given by fvi ; vi+1g (mod n) for i = 1; 2;:::; n. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 6 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. We say a vertex v is adjacent to a vertex w if fv; wg is an edge. We can also say w is a neighbor of v, and the neighborhood of v is the set of all w that are adjacent to v. We say the edge e = fv; wg is incident to the vertices v and w. The number of edges incident to v is called the degree of v. Example: Definitions David Rolnick COMP 761: Graph Theory I Sep 23, 2020 7 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. We can also say w is a neighbor of v, and the neighborhood of v is the set of all w that are adjacent to v. We say the edge e = fv; wg is incident to the vertices v and w. The number of edges incident to v is called the degree of v. Example: Definitions We say a vertex v is adjacent to a vertex w if fv; wg is an edge. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 7 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. We say the edge e = fv; wg is incident to the vertices v and w. The number of edges incident to v is called the degree of v. Example: Definitions We say a vertex v is adjacent to a vertex w if fv; wg is an edge. We can also say w is a neighbor of v, and the neighborhood of v is the set of all w that are adjacent to v. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 7 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. The number of edges incident to v is called the degree of v. Example: Definitions We say a vertex v is adjacent to a vertex w if fv; wg is an edge. We can also say w is a neighbor of v, and the neighborhood of v is the set of all w that are adjacent to v. We say the edge e = fv; wg is incident to the vertices v and w. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 7 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. Example: Definitions We say a vertex v is adjacent to a vertex w if fv; wg is an edge. We can also say w is a neighbor of v, and the neighborhood of v is the set of all w that are adjacent to v. We say the edge e = fv; wg is incident to the vertices v and w. The number of edges incident to v is called the degree of v. David Rolnick COMP 761: Graph Theory I Sep 23, 2020 7 / 27 The neighborhood of b is fa; d; eg. The degree of b of 3 and the degree of d is 4. Definitions We say a vertex v is adjacent to a vertex w if fv; wg is an edge.