CSC 172 DATA STRUCTURES.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Discrete Mathematics University of Jazeera College of Information Technology & Design Khulood Ghazal Connectivity Lecture _13.
Chapter 8 Topics in Graph Theory
Graph algorithms Prof. Noah Snavely CS1114
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
CPE702 Complexity Classes Pruet Boonma Department of Computer Engineering Chiang Mai University Based on Material by Jenny Walter.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Decision Maths Graphs Wiltshire Graphs A graph is just a diagram made up of “dots” and “lines”. These are all graphs. The dots are called “nodes” or.
Graph Traversals Reading Material: Chapter 9. Graph Traversals Some applications require visiting every vertex in the graph exactly once. The application.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
1 CIS /204—Spring 2008 Recitation 10 Friday, April 4, 2008.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
Chapter 4 Graphs.
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.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
CS 200 Algorithms and Data Structures
Topics Paths and Circuits (11.2) A B C D E F G.
Graphs. Graphs Similar to the graphs you’ve known since the 5 th grade: line graphs, bar graphs, etc., but more general. Those mathematical graphs are.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Chapter 6: Graphs 6.1 Euler Circuits
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.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
CSC 213 – Large Scale Programming Lecture 31: Graph Traversals.
Graphs 1 Neil Ghani University of Strathclyde. Where are we …. We studied lists: * Searching and sorting a list Then we studied trees: * Efficient search.
Brute Force and Exhaustive Search Brute Force and Exhaustive Search Traveling Salesman Problem Knapsack Problem Assignment Problem Selection Sort and Bubble.
Representing Graphs Depth First Search Breadth First Search Graph Searching Algorithms.
More NP-complete problems
NP-completeness Ch.34.
Graphs Chapter 20.
EECS 203 Lecture 19 Graphs.
Chapter 22 Elementary Graph Algorithms
Tracing An Algorithm for Strongly Connected Components that uses Depth First Search Graph obtained from Text, page a-al: Geetika Tewari.
Main algorithm with recursion: We’ll have a function DFS that initializes, and then calls DFS-Visit, which is a recursive function and does the depth first.
Csc 2720 Instructor: Zhuojun Duan
Agenda Lecture Content: Introduction to Graph Path and Cycle
Discrete Structures – CNS2300
EECS 203 Lecture 20 More Graphs.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CS120 Graphs.
Discrete Maths 9. Graphs Objective
More Graph Algorithms.
Spanning Trees Discrete Mathematics.
Graph Algorithm.
CSC 172 DATA STRUCTURES.
Can you draw this picture without lifting up your pen/pencil?
Euler Paths and Circuits
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graphs Chapter 13.
Genome Assembly.
"Learning how to learn is life's most important skill. " - Tony Buzan
A path that uses every vertex of the graph exactly once.
Decision Maths Graphs.
Graph Algorithms "A charlatan makes obscure what is clear; a thinker makes clear what is obscure. " - Hugh Kingsmill CLRS, Sections 22.2 – 22.4.
Depth-First Search CSE 2011 Winter April 2019.
Euler and Hamilton Paths
Graphs G = (V, E) V are the vertices; E are the edges.
Depth-First Search CSE 2011 Winter April 2019.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
A vertex u is reachable from vertex v iff there is a path from v to u.
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/19 - Wednesday Give the vertex set. Give the edge set.
Hamilton Paths and Circuits
Chapter 14 Graphs © 2011 Pearson Addison-Wesley. All rights reserved.
Prof. Ramin Zabih Graph Traversal Prof. Ramin Zabih
Presentation transcript:

CSC 172 DATA STRUCTURES

WORKSHOP LEADER INTEREST MEETING FRIDAY, APRIL 6th 12:30pm 601 CSB Good grades in CSC171 & CSC172 Good people skills Favorable approach to workshops

GRAPHS GRAPH G= (V,E) V: a set of vertices (nodes) E: a set of edges connecting vertices  V An edge is a pair of nodes Example: V = {a,b,c,d,e,f,g} E = {(a,b),(a,c),(a,d),(b,e),(c,d) ,(c,e),(d,e),(e,f)} a b d c e f g

PATHS ON GRAPHS Simple Euler Hamiltonian

SIMPLE PATH Given two vertices is there a simple path that connects them?

HAMILTONIAN PATH Given a starting vertex is there a path through the graph that visits each (and every) vertex exactly once? If the path finishes at the starting vertex, it is a Hamiltonian cycle (a.k.a. The Traveling Salesman Problem).

EULER PATH Given a starting vertex is there a path through the graph that traverses each (and every) edge exactly once?

SIMPLE PATH Given two vertices is there a simple path that connects them? We can find this path in linear O(V + e) time Sort of, recall that e is O(V2) Use Depth first search. How can we modify DFS to print the path?

HAMILTONIAN PATH Given a starting vertex is there a path/cycle/tour through the graph that visits each (and every) vertex exactly once? In order to do this, we may need to consider every possible path. (How many are there?) We may need to consider (V-1)! paths in a complete graph.

EULER PATH Given a starting vertex is there a path through the graph that traverses each (and every) edge exactly once? We can prove that an Euler cycle exists iff the graph is connected and all nodes have even degree. We can find the path in linear time.