Week 6 - Wednesday CS 113.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Great Theoretical Ideas in Computer Science for Some.
Breadth-First Search Seminar – Networking Algorithms CS and EE Dept. Lulea University of Technology 27 Jan Mohammad Reza Akhavan.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 27 Graph Applications.
Midterm <  70 3.
Finding a Maximum Matching in Non-Bipartite Graphs Alicia Thilani Singham Goodwin /22/2013.
Great Theoretical Ideas in Computer Science.
Last time: terminology reminder w Simple graph Vertex = node Edge Degree Weight Neighbours Complete Dual Bipartite Planar Cycle Tree Path Circuit Components.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
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.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Social Media Mining Graph Essentials.
Week 11 - Friday.  What did we talk about last time?  Exam 2 post mortem  Cycle detection  Connectivity.
Lecture 12-2: Introduction to Computer Algorithms beyond Search & Sort.
The Traveling Salesman Problem Approximation
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
Graph Theory Topics to be covered:
GRAPHS CSE, POSTECH. Chapter 16 covers the following topics Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component,
Graphs Rosen, Chapter 8. Isomorphism (Rosen 560 to 563) Are two graphs G1 and G2 of equal form? That is, could I rename the vertices of G1 such that the.
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.
Module 5 – Networks and Decision Mathematics Chapter 23 – Undirected Graphs.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Mathematics of Networks (Cont)
Data Structures & Algorithms Graphs
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
5.8 Graph Matching  Example: Set of worker assign to a set of task  Four tasks are to be assigned to four workers.  – Worker 1 is qualified to do tasks.
Week 12 - Monday.  What did we talk about last time?  Topological sort and cycle detection in directed graphs  Connectivity  Strong connectivity.
Graphs and MSTs Sections 1.4 and 9.1. Partial-Order Relations Everybody is not related to everybody. Examples? Direct road connections between locations.
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 Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
GRAPHS. Graph Graph terminology: vertex, edge, adjacent, incident, degree, cycle, path, connected component, spanning tree Types of graphs: undirected,
Graph Theory Unit: 4.
Week 15 – Friday.  What did we talk about last time?  Student questions  Review up to Exam 2  Recursion  Binary trees  Heaps  Tries  B-trees.
Graph Concepts and Algorithms Using LEDA By Caroline Moore and Carmen Frerichs (252a-at and 252a-ao) each graph in the presentation was created using gw_basic_graph_algorithms.
Graph Concepts Elif Tosun 252a-aa (All graphics created by using demo/graphwin/gw*)
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.
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.
Indian Institute of Technology Kharagpur PALLAB DASGUPTA Graph Theory: Matchings and Factors Pallab Dasgupta, Professor, Dept. of Computer Sc. and Engineering,
Graph Terms By Susan Ott. Vertices Here are 7 vertices without any edges Each Vertex is labeled a different color and number.
Week 6 - Monday.  What did we talk about last time?  Artificial intelligence  Lab 5.
Week 7 - Monday CS 113.
IOI/ACM ICPC Training 4 June 2005.
Week 10 - Monday CS 113.
Redraw these graphs so that none of the line intersect except at the vertices B C D E F G H.
Minimum Spanning Tree Chapter 13.6.
Graph theory Definitions Trees, cycles, directed graphs.
Week 15 – Friday CS221.
Week 11 - Monday CS221.
Great Theoretical Ideas in Computer Science
GRAPH-THEORY AND APPLICATIONS
Discrete Mathematics for Computer Science
Graph Theory.
Graphs Chapter 13.
Maximum Flows of Minimum Cost
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Week 10 - Wednesday CS221.
Lecture 24 Vertex Cover and Hamiltonian Cycle
Week 5 - Friday CS 121.
Presentation transcript:

Week 6 - Wednesday CS 113

Last time What did we talk about last time? Exam 1 post-mortem Programming practice

Project 2

Graph a sine curve We can show a sine curve Using a while loop, we can make a lot of x values between -10 and 10 We can use the sin() function to find the corresponding y location Then we put a small red sphere at each location

Graph Theory A completely different kind of graph than what we just talked about!

What is a graph? Vertices (Nodes) Edges

What can graphs represent? Friendships on Facebook Steps in a task Nodes: Subtasks Nodes: People Edges: Decisions Edges: Friendship Routes between cities 6 degrees of Kevin Bacon Nodes: Cities Edges: Streets Nodes: Actors Edges: Whether or not they've been in a movie together

Lots of flavors of graphs Labeled Weighted Colored Multigraphs E A D B F C A 5 6 4 3 2 3 E 5 B D F C 7 1

No Triangle Inequality When a weighted graph obeys the triangle inequality, the direct route to a node is always fastest 1 4 2 3 5 No Triangle Inequality 1 2 4 3 5 Triangle Inequality

Directed graphs Some graphs have edges with direction Example: One way streets Reachability? ONE WAY E A D B F C

Connected graphs Often we talk about connected graphs But, not all graphs have to be connected

The other extreme Complete graphs Every node is connected to every other How many edges? |E| = ½(n(n – 1)) = ½(n2 – n) is O(n2)

Subgraphs We can talk about a part of a graph For example, what is the largest complete subgraph in this graph? A E B D F C

Paths A path is a sequence of connected nodes The cost or weight of the path is usually the sum of the edge weights This path from A to C costs 5 A 5 6 4 3 2 3 E B D 3 F 7 C

Cycles A cycle is a path that starts at a node and comes back to the same node How many cycles of length 3 does this graph have? What about 4? 5? 6? A D B A E B D F C

Tours A tour is a path that visits every node and (usually) returns to its starting node In other words, it's a cycle that visits every node This tour costs 24 A 5 6 4 3 2 3 E B D 3 F 7 C

Matching

Bipartite graphs A bipartite graph is one whose nodes can be divided into two disjoint sets X and Y There can be edges between set X and set Y There are no edges inside set X or set Y A graph is bipartite if and only if it contains no odd cycles

Bipartite graph X A B C D E F Y A B C D E F

Maximum matching A perfect matching is when every node in set X and every node in set Y is matched It is not always possible to have a perfect matching We can still try to find a maximum matching in which as many nodes are matched up as possible

Matching algorithm Come up with a legal, maximal matching Take an augmenting path that starts at an unmatched node in X and ends at an unmatched node in Y If there is such a path, switch all the edges along the path from being in the matching to being out and vice versa If there is another augmenting path, go back to Step 2

X Y Match the graph Anna Becky Caitlin Daisy Erin Fiona A B C D E F A Adam Ben Carlos Dan Evan Fred

Quiz

Upcoming

Next time… Stable marriage Euler paths and tours Minimum spanning trees Lab 6

Reminders Start working on Project 2 Read Python Chapter 5 Think about what you want to do for your Final Project Proposal due by 3/31