Introduction To Graphs and Networks. Fall 2013 Carola Wenk

Similar documents
Introduction To Graphs and Networks. Fall 2013 Carola Wenk

Graph Data Management Systems in New Applications Domains. Mikko Halin

Ma/CS 6a Class 8: Eulerian Cycles

Chapter 14 Section 3 - Slide 1

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

Today s Outline. CSE 326: Data Structures. Topic #15: Cool Graphs n Pretty Pictures. A Great Mathematician. The Bridges of Königsberg

CS 220: Discrete Structures and their Applications. graphs zybooks chapter 10

Graph Algorithms. Andreas Klappenecker

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Module 11: Additional Topics Graph Theory and Applications

Chapter 10. Fundamental Network Algorithms. M. E. J. Newman. May 6, M. E. J. Newman Chapter 10 May 6, / 33

CSE 373 NOVEMBER 20 TH TOPOLOGICAL SORT

CS 206 Introduction to Computer Science II

Shortest Path Routing Communications networks as graphs Graph terminology Breadth-first search in a graph Properties of breadth-first search

Jessica Su (some parts copied from CLRS / last quarter s notes)

EECS 203 Lecture 20. More Graphs

Network Topology and Graph

CS1 Lecture 31 Apr. 3, 2019

Computer Networks. Routing

Graph Algorithms using Map-Reduce. Graphs are ubiquitous in modern society. Some examples: The hyperlink structure of the web

Unicast Routing. Information About Layer 3 Unicast Routing CHAPTER

Some Graph Theory for Network Analysis. CS 249B: Science of Networks Week 01: Thursday, 01/31/08 Daniel Bilar Wellesley College Spring 2008

Understand graph terminology Implement graphs using

Some major graph problems

Wedge A New Frontier for Pull-based Graph Processing. Samuel Grossman and Christos Kozyrakis Platform Lab Retreat June 8, 2018

GRAPH THEORY: AN INTRODUCTION

Math/Stat 2300 Modeling using Graph Theory (March 23/25) from text A First Course in Mathematical Modeling, Giordano, Fox, Horton, Weir, 2009.

The Human Brain & Graph Theory

Junior Circle Meeting 3 Circuits and Paths. April 18, 2010

Lecture 2. Computer Networks Models. Network Models 1-1

(Re)Introduction to Graphs and Some Algorithms

Computer Science 461 Midterm Exam March 14, :00-10:50am

Discrete Mathematics and Probability Theory Spring 2015 Vazirani Note 5

TA: Jade Cheng ICS 241 Recitation Lecture Note #9 October 23, 2009

Chapter 3: Paths and Cycles

Graph. Vertex. edge. Directed Graph. Undirected Graph

Network Working Group. Category: Informational Bay Networks Inc. September 1997

1. The Highway Inspector s Problem

Graphs and Algorithms

Copyright 2000, Kevin Wayne 1

Configuring CDP. Understanding CDP CHAPTER. This chapter describes how to configure Cisco Discovery Protocol (CDP) on the Catalyst 3560 switch.

From Routing to Traffic Engineering

G(B)enchmark GraphBench: Towards a Universal Graph Benchmark. Khaled Ammar M. Tamer Özsu

Graphs. Tessema M. Mengistu Department of Computer Science Southern Illinois University Carbondale Room - Faner 3131

Algorithms and Data Structures

CSE 100: GRAPH SEARCH

Guide to TCP/IP Fourth Edition. Chapter 6: Neighbor Discovery in IPv6

Figure 1: A directed graph.

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

Lecture 25 Spanning Trees

This appendix contains supplementary Border Gateway Protocol (BGP) information and covers the following topics:

23 DECOMPOSITION OF GRAPHS

Graphs. Terminology. Graphs & Breadth First Search (BFS) Extremely useful tool in modeling problems. Consist of: Vertices Edges

- Logic and Algorithms - Graph Algorithms

An Interactive Introduction to Graph Theory

The Shortest Path Problem

Design and Analysis of Algorithms

Graph Representations and Traversal

Algorithms: Lecture 10. Chalmers University of Technology

Design and Analysis of Algorithms

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

Introduction to computer networking

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

Lecture 3: Graphs and flows

Algorithm Design and Analysis

Internet Architecture

Computer Networks. Routing Algorithms

CS473-Algorithms I. Lecture 14-A. Graph Searching: Breadth-First Search. Cevdet Aykanat - Bilkent University Computer Engineering Department

L22-23: Graph Algorithms

CS 310 Advanced Data Structures and Algorithms

Problem Set 8 Solutions

UNDIRECTED GRAPHS BBM 201 DATA STRUCTURES DEPT. OF COMPUTER ENGINEERING

Outlines: Graphs Part-2

Algorithm Design and Analysis

Lecture 26: Graphs: Traversal (Part 1)

L Modelling and Simulating Social Systems with MATLAB

PATH FINDING AND GRAPH TRAVERSAL

Introduction to Algorithms. Lecture 11. Prof. Patrick Jaillet

Instant Insanity Instructor s Guide Make-it and Take-it Kit for AMTNYS 2006

Algorithms and Data Structures

Chapter 28. Graphs and Applications. Part1. Non-weighted Graphs

Algorithm Design and Analysis

CS 106X, Lecture 23 Dijkstra and A* Search

Fall 2018: Introduction to Data Science GIRI NARASIMHAN, SCIS, FIU

CSE 100: GRAPH ALGORITHMS

Graphs Chapter 24. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Ch.6 Mapping Internet Addresses to Physical Addresses (ARP)

Introduction to Engineering Systems, ESD.00. Networks. Lecturers: Professor Joseph Sussman Dr. Afreen Siddiqi TA: Regina Clewlow

Trees Algorhyme by Radia Perlman

Network Superhighway CSCD 330. Network Programming Winter Lecture 13 Network Layer. Reading: Chapter 4

This course is intended for 3rd and/or 4th year undergraduate majors in Computer Science.

CSE 332: Data Abstractions Lecture 15: Topological Sort / Graph Traversals. Ruth Anderson Winter 2013

Chapter 22 Elementary Graph Algorithms

Graph Search Methods. Graph Search Methods

CSE 373: Data Structures and Algorithms

CS 3410 Ch 14 Graphs and Paths

Graph Search Methods. Graph Search Methods

COT 6405 Introduction to Theory of Algorithms

Quick Review of Graphs

Dijkstra s Algorithm and Priority Queue Implementations. CSE 101: Design and Analysis of Algorithms Lecture 5

Transcription:

Introduction To Graphs and Networks Fall 2013 Carola Wenk

What is a Network? We have thought of a computer as a single entity, but they can also be connected to one another. Internet What are the advantages of connecting computers together? Communication and Computation.

Communication and Computation "A network of such [computers], connected to one another by wideband communication lines [which provided] the functions of presentday libraries together with anticipated advances in information storage and retrieval and [other] symbiotic functions." J.C.R. Licklider, 1960, Man-Computer Symbiosis In 2010, there were 107 trillion emails sent; there are 1.88 billion email users. Communication enables long-distance computation; in fact this is one of the reasons networking was initially studied. Dumb Terminal Mainframe

Communication and Computation Communication also enables coordinated computation; if a task can be split up into smaller parts, we can solve each part simultaneously. Input......... Solve Base Cases...... Solution

Communication and Computation Communication also enables coordinated computation; if a task can be split up into smaller parts, we can solve each part simultaneously. Input......... Internet... Solution

History of the Internet The Internet was initially developed as a military research project in the 1970s. The goal was to connect computers across a wide geographic area with very high availability. Communication on the Internet works by a protocol in which packets of information are transmitted. Each packet is routed from source to destination.

Internet Routing IP Address IP Address Each device connected to the Internet has an IP address, which is just a 32-bit number. The route of each transmitted packet is determined as it moves along its path. Due to the ubiquity of connected devices the current protocol for naming devices will run out of addresses soon - IPv6 uses 128-bit addresses.

Internet Routing TCP/IP = Transmission Control Protocol over Internet Protocol TCP/IP was designed in the early 1970s to be used in a packet switching network. It was initially tested on a 4-node network and now is used on millions of computers. TCP/IP works at a low level to break up communication tasks into packets, and manages how they propagate from source to destination. Internet routers do most of the work in guiding TCP/IP packets; because of this distribution of work, there are often many paths that can be taken from a source to a destination.

Network Abstraction The Internet is modeled as a set of nodes that are connected by links. For the purposes of communication, we only care about how we are able to get from one node to another. How can we determine the best path from point A to point B in a large network? Can this be done efficiently?

Bridges of Königsberg Map of Konigsberg The Abstraction In 1735, Leonhard Euler posed the question of whether there was a path that crossed every bridge exactly once. Is there such a path? Abstracting away from the specific city of Königsberg allows us to answer this question for any city. Do you see a rule?

