Graph Theory.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
AMDM UNIT 7: Networks and Graphs
Graphs. Overview What is a graph? Some terminology Types of graph Implementing graphs (briefly) Some graph algorithms Graphs 2/18.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
Graphs. Graph A “graph” is a collection of “nodes” that are connected to each other Graph Theory: This novel way of solving problems was invented by a.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
GRAPH Learning Outcomes Students should be able to:
Graphs CS /02/05 Graphs Slide 2 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved Definition.
EECS 203: It’s the end of the class and I feel fine. Graphs.
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
Representing and Using Graphs
Structures 7 Decision Maths: Graph Theory, Networks and Algorithms.
CS 200 Algorithms and Data Structures
Graphs, Puzzles, & Map Coloring
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
COSC 2007 Data Structures II Chapter 14 Graphs I.
Introduction to Graph Theory
Topics Paths and Circuits (11.2) A B C D E F G.
Lecture 10: Graph-Path-Circuit
AND.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1) Find and label the degree of each vertex in the graph.
Graphs Definition: a graph is an abstract representation of a set of objects where some pairs of the objects are connected by links. The interconnected.
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Programming Abstractions Cynthia Lee CS106B. Upcoming Topics Graphs! 1.Basics  What are they? How do we represent them? 2.Theorems  What are some things.
MAT 110 Workshop Created by Michael Brown, Haden McDonald & Myra Bentley for use by the Center for Academic Support.
An Introduction to Graph Theory
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
Graphs Chapter 20.
EECS 203 Lecture 19 Graphs.
Shortest Path Problems
Çizge Algoritmaları.
CSC 172 DATA STRUCTURES.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Agenda Lecture Content: Introduction to Graph Path and Cycle
Konigsberg’s Seven Bridges
Discrete Structures – CNS2300
Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5)
HAMILTONIAN CIRCUIT ALGORITHMS
EECS 203 Lecture 20 More Graphs.
CS120 Graphs.
Discrete Maths 9. Graphs Objective
CSC 172 DATA STRUCTURES.
Can you draw this picture without lifting up your pen/pencil?
Euler Circuits and Paths
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Genome Assembly.
Foundations of Discrete Mathematics
Walks, Paths, and Circuits
A path that uses every vertex of the graph exactly once.
Konigsberg- in days past.
Route Inspection Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we introduce a vertex.
Euler Circuits and Paths
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Euler circuit Theorem 1 If a graph G has an Eulerian path, then it must have exactly two odd vertices. Theorem 2 If a graph G has an Eulerian circuit,
Graphs CS 2606.
Warm Up – 3/14 - Friday 100 seats are to be apportioned.
Warm Up – 3/17 - Monday A) List the set of vertices.
GRAPHS.
Presentation transcript:

Graph Theory

Graphs Graph theory is a key part of computer science and computer science algorithms Example: The traveling salesperson problem Can we find the shortest path through a set of cities that visits each city once and starts and ends at the same city? FYI: this is a famous problem and there is no known algorithm (set of steps) that is guaranteed to solve it in all cases, other than trying all possible paths (which is not very efficient)

Definitions A graph is a pair of sets, V and E Example: V is the set of vertices E is the set of edges Example: V = {A, B, C, D} E = {(A,B), (A,C), (C,D), (A,D), (B,C)} What does the graph look like? You need to be able to take a graph and represent it using V and E or take V and E and draw the graph

The Example Graph V = {A, B, C, D} E = {(A,B), (A,C), (C,D), (A,D), (B,C)}

More definitions A path is a sequence of vertices v1, v2, .., vn such that (vi, vi+1) is in E an no vertices are repeated The length of the path is the number of edges in between the starting and ending vertex. A path may be undirected if you can travel along an edge in either direction (as in the last example) or may be directed, in which case you should include arrows A graph may be weighted in which case there is a weight associated with each edge. What might the weight represent for the traveling salesman problem? The degree of a vertex is the number of edges it has

And More Definitions An undirected graph is connected if there is a path from every vertex to every other vertex G is a subgraph of H if all vertices & edges in G are in H A maximally connected component is a connected subgraph such that no vertices can be added and have it still be connected

Examples A E B D F C Give 3 examples of paths and specify their lengths Are these graphs undirected or directed? Are they unweighted or weighted? What is the degree of each node? Is the graph connected? Why or why not? List 3 subgraphs. List two maximally connected components of the graph

Euler Paths Euler path: Find a path that visits every edge in the graph exactly once Euler circuit: An Euler path that starts and ends at the same vertex Same problems as asking you to trace all of the edges without lifting your pencil Can you come up with any simple rules that might help you decide whether a graph has or does not have an Euler path or Euler circuit?

Determining Euler Paths/Circuits If a graph has an Euler circuit, the degree of every vertex must be even Can’t get stuck at any vertex Converse is true: if the degree of every vertex in a connected graph is even, then must have an Euler circuit A graph has an Euler path if every vertex has an even degree or has exactly two with odd degree.

Euler Circuit Examples Which one(s) have an Euler Circuit? Which one(s) have an Euler Path? Only the rightmost one has an Euler Circuit Only the middle one does not have an Euler path

Hamiltonian Circuits Euler circuits are about visiting each edge exactly once. Hamiltonian paths/circuits are about visiting each vertex only once. A Hamiltonian circuit is a cycle (path need not be) There is no method/algorithm for determining whether a graph has a Hamiltonian circuit. Traveling salesman problem is for a weighted graph where we must find the minimum Hamiltonian path.

What you need to know for the exam Know everything on these slides The basic definitions I may ask you if a graph has an Euler circuit I may even ask you if it has a Hamiltonian circuit (you would need to figure that out by trial and error) I could ask you something new based on the basic definitions (e.g., shortest path between two points)