CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Graph-02.
 期中测验时间:本周五上午 9 : 40  教师 TA 答疑时间 : 周三晚上 6 : 00—8 : 30  地点:软件楼 315 房间,  教师 TA :李弋老师  开卷考试.
TECH Computer Science Graphs and Graph Traversals  // From Tree to Graph  // Many programs can be cast as problems on graph Definitions and Representations.
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
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.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
W. D. Grover TRLabs & University of Alberta © Wayne D. Grover 2002, 2003 Graph theory and routing (initial background) E E Lecture 4.
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.
Chapter 4 Graphs.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
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.
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,
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Data Structures & Algorithms Graphs
CSS106 Introduction to Elementary Algorithms
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
An Introduction to Graph Theory
Graph Theory and Applications
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graphs. Contents Terminology Graphs as ADTs Applications of Graphs.
Introduction to Graph Theory By: Arun Kumar (Asst. Professor) (Asst. Professor)
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.
Graph Concepts Illustrated Using The Leda Library Amanuel Lemma CS252 Algorithms.
CSC 252: Algorithms October 28, 2000 Homework #5: Graphs Victoria Manfredi (252a-ad) notes: -Definitions for each of the graph concepts are those presented.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Graph Terms By Susan Ott. Vertices Here are 7 vertices without any edges Each Vertex is labeled a different color and number.
Leda Demos By: Kelley Louie Credits: definitions from Algorithms Lectures and Discrete Mathematics with Algorithms by Albertson and Hutchinson graphics.
CSC 252 Pallavi Moorthy Homework 5. 1.) Vertices, edges From cd../../handout/demo/graph_alg/gw_shortest_path.
An Introduction to Graph Theory
Graphs Chapter 20.
Graph Theory An Introduction.
Graphs: Definitions and Basic Properties
Chapter 9 (Part 2): Graphs
Special Graphs By: Sandeep Tuli Astt. Prof. CSE.
Copyright © Zeph Grunschlag,
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
CSE 373, Copyright S. Tanimoto, 2001 Graphs 1 -
Chapter 5 Fundamental Concept
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Discrete Structures – CNS2300
Introduction to Graph Theory
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Graph Theory.
Graphs Chapter 13.
Graph Operations And Representation
Graphs Discrete Structure CS203.
Decision Maths Graphs.
Euler and Hamilton Paths
Graphs G = (V, E) V are the vertices; E are the edges.
GRAPHS G=<V,E> Adjacent vertices Undirected graph
Chapter 5 Graphs the puzzle of the seven bridge in the Königsberg,
Introduction to Graph Theory
Presentation transcript:

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Motivation Digraphs, Undirected graphs, graphs with self loops, weighted graphs Paths, cycles, connectedness, free trees, spanning trees, minimum spanning trees. Complete graphs, bipartite graphs. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Motivation Graphs are used to model a great many different kinds of problems to be solved: Transportation network management, Data flow networks, the Internet. Associations and assignments: compatibility of people for dating. Database schema representation. Semantic structures in language. We need good ways to represent and manipulate data used for these purposes. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Directed Graphs (Digraphs) A directed graph or digraph consists of a set of vertices and a set of edges. G =  V, E  V = { v1, v2, . . . , vn } E = { e1, e2, . . . , em } ei =  va(i), vb(i)  In Sahni, self loops (e.g.,  vk, vk  ) are not permitted. However, in many applications, they are permitted (for example, finite-state automata). In general a digraph is similar to a binary relation. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Example Digraph G =  V, E  V = { a, b, c, d } E = { a, b ,  a, d ,  a, c ,  c, d ,  d, c  } CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Graphs as diagrams A vertex is typically drawn as a dot or a circle. An edge is typically drawn as an arrow. a c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Undirected Graphs An undirected graph is a graph in which each edge is considered to be unordered. For an undirected graph: ei = { va(i), vb(i) } For a directed graph: ei =  va(i), vb(i)  An undirected graph is equivalent to a digraph for a symmetric binary relation. Arrowheads are unnecessary. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Example Undirected Graph G =  V, E  V = { a, b, c, d } E = { { a, b }, { a, d }, { a, c } } a c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Paths A path in a digraph is a sequence of edges such that each edge after the first begins at the vertex where the previous edge arrives   a, b ,  b, d ,  d, c   a c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Drawing a House (Puzzle) CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Puzzle: Seven Bridges of Königsberg PREGEL KNEIPHOFF CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Multigraph for the Bridges of Königsberg CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Euler Paths An Euler path for a graph is a path that uses every edge of the graph precisely once. To draw an Euler path: Start at a vertex. Traverse each edge exactly once. (Never lift the pencil). If any vertex has odd degree, it must be either the start or end of the Euler path, if there is one. No Euler path can have more than 1 start and 1 end. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Self Loops G =  V, E  V = { a, b, c, d } E = { a, b ,  b, b,  a, c,  d, d } a c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Cycles A cycle in a digraph is a path such that the last vertex of the last edge equals the first vertex of the first edge. A simple cycle is one that visits each of its vertices once. I.e., there is one outgoing edge and one ingoing edge for each vertex on the path. CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

Connected Graphs An undirected graph is connected provided every pair of vertices has some path in the graph that begins at one and ends at the other. a Is this graph connected? c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Free Trees An undirected graph is a free tree if (a) it is connected, and (b) it has no cycles. A free tree is unrooted. G =  V, E , V = { a, b, c, d }, E = { a, b ,  a, d,  a, c } a c b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Subgraphs Let G1 =  V1, E1  be a graph, and let G2 =  V2, E2  be a graph such that V2  V1 E2  E1 Then G2 is a subgraph of G1. a a G1 c c b G2 d d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Spanning Trees Let G1 =  V1, E1  be a graph, and let G2 =  V2, E2  be a subgraph of G1 such that G2 is a tree and V2 = V1.. Then G2 is a spanning tree for G1. a a c c b b d d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Complete Graphs A undirected graph G =  V, E  is complete provided ( (v, w)  V  V such that v  w), {v, w }  E. b a K5 c e d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Bipartite Graphs A undirected graph G =  V, E  is bipartite provided V can be divided into two distinct subsets V1 and V2 such that every edge of G connects an element of V1 to an element of V2 G is bipartite iff  V1,  V2 s.t. (V = V1  V2 )  (V1  V2 =  )  ( (v, w)  V  V) ({v, w }  E  ( (v  V1  w  V2 )  (v  V2  w  V1 ) ) ) . b a K2,3 c e d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -

CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 - Weighted Digraphs G =  V, E  V = { a, b, c, d } E = { a, b, 3 ,  a, d, 8 ,  a, c, 0  } a 3 c 8 b d CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -