CompSci 100e 10.1 Is there a Science of Networks? l What kinds of networks are there? l From Bacon numbers to random graphs to Internet  From FOAF to.

Slides:



Advertisements
Similar presentations
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Advertisements

GRAPHS Trees Without Rules. Graph  A data structure that consists of a set of nodes (called vertices) and a set of edges that relate the nodes to each.
Graph A graph, G = (V, E), is a data structure where: V is a set of vertices (aka nodes) E is a set of edges We use graphs to represent relationships among.
Graph Searching CSE 373 Data Structures Lecture 20.
Sociology and CS Philip Chan. How close are people connected? Are people closely connected, not closely connected, isolated into groups, …
Breadth-First and Depth-First Search
Chapter 8, Part I Graph Algorithms.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
CS171 Introduction to Computer Science II Graphs Strike Back.
Graphs.
Graph.
CS 206 Introduction to Computer Science II 11 / 11 / Veterans Day Instructor: Michael Eckmann.
CSE332: Data Abstractions Lecture 16: Topological Sort / Graph Traversals Tyler Robison Summer
Graph & BFS.
CS 311 Graph Algorithms. Definitions A Graph G = (V, E) where V is a set of vertices and E is a set of edges, An edge is a pair (u,v) where u,v  V. If.
CS 728 Lecture 4 It’s a Small World on the Web. Small World Networks It is a ‘small world’ after all –Billions of people on Earth, yet every pair separated.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Graphs.
Graphs. Graph definitions There are two kinds of graphs: directed graphs (sometimes called digraphs) and undirected graphs Birmingham Rugby London Cambridge.
1 Data Structures and Algorithms Graphs I: Representation and Search Gal A. Kaminka Computer Science Department.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
CS 206 Introduction to Computer Science II 11 / 03 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 03 / 25 / 2009 Instructor: Michael Eckmann.
CS 1114: Graphs and Blobs Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
CISC220 Fall 2009 James Atlas Nov 13: Graphs, Line Intersections.
Social Media Mining Graph Essentials.
The Science of Networks 1.1 Welcome! CompSci 96: The Science of Networks SocSci 119 M,W 1:15-2:30 Professor: Jeffrey Forbes
CPS Graphs, the Internet, and Everything
1 Abstract Data Type We have discussed: List Tree Today we will talk about Graph.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
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,
Chapter 2 Graph Algorithms.
Small World Social Networks With slides from Jon Kleinberg, David Liben-Nowell, and Daniel Bilar.
CompSci Today’s topics Networks ä Definitions ä Modeling ä Analysis ä Slides from Michael Kearns - Univ. of Pennsylvania ä Slides from Patrick.
Social Network Basics CS315 – Web Search and Data Mining.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Graphs.
Compsci 100, Spring Graphs, the Internet, and Everything
Graphs. Definitions A graph is two sets. A graph is two sets. –A set of nodes or vertices V –A set of edges E Edges connect nodes. Edges connect nodes.
CompSci 100e 12.1 Is there a Science of Networks? l What kinds of networks are there? l From Bacon numbers to random graphs to Internet  From FOAF to.
CISC 235: Topic 9 Introduction to Graphs. CISC 235 Topic 92 Outline Graph Definition Terminology Representations Traversals.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Graph Introduction, Searching Graph Theory Basics - Anil Kishore.
CompSci Problem: finding subsets l See CodeBloat APT, requires finding sums of all subsets  Given {72, 33, 41, 57, 25} what is sum closest (not.
1 Spanning Trees Longin Jan Latecki Temple University based on slides by David Matuszek, UPenn, Rose Hoberman, CMU, Bing Liu, U. of Illinois, Boting Yang,
1 Directed Graphs Chapter 8. 2 Objectives You will be able to: Say what a directed graph is. Describe two ways to represent a directed graph: Adjacency.
Graphs Slide credits:  K. Wayne, Princeton U.  C. E. Leiserson and E. Demaine, MIT  K. Birman, Cornell U.
Graphs Upon completion you will be able to:
CompSci Graphs, the Internet, and Everything
Small World Social Networks With slides from Jon Kleinberg, David Liben-Nowell, and Daniel Bilar.
CompSci The Internet l How valuable is a network? ä Metcalfe’s Law l Domain Name System: translates betweens names and IP addresses l Properties.
CPS Graphs: Structures and Algorithms l How do packets of bits/information get routed on the internet  Message divided into packets on client.
Class 2: Graph Theory IST402. Can one walk across the seven bridges and never cross the same bridge twice? Network Science: Graph Theory THE BRIDGES OF.
Class 2: Graph Theory IST402.
Chapter 05 Introduction to Graph And Search Algorithms.
1 GRAPHS – Definitions A graph G = (V, E) consists of –a set of vertices, V, and –a set of edges, E, where each edge is a pair (v,w) s.t. v,w  V Vertices.
The Internet Domain Name System: translates betweens names and IP addresses Properties of the Internet Heterogeneity Redundancy Packet-switched 604 million.
Data Structures Graphs - Terminology
Graphs, the Internet, and Everything
Owen Astrachan Jeff Forbes December 6, 2018
C.Eng 213 Data Structures Graphs Fall Section 3.
I206: Lecture 15: Graphs Marti Hearst Spring 2012.
CS120 Graphs.
Graphs Chapter 11 Objectives Upon completion you will be able to:
Network Graph Chuck Alice Vertices Nodes Edges Links Bob.
Graphs Chapter 7 Visit for more Learning Resources.
Graphs: Definitions How would you represent the following?
Lecture 10 Graph Algorithms
Presentation transcript:

CompSci 100e 10.1 Is there a Science of Networks? l What kinds of networks are there? l From Bacon numbers to random graphs to Internet  From FOAF to Selfish Routing: apparent similarities between many human and technological systems & organization  Modeling, simulation, and hypotheses  Compelling concepts Metaphor of viral spread Properties of connectivity has qualitative and quantitative effects  Computer Science? l From the facebook to tomogravity  How do we model networks, measure them, and reason about them?  What mathematics is necessary?  Will the real-world intrude?

CompSci 100e 10.2 From subsets to graphs with bits l We’ll consider SequenceSync APT  What is a “vertex” in the graph? Where are arcs?  For state-0, we have {1,5,4,2} for transitions l We’ll consider a graph in which vertices are sets of states  Start with every possible state in our initial vertex

CompSci 100e 10.3 Review: Vocabulary l Graphs are collections of vertices and edges (vertex also called node)  Edge connects two vertices Direction can be important, directed edge, directed graph Edge may have associated weight/cost l A vertex sequence v 0, v 1, …, v n-1 is a path where v k and v k+1 are connected by an edge.  If some vertex is repeated, the path is a cycle  A graph is connected if there is a path between any pair of vertices l What vertices are reachable from a given vertex?  Traverse the graph… NYC Phil Boston Wash DC LGALAX ORD DCA $186 $412 $1701 $441

CompSci 100e 10.4 Word ladder

CompSci 100e 10.5 Vocabulary/Traversals l Connected?  Connected components? Weakly connected (directionless)  Degree: # edges incident a vertex indegree (enter), outdegree (exit) l Starting at 7 where can we get?  Depth-first search, envision each vertex as a room, with doors leading out Go into a room, mark the room, choose an unused door, exit –Don’t go into a room you’ve already been in (see mark) Backtrack if all doors used (to room with unused door)  Rooms are stacked up, backtracking is really recursion  One alternative uses a queue: breadth-first search

CompSci 100e 10.6 Six Degrees of Bacon l Background  Stanley Milgram’s Six Degrees of Separation?  Craig Fass, Mike Ginelli, and Brian Turtle invented it as a drinking game at Albright College  Brett Tjaden, Glenn Wasson, Patrick Reynolds have run t online website from UVa and beyond  Instance of Small-World phenomenon l handles 2 kinds of requests 1. Find the links from Actor A to Actor B. 2. How good a center is a given actor?  How does it answer these requests?

CompSci 100e 10.7 How does the Oracle work? l Not using Oracle™ l Queries require traversal of the graph BN = 0 Mystic River Apollo 13 Footloose John Lithgow Sarah Jessica Parker Bill Paxton Tom Hanks Sean Penn Tim Robbins BN = 1 Kevin Bacon

CompSci 100e 10.8 How does the Oracle Work? Kevin Bacon Mystic River Apollo 13 Footloose John Lithgow Sarah Jessica Parker Bill Paxton Tom Hanks Sean Penn Tim Robbins BN = 0 BN = 1 Sweet and Lowdown Fast Times at Ridgemont High War of the Worlds The Shawshank Redemption Cast Away Forrest Gump Tombstone A Simple Plan Morgan Freeman Sally Field Helen Hunt Val Kilmer Miranda Otto Judge Reinhold Woody Allen Billy Bob Thornton BN = 2 l BN = Bacon Number l Queries require traversal of the graph

CompSci 100e 10.9 How does the Oracle work? Mystic River Footloose John Lithgow Sarah Jessica Parker Tom Hanks Sean Penn Tim Robbins BN = 0 BN = 1 Sweet and Lowdown Fast Times at Ridgemont High War of the Worlds The Shawshank Redemption Cast Away Forrest Gump A Simple Plan Morgan Freeman Sally Field Helen Hunt Miranda Otto Judge Reinhold Woody Allen Billy Bob Thornton BN = 2 Bill Paxton Tombstone Val Kilmer Apollo 13 Kevin Bacon l How do we choose which movie or actor to explore next? l Queries require traversal of the graph

CompSci 100e Actor-Actor Graph

CompSci 100e Movie-Movie Graph

CompSci 100e Actor-Movie Graph

CompSci 100e Traversals l Connected?  Connected components?  Degree: # edges incident a vertex l Starting at Bacon where can we get?  Random search, choose a neighboring vertex at random Can we move in circles?  Depth-first search, envision each vertex as a room, with doors leading out Go into a room, mark the room, choose an unused door, exit –Don’t go into a room you’ve already been in (see mark) Backtrack if all doors used (to room with unused door)  Rooms are stacked up, backtracking is really recursion  One alternative uses a queue: breadth-first search

CompSci 100e Breadth first search l In an unweighted graph this finds the shortest path between a start vertex and every vertex  Visit every node one away from start  Visit every node two away from start This is every node one away from a node one away  Visit every node three away from start, … l Put vertex on queue to start (initially just one)  Repeat: take vertex off queue, put all adjacent vertices on  Don’t put a vertex on that’s already been visited (why?)  When are 1-away vertices enqueued? 2-away? 3-away?  How many vertices on queue?

CompSci 100e General graph traversal COLLECTION_OF_VERTICES fringe; fringe = INITIAL_COLLECTION; while (!fringe.isEmpty()) { Vertex v = fringe.removeItem(QUEUE_FN); if (! MARKED(v)) { MARK(v); VISIT(v); for each edge (v,w) { if (NEEDS_PROCESSING(w)) Add w to fringe according to QUEUE_FN; }

CompSci 100e Breadth-first search l Visit each vertex reachable from some source in breadth-first order l Like level-order traversal Queue fringe; fringe = {v}; while (!fringe.isEmpty()) { Vertex v = fringe.dequeue(); if (! getMark(v)) { setMark(v); VISIT(v); for each edge (v,w) { if (MARKED(w)) fringe.enqueue(w); } l How do we change to make depth-first search?  How does the order visited change?

CompSci 100e Center of the Hollywood Universe? l 1,018,678 people can be connected to Bacon l Is he the center of the Hollywood Universe?  Who is?  Who are other good centers?  What makes them good centers? l Centrality  Closeness: the inverse average distance of a node to all other nodes Geodesic: shortest path between two vertices Closeness centrality: number of other vertices divided by the sum of all distances between the vertex and all others.  Degree: the degree of a node  Betweenness: a measure of how much a vertex is between other nodes

CompSci 100e Closeness Centrality An actor is important if she is relatively close to all other actors  Jordan Centrality uses the inverse of the length of the longest path to any other vertex where d(x,y) is the length of shortest path between x and y

CompSci 100e Degree Centrality Actor with the most ties is the most important  A purely local measure where e ij is 1 if an v i and v j are adjacent, 0 otherwise

CompSci 100e Betweenness Centrality An actor who lies on communication paths can control communication flow, and is thus important  Information Centrality uses all paths in the network, and weights them based on their length. where g jk = the number of geodesics connecting jk, and g jk (v i ) = the number that actor i is on.