CSS106 Introduction to Elementary Algorithms

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.
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.
Introduction to Graphs
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
1 Section 8.2 Graph Terminology. 2 Terms related to undirected graphs Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in.
Introduction to Graphs Lecture 18: Nov 16. Seven Bridges of Königsberg Is it possible to walk with a route that crosses each bridge exactly once?
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
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.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Social Media Mining Graph Essentials.
9.2 Graph Terminology and Special Types Graphs
GRAPH Learning Outcomes Students should be able to:
Graphs Chapter 10.
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,
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
CSE, IIT KGP Graph Theory: Introduction Pallab Dasgupta Dept. of CSE, IIT
Data Structures Week 9 Introduction to Graphs Consider the following problem. A river with an island and bridges. The problem is to see if there is a way.
1 CS104 : Discrete Structures Chapter V Graph Theory.
CS 200 Algorithms and Data Structures
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Introduction Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
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.
Data Structures & Algorithms Graphs
Basic Notions on Graphs. The House-and-Utilities Problem.
Chapter 1 Fundamental Concepts Introduction to Graph Theory Douglas B. West July 11, 2002.
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.
CISC 235: Topic 9 Introduction to Graphs. CISC 235 Topic 92 Outline Graph Definition Terminology Representations Traversals.
Unit 5 Graphs & Trees 1 IT Discipline ITD1111 Discrete Mathematics & Statistics STDTLP Unit 5 Discrete Mathematics and Statistics Graphs and Trees.
Introduction to Graph Theory
Graph Theory and Applications
Lecture 10: Graph-Path-Circuit
Introduction to Graphs. This Lecture In this part we will study some basic graph theory. Graph is a useful concept to model many problems in computer.
Graphs 9.1 Graphs and Graph Models أ. زينب آل كاظم 1.
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
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Introduction to Graph Theory Lecture 17: Graph Searching Algorithms.
 Quotient graph  Definition 13: Suppose G(V,E) is a graph and R is a equivalence relation on the set V. We construct the quotient graph G R in the follow.
Discrete Structures CISC 2315 FALL 2010 Graphs & Trees.
Graph Theory Unit: 4.
CSE, IIT KGP Graph Theory: Introduction Pallab Dasgupta Dept. of CSE, IIT
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.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
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.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Chapter Chapter Summary Graphs and Graph Models Graph Terminology and Special Types of Graphs Representing Graphs and Graph Isomorphism Connectivity.
An Introduction to Graph Theory
CSE 373, Copyright S. Tanimoto, 2001 Graphs 1 -
Grade 11 AP Mathematics Graph Theory
Chapter 5 Fundamental Concept
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Can you draw this picture without lifting up your pen/pencil?
Graphs Chapter 13.
CSE 373, Copyright S. Tanimoto, 2002 Graphs 1 -
Graphs Discrete Structure CS203.
Graph Theory What is a graph?.
Representing Graphs Wade Trappe.
Discrete Math II Howon Kim
Introduction to Graph Theory
Discrete Math II Howon Kim
Presentation transcript:

CSS106 Introduction to Elementary Algorithms M.Sc Askar Satabaldiyev Lecture 06: Introduction to Graph Theory

Europe-Asia: queue behavior

Europe-Asia: noise level at restaurant

Europe-Asia: the way to solve a problem

Europe-Asia: behavior on parties

Europe-Asia: people know each other

Cosmin Negruseri, problem setter in Google Code Jam, trainer for the Romanian IOI team Google Search uses pagerank as an important quality signal. The Facebook news feed uses something similar called edgerank to rank the information from your friends. String segmentation is a natural language processing problem which occurs in languages like Chinese. It's frequently tackled as a shortest path problem. Google Navigation and Google Directions on top of Google Maps uses some very efficient planar graph shortest path algorithms. Real time strategy games like Starcraft use fast pathfinding algorithms like  A star to route units on the map. Compilers use graph traversals to find code dependencies. Like Erik mentions, memory garbage collection strategies may use graph traversals. Stable matching algorithms are used to match residents to hospitalsand kidneys to donors.  Hamiltonean paths and Euler paths occur in the Gene Sequencing problem.

