{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L18cs2110fa08 - Graphs Lecture 18 CS2110 Fall 2008...

Info icon This preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Graphs Lecture 18 CS2110 – Fall 2008
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 Announcements Prelim 2 Tuesday, Nov 18, 7:30-9pm Uris Auditorium Exam conflicts Email Kelly Patwell ASAP Old exams are available for review on the course website
Image of page 2
3 These are not Graphs East West North ...not the kind we mean, anyway
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 These are Graphs K 5 K 3,3 =
Image of page 4
5 Applications of Graphs Communication networks Routing and shortest path problems Commodity distribution (flow) Traffic control Resource allocation Geometric modeling ...
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 Graph Definitions A directed graph (or digraph ) is a pair (V, E) where V is a set E is a set of ordered pairs (u,v) where u,v V Usually require u v (i.e., no self-loops) An element of V is called a vertex (pl. vertices ) or node An element of E is called an edge or arc |V| = size of V, often denoted n |E| = size of E, often denoted m
Image of page 6
7 Example Directed Graph (Digraph) V = { a,b,c,d,e,f } E = { (a,b), (a,c), (a,e), (b,c), (b,d), (b,e), (c,d), (c,f), (d,e), (d,f), (e,f) } |V| = 6, |E| = 11 b a c d e f
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8 Example Undirected Graph An undirected graph is just like a directed graph, except the edges are unordered pairs ( sets ) {u,v} Example: b a c e d f V = { a,b,c,d,e,f } E = { {a,b}, {a,c}, {a,e}, {b,c}, {b,d}, {b,e}, {c,d}, {c,f}, {d,e}, {d,f }, {e,f } }
Image of page 8
9 Some Graph Terminology Vertices u and v are called the source and sink of the directed edge (u,v), respectively Vertices u and v are called the endpoints of (u,v) Two vertices are adjacent if they are connected by an edge The outdegree of a vertex u in a directed graph is the number of edges for which u is the source The indegree of a vertex v in a directed graph is the number of edges for which v is the sink The degree of a vertex u in an undirected graph is the number of edges of which u is an endpoint b a c e d f b a c d e f
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10 More Graph Terminology A path is a sequence v 0 ,v 1 ,v 2 ,...,v p of vertices such that (v i ,v i+1 ) E, 0 i p – 1 The length of a path is its number of edges In this example, the length is 5 A path is simple if it does not repeat any vertices A cycle is a path v 0 ,v 1 ,v 2 ,...,v p such that v 0 = v p A cycle is simple if it does not repeat any vertices except the first and last A graph is acyclic if it has no cycles A directed acyclic graph is called a dag v 0 v 5 b a c d e f
Image of page 10
11 Is This a Dag? Intuition: If it’s a dag, there must be a vertex with indegree zero – why? This idea leads to an algorithm A digraph is a dag if and only if we can iteratively delete indegree-0 vertices until the graph disappears b a c d e f
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
12 Is This a Dag? Intuition: If it’s a dag, there must be a vertex with indegree zero – why? This idea leads to an algorithm A digraph is a dag if and only if we can iteratively delete indegree-0 vertices until the graph disappears b a c d e f
Image of page 12
13 Is This a Dag?
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern