Some Graph Theory for Network Analysis CS 9B: Science of Networks Week 0: Thursday, 0//08 Daniel Bilar Wellesley College Spring 008
Goals this lecture Introduce you to some jargon what we call things in this field (general) graph theory Terms Representation (more specialized) network theory Node degree Clustering coefficient Geodesic path and diameter
Some general graph theory Undirected, directed graph Paths, lengths of paths Representation of graphs via Adjacency list Adjacency matrix
Graphs In mathematics, networks are called graphs, the entities are nodes, and the links are edges Graph theory starts in the 8th century, with Leonhard Euler The problem of Königsberg bridges Since then graphs have been studied extensively.
Graph Theory Graph G=(V,E) V = set of vertices E = set of edges An edge is defined by the two vertices which it connects optionally: A direction and/or a weight Two vertices are adjacent if they are connected by an edge A vertex s degree is the number of its edges
Graph Theory Graph G=(V,E) V = set of vertices E = set of edges Each edge is now an arrow, not just a line -> direction The indegree of a vertex is the number of incoming edges The outdegree of a vertex is the number of outgoing edges 6
Undirected graph degree d(i) of node i number of edges incident on node i degree sequence [d(),d(),d(),d(),d()] [,,,,] degree distribution [(,)(,) (,)] 7
Directed Graph in-degree d in (i) of node i number of edges pointing to node i out-degree d out (i) of node i number of edges leaving node i in-degree sequence [,,,,] out-degree sequence [,,,,0] 8
Directed Graph Strongly connected graph: there exists a path from every i to every j Weakly connected graph: If edges are made to be undirected the graph is connected 9
Undirected graph Connected graph: a graph where there every pair of nodes is connected Disconnected graph: a graph that is not connected Connected Components: subsets of vertices that are connected 0
Paths Path from node i to node j: a sequence of edges (directed or undirected from node i to node j) path length: number of edges on the path nodes i and j are connected cycle: a path that starts and ends at the same node
Shortest Paths Shortest Path from node i to node j also known geodesic path
Diameter The longest shortest path in the graph
Fully Connected Graph Clique K n A graph that has all possible n(n-)/ edges
Two abstract graph representations Adjacency matrix n vertices need a n x n matrix (where n = V, i.e. the number of vertices in the graph) - can store as an array Each position in the matrix is if the two vertices are connected, or 0 if they are not For weighted graphs, the position in the matrix is the weight Adjacency list For each vertex, store a linked list of adjacent vertices For weighted graphs, include the weight in the elements of the list
Representing a graph () This graph has no weights and no direction on the edges :M 0:E Adjacency matrix 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 :P :B :L Adjacency list 0 0 0 6
Representing a graph () This graph has no weights but it has directions on the edges :M 0:E Adjacency matrix 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 :P :B :L Adjacency list 0 0 7
Representing a graph () This graph has weights but no direction on the edges :M 60 0 90 0:E 0 0 0 0 0 0 0 0 0 0 60 90 0 0 60 0 0 00 0 90 0 0 0 0 0 00 0 0 Adjacency matrix :P 00 :B 0 :L 0 ;0 0;0 ;0 ;60 ;90 ;60 ;0 ;00 0;0 ;90 ;0 ;00 Adjacency list 8
What have we done today? Network Metrics Vertex i in/out degree k i How many edges go in/out a particular vertex i? Clustering coefficient C i of vertex i How close is neighborhood of vertex i to being a clique? Geodesic distance l i,j between vertices i and j The shortest path connecting i and j We may also look at <l>, the average geodesic distance between vertex pairs in G Diameter diam(g) of the graph The longest geodesic path through the network Network/Graph abstract representations Adjacency list Adjacency matrix 9
For Monday We ll have the first of our quizzes Review these notes We will start with basic probability theory on various metrics of graphs for the next two lectures 0