Definition of Graph Graph G is an ordered pair of disjoint sets (V, E), where E⊆V × V. Set V is called the vertex or node set, while set E is the edge set of graph G

Directed and Undirected Graph A graph G = (V, E) is directed if the edge set is composed of ordered vertex (node) pairs. A graph is undirected if the edge set is composed of unordered vertex pair.

Vertex Cardinality The number of vertices, the cardinality of V, is called the order of graph and devoted by |V|. usually use n to denote the order of G The number of edges, the cardinality of E, is called the size of graph and denoted by |E| Usually use m to denote the size of G

Neighbor Vertex vivj ⊆ E(G) to mean {vi, vj}⊆ E(G), and if e = vi vj ⊆ E(G), we say vi and vj are adjacent.

Vertex Degree Given a graph G = (V, E), the degree of a vertex v ⋲ V is the number of its neighbors in the graph. That is, deg(v) = | {u ⋲ V : (v, w) ⋲ E}|. If G is directed, we distinguish between in-degree (number of incoming neighbors) and out- degree (number of outgoing neighbors) of a vertex.

Loop and Multiple Edges an edge joining a vertex to it self is called a loop graph has multiple edges if in the graph two or more edges joining the same pair of vertices

Simple Graph A graph with no loops or multiple edges is called a simple graph.

Connected Graph A graph G is connected if there is a path in G between any given pair of vertices, otherwise it is disconnected.

Subgraph Let G be a graph with vertex set V(G) and edge-list E(G). A subgraph of G is a graph all of whose vertices belong to V(G) and all of whose edges belong to E(G)

Regular Graph A graph is regular if all the vertices of G have the same degree.

The Handshaking Lemma In any graph, the sum of all the vertex-degree is equal to twice the number of edges. Proof    Since each edge has two ends, it must contribute exactly 2 to the sum of the degrees. In any graph, the sum of all the vertex-degree is an even number. In any graph, the number of vertices of odd degree is even. If G is a graph which has n vertices and is regular of degree r, then G has exactly 1/2 nr edges

Walk A walk of length k in a graph G is a succession of k edges of G of the form uv, vw, wx, . . . , yz. We denote this walk by uvwx…yz and refer to it as a walk between u and z

Trail and Path If all the edges (but no necessarily all the vertices) of a walk are different, then the walk is called a trail. If, in addition, all the vertices are difficult, then the trail is called path. The walk vzzywxy is a trail since the vertices y and z both occur twice. The walk vwxyz is a path since the walk has no repeated vertices.

Complete Graphs A complete graph is a graph in which every two distinct vertices are joined by exactly one edge. The complete graph with n vertices is denoted by  Kn. How many edges does complete graph Kn have?

Null Graphs A null graphs is a graph containing no edges. The null graph with n vertices is denoted by Nn

Cycle Graphs A cycle graph is a graph consisting of a single cycle. The cycle graph with n vertices is denoted by Cn

Bipartite Graphs bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint sets U and V (that is, U and V are each independent sets) such that every edge connects a vertex in U to one in V

Complete Bipartite Graph Complete bipartite graph or biclique is a special kind of bipartite graph where every vertex of the first set is connected to every vertex of the second set

Tree Graph A tree is a connected graph which has no cycles.

Spanning Tree If G is a connected graph, the spanning tree in G is a subgraph of G which includes every vertex of G and  is also a tree. Consider this graph:

Consider the intervals: Interval Graphs Consider the intervals: (0, 3), (2, 7), (-1, 1), (2, 3), (1, 4), (6, 8)

Bridges in Königsberg Königsberg is divided into four parts by the river Pregel, and connected by seven bridges. Is it possible to tour Königsberg along a path that crosses every bridge once, and at most once? You can start and finish wherever you want, not necessarily in the same place.

Other examples

Other examples: with hint

Bridges in Königsberg: revisited yes/no?