Graph theory Definitions Trees, cycles, directed graphs.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
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.
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.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Introduction to 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.
Section 2.1 Euler Cycles Vocabulary CYCLE – a sequence of consecutively linked edges (x 1,x2),(x2,x3),…,(x n-1,x n ) whose starting vertex is the ending.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
Chapter 4 Graphs.
Curve Curve: The image of a continous map from [0,1] to R 2. Polygonal curve: A curve composed of finitely many line segments. Polygonal u,v-curve: A polygonal.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Graph Theory Chapter 6 Planar Graphs Ch. 6. Planar Graphs.
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,
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Data Structures & Algorithms Graphs
Basic Notions on Graphs. The House-and-Utilities Problem.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
CSS106 Introduction to Elementary Algorithms
Chapter 5 Graphs  the puzzle of the seven bridge in the Königsberg,  on the Pregel.
1 Graphs Theory UNIT IV. 2Contents  Basic terminology,  Multi graphs and weighted graphs  Paths and circuits  Shortest path in weighted graph  Hamiltonian.
Unit – V Graph theory. Representation of Graphs Graph G (V, E,  ) V Set of vertices ESet of edges  Function that assigns vertices {v, w} to each edge.
An Introduction to Graph Theory
Graph Theory and Applications
Graphs and 2-Way Bounding Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois 1 /File:7_bridgesID.png.
Chap. 11 Graph Theory and Applications 1. Directed Graph 2.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Graph Theory Unit: 4.
Chapter 9: 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.
CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.
COMPSCI 102 Introduction to Discrete Mathematics.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
Graphs. Representations of graphs : undirected graph An undirected graph G have five vertices and seven edges An adjacency-list representation of G The.
An Introduction to Graph Theory
Outline 1 Properties of Planar Graphs 5/4/2018.
Graph Theory An Introduction.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Graph Theory CSRU1400, Fall 2007 Ellen Zhang.
CSE 373, Copyright S. Tanimoto, 2001 Graphs 1 -
Chapter 5 Fundamental Concept
Agenda Lecture Content: Introduction to Graph Path and Cycle
EECS 203 Lecture 20 More Graphs.
CSE 421: Introduction to Algorithms
Graph.
Graphs Chapter 13.
CS100: Discrete structures
Decision Maths Graphs.
Graph Theory What is a graph?.
Representing Graphs Wade Trappe.
Discrete Mathematics for Computer Science
Applied Combinatorics, 4th Ed. Alan Tucker
Discrete Math II Howon Kim
Introduction to Graph Theory
Discrete Math II Howon Kim
Concepts of Computation
Agenda Review Lecture Content: Shortest Path Algorithm
Concepts of Computation
Presentation transcript:

Graph theory Definitions Trees, cycles, directed graphs. Eulerian, Hamiltonian Graphs. Special graphs

Graphs and Multigraphs A graph consists of two things: A set V whose elements are called vertices, points, or nodes. A set E of unordered pairs of distinct vertices called edges. We denote such a graph by G(V,E) when we want to emphasize the two parts of a G. Vertices u and v are said to be adjacent if there is an edge {u,v}.

Multi graphs Loop – an edge that has the same vertex at each end Multi-edge – and edge that has the same two endpoints as another edge Multi-graph – a graph that contains at least 1 loop or multi-edge. Example Blue – loops Red - multi edges Black – standard edges

Subgraphs Let G(V,E) be a graph. Let V’ be a subset of V and E’ is a subset of E whose endpoints belong to V’. Then G(V’,E’) is a subgraph of G(V,E)

Degree of a vertex deg(v) If v is an endpoint of an edge e, then we say that e is incident on v. The degree of a vertex deg(v) is the number of edges which are incident on v. The graph below has vertices labeled with their degree.

Connectivity A walk in a multigraph consists of an alternating sequence of vertices and edges of the form 𝑣 0, 𝑒 1, 𝑣 1, 𝑒 2, 𝑣 2, 𝑒 3, … 𝑒 𝑛−1, 𝑣 𝑛−1, 𝑒 𝑛, 𝑣 𝑛 Where each edge 𝑒 𝑖 is incident on 𝑣 𝑛−1 𝑎𝑛𝑑 𝑣 𝑛 If there is a walk from 𝑣 0 𝑡𝑜 𝑣 𝑛 we say 𝑣 0 𝑎𝑛𝑑 𝑣 𝑛 are connected. A trail is a walk where all edges are distinct. A path is a walk where all vertices are distinct. A graph G=(V,E) is connected if all pairs of vertices are connected

Connected components of G(V,E) If G(V,E) is a graph and V ′ ⊂𝑉 𝑎𝑛𝑑 E′⊂𝐸 then G(V’,E’) is a subgraph of G(V,E). A connected component is a connected subgraph that is not contained in any larger connected subgraph. {0,1,4} is a subgraph but not a connected component. {0,1,2,3,4} is a CC

Connected components of G(V,E) A cut point is a vertex where if removed from a Graph G(V,E) (which would consequentially remove all attached edges) would disconnect the graph.

Distance/diameter in connected Graphs Distance between vertices u and v of a connected graph G, written d(u,v) is the length of the shortest path from u to v. The diameter of a connected component is the maximum distance between any two of its vertices

Bridges of Konigsberg Question: Beginning anywhere can a person walk over each bridge exactly once? Legend has it that Euler answered the question.

Bridges of Konigsberg – traversable Such a walk must be a trail since no bridge can be used twice. A graph is said to be traversable is it can be drawn without any breaks in the curve and without repeating any edge, that is, if there is a walk which includes all vertices and uses each edge exactly once.

Bridges of Konigsberg – Side facts The total 𝑣⊂𝑉 deg⁡(𝑣) of any graph must be even because each edge adds 2 to 𝑣⊂𝑉 deg⁡(𝑣) The total number of odd degree vertices must be even If a walk that used every edge started at an even degree vertex, then it must end at that edge. If a walk that used every edge started at an odd degree vertex, then it must end at some other edge. If a walk that used every edge didn’t start at an odd degree vertex, then it must end at that edge.

Bridges of Konigsberg – solved Since the graph has more than 2 odd degree vertices, it can not be traversed. Euler gets credit for solving this.

Eulerian Graph A finite connected graph is Eulerian if and only if each vertex has even degree Any graph with 2 odd degree vertices is traversable.

Hamiltonian Graphs Hamiltonian Cycle is a closed (start and end vertices are the same) walk which includes every vertex exactly once. Such a walk must be a cycle and is called a Hamiltonian Cycle. Any graph that contains Hamiltonian cycle is a Hamiltonian Graph. A path that visits every vertex exactly once is a Hamiltonian Path Ham-Cycle Ham-Path

Special Graphs – k regular A graph is k-regular if every vertex has degree k

Special Graphs - Bipartite If a Graph G(V,E) can have it’s vertices in V partitioned into 2 disjoint sets such that every edge in E connects vertices from one set to the other set, then that graph is said to be bipartite.

Special Graphs - Trees A cycle is a closed walk over a subset of vertices where no edge is traversed more than once. A graph is said to be cycle-free or acyclic if it has no cycles. A connected graph with no cycles is said to be a tree

Special Graphs - Labeled A graph G is said to be labeled if it edges and/or vertices are assigned data of one kind or another. Generally, if edges are assigned a non-negative value it is called the edge’s weight. Weighted labeled graph

Special Graphs - Isomorphic Two graphs are isomorphic to each other if there is a one-to-one correspondence of vertices and the vertices they are connected to.

Special Graphs – Rooted Tree A tree with one special vertex called the root Internal vertex – vertices that are connected to another vertex that is further from the root than itself Leaf vertex – a vertex that is further from the root that any vertex it is adjacent to.

Special Graphs - Planar A graph or multi-graph that can be drawn on a plane without any edges crossing each other is a planar graph. Planar

Special Graphs – Maps and Regions Map – a planar representation of a planer graph. Region – a given map divides a plane into various regions. deg(r) – the degree of a region is length of the closed walk or cycle which borders the region. Theorem: The sum of the degrees of a region of a map is equal to twice the number of edges. 1 4 deg 𝑟 𝑖 =18=2∗9= 2 # 𝐸

Euler’s formula V – E + R = 2 Proof by induction: Take an existing graph and re build it from scratch All graphs start with a vertex 1 - 0 + 1 = 2 holds Repeatedly add edges connected to existing vertices. Each edge will connect to an existing vertex or introduce a new vertex If connecting to an existing vertex: E and R each increment If connecting to a new vertex: V and E each increment

Special Graphs – Colored A vertex coloring or simply coloring, of a graph G is an assignment of colors to the vertices of G such that adjacent vertices have different colors. We say that G is n-colorable if there exists a coloring of G which uses n colors. 4-coloring for the graph

Converting Regions to Vertices If a graph is planar, we can create a corresponding graph that maps regions to vertices. Edges are added to show regions that border on each other.

Special Graphs – Directed A graph G is a directed graph if the edges have orientations.

Spanning Tree of a Graph If G(V,E) is a connected graph, the G(V,E’) if a Spanning Tree if G(V,E’) is connected and contains no cycles. A graph can have many spanning trees. For weighted graphs, the spanning tree(s) with the minimum total weight is called Minimum Spanning Tree (MST)

Vertex Cover of a Graph If G(V,E) is a connected graph, the G(V’,E) if a Vertex Cover (VC) if every edge is connected to a vertex in V’. A graph can have many vertex covers. Of all vertex covers, the one with the lowest |V’| is the minimum vertex cover.

Representing Graphs in Memory Adjacency matrix

Representing Graphs in Memory Adjacency lists