Graphs: Abstract Networks A graph G consists of a set of vertices that are connected by edges. We write G=(V,E), where V is the set of vertices and E is the set of edges. What is the maximum number of edges a graph can have (i.e., every pair of vertices has one edge)? Generalizing the Königsberg problem, a graph has an Eulerian path if and only if all but two vertices are involved in an even number of edges. Graphs can represent any abstract relationship between pairs of objects, and are particularly useful in analyzing computer networks.

The Internet Graph Nearly every profitable and/or useful application on the Internet must use algorithms on graphs. Example: Google PageRank analyzes the web-graph to determine which pages are most relevant to search queries.

Virtual Networks worldwide facebook graph demographic clustering Social networks aren t formed from physical hardware, but by publicly-stated relationships. By analyzing friendships, social networking companies can gather information for targeted advertising.

Analyzing Graphs Two fundamental questions on graphs: Can we get from any vertex to any other vertex? What is the shortest path from between a given pair of vertices? In a computer network, these questions give us a basic idea of where communication is possible, and how quickly it can be accomplished. In a social network, these questions tell us how social a particular population is, and how well two individuals know one another.

Road networks B A Graph: Vertices are intersections, edges are road segments. What is the shortest path from A to B? Navigation systems answer shortest path queries based on travel times on road segments.

Two Networking Questions Connectivity: Given a graph, is any vertex reachable from any other vertex? Shortest Paths: Given a graph and two vertices, what is the shortest path between the two?

Two Networking Questions Connectivity: Given a graph, is any vertex reachable from any other vertex? Shortest Paths: Given a graph and two vertices, what is the shortest path between the two?

Two Networking Questions Connectivity: Given a graph, is any vertex reachable from any other vertex? Shortest Paths: Given a graph and two vertices, what is the shortest path between the two?

Two Networking Questions Connectivity: Given a graph, is any vertex reachable from any other vertex? Shortest Paths: Given a graph and two vertices, what is the shortest path between the two?

Graph Connectivity Given a graph as input (vertices and edges), we want to produce as output the number of connected components of the input graph. 2 Connected Components

Single-Source Shortest Paths Given a graph as input (vertices and edges) and a vertex, we want to produce as output the shortest paths from to all other vertices. 1 2 1 2 3 3 2 4

Graph Representations Both of these problems require a graph as input. How do we represent the vertices and edges? How can we check if an edge is in the graph?

Graph Representations Both of these problems require a graph as input. How do we represent the vertices and edges? How can we check if an edge is in the graph? With an adjacency list, we can store all edges and examine any edge at any vertex.

Lists and Dictionaries Both of these problems require a graph as input. How do we represent the vertices and edges? How can we check if an edge is in the graph? Python lists and dictionaries allow random access, and dictionaries can have arbitrary keys.

Lists and Dictionaries Both of these problems require a graph as input. How do we represent the vertices and edges? How can we check if an edge is in the graph? Does one of these look like a graph?

Graphs as Dictionaries Both of these problems require a graph as input. How do we represent the vertices and edges? How can we check if an edge is in the graph? The dictionary in Python can implement an adjacency list.

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? How can we find out if a graph is connected?

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? How can we find out if a graph is connected?

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? How can we find out if a graph is connected?

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? How can we find out if a graph is connected?

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? How can we find out if a graph is connected?

Breadth-First Search Now that we have a way to actually implement graphs, how do we solve our two basic problems? The graph is not connected, because we cannot visit any new vertices, but have not visited all of them.

Breadth-First Search This intuitive idea to visit vertices can be made more concrete, but how do we organize our search? How do we keep track of vertices that have been visited? Note that the order of visitation gives us shortest path distances! 1 2 1 2 3 3 2 4

Breadth-First Search To keep track of the order of visitation, we can use a queue. A queue is just a list, but we only remove items from the front, and add items at the end. 1 2 1 2 3 3 2 4

Breadth-First Search Algorithm: 1. Initialize a queue with the starting vertex 2. While the queue is not empty a. Dequeue the next vertex from the queue b. Enqueue all its neighbors that have not been visited/enqueued before 1 2 1 2 3 3 2 4

Breadth-First Search Runtime: Each vertex is enqueued at most once, and therefore dequeued at most once We need to examine each edge once to update distances Runtime O(n+m) where n= V is the number of vertices in G, and m= E is the number of edges in G The runtime is linear in the size of the graph