Graph Theory COURSE: Introduction to Biological Networks
LECTURE 1: INTRODUCTION TO NETWORKS Arun Krishnan
HISTORY
HISTORY KOENIGSBERG HISTORY
• Koenigsberg, Russia • Is it possible to walk with a route that crosses each bridge exactly once, and return to the starting point?
Graph Theory
HISTORY KOENIGSBERG HISTORY
Euler’s Solution
KOENIGSBERG KOENIGSBERG
• Euler ( 1783
1707 -
Graph Representation
1
Graph Theory Graph & Edge
CONCEPTS KOENIGSBERG HISTORY
Graoh Theory - Concepts
Directed Graph Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Graph Theory Size & Order
CONCEPTS KOENIGSBERG HISTORY
2
Graph Theory Density
CONCEPTS KOENIGSBERG HISTORY
DegreeGraph Theory & Degree Sequence
CONCEPTS KOENIGSBERG HISTORY
Indegree & Theory Graph Outdegree
CONCEPTS KOENIGSBERG HISTORY
Degree Distribution Graph Theory
CONCEPTS KOENIGSBERG HISTORY
3
Graph Theory Subgraph
CONCEPTS KOENIGSBERG HISTORY
Path & Theory Graph Length
CONCEPTS KOENIGSBERG HISTORY
Euler’s Solution
KOENIGSBERG KOENIGSBERG
Back to Euler’s Solution
• • An Eulerian cycle, Eulerian circuit or Euler tour in an undirected graph is a cycle that uses each edge exactly once. If such a cycle exists, the graph is called Eulerian or unicursal. A connected undirected graph is Eulerian if and only if every graph vertex has even degree.
The first Theorem in Graph Theory!!! EVERY edge here has an odd degree
4
Graph Theory Geodesic
CONCEPTS KOENIGSBERG HISTORY
Graph Theory - Concepts Cont..
Connectedness & Component Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Empty Graph Theory & Complete Graphs
CONCEPTS KOENIGSBERG HISTORY
5
Star & Cyclic Graphs Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Graph Theory Tree & Forest
CONCEPTS KOENIGSBERG HISTORY
BipartiteTheory Graph Graphs
CONCEPTS KOENIGSBERG HISTORY
Cutpoint
CONCEPTS KOENIGSBERG HISTORY
6
Graph Theory Bridge
CONCEPTS KOENIGSBERG HISTORY
Graph Theory Connectivity
CONCEPTS KOENIGSBERG HISTORY
Edge Connectivity Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Vertex Centrality - 1 Graph Theory
CONCEPTS KOENIGSBERG HISTORY
7
Vertex Centrality - 2 Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Vertex Centrality - 3 Graph Theory
CONCEPTS KOENIGSBERG HISTORY
Shortest GraphMean Path Length Path & Theory
CONCEPTS KOENIGSBERG HISTORY
Clustering Theory Graph Coefficient
• CI = 2nI /k(k-1)
CONCEPTS KOENIGSBERG HISTORY
• Path Length: Number of links to pass through to go between two nodes • Example
– 1-2:1 – 1 - 7:
• 1-3-5-7: 3 • 1-2-4-5-7:4 • 1-2-4-5-6-7:5
– k = # of nodes that link to I – nI = number of links between the nodes that link to I
• Essentially find out the number of triangles that pass through node I. • Example
– Node A has only 1 triangle passing through it – CA = 2/(5*4) = 0.1
• Mean Path Length:
– Average of shortest paths between all pairs of nodes – Measure of a network’s overall navigability
8
Is this Graph Theory a connected graph?
2 3 Cyclic or Acyclic?
QUIZ BREAK KOENIGSBERG HISTORY
QUIZ BREAK
1
Directed or Undirected? 4
6 5
DirectedGraph Theory Graph (Unconnected)
2 3 Cyclic or Acyclic? 4 1 6 5
QUIZ BREAK KOENIGSBERG HISTORY
Representing Graphs
9
Adjacency Matrix & List Graph Theory
• Adjacency matrix
– 2-dimensional array – For each edge (u,v), set A[u][v] to true; otherwise false
GRAPH KOENIGSBERG HISTORY REPRESENTATION
Laplacian Matrix Graph Theory
GRAPH KOENIGSBERG HISTORY REPRESENTATION
1 1 2 3 4 5 6 7
1 7
2
3 x
4 x x
5 x
6
7
x x
x x
• Adjacency lists
– For each vertex, keep a list of adjacent vertices
1 2 3 4 5 6 7
x x
3 4 6 3 4
4 5 6 7 3
2
4
5
6
7
Choosing A Representation Graph Theory
• Size of V relative to size of E is a primary factor.
GRAPH KOENIGSBERG HISTORY REPRESENTATION
– Dense: |E|/|V| is large – Sparse: |E|/|V| is small – Adjacency matrix is expensive in terms of space if the graph is sparse (O(|V|2 > O(|E|+|V|)). – Adjacency list is expensive in terms of checking edges if the graph is dense.
Graphs are EVERYWHERE!
10
Graphs as Models Graph Theory
• The Internet
– Communication pathways – DNS hierarchy – The WWW
EXAMPLES KOENIGSBERG HISTORY
Graphs as Models Graph Theory
EXAMPLES KOENIGSBERG HISTORY
• Physical objects are often modeled by meshes, which are a particular kind of graph structure.
• The physical world
– – – – Road topology and maps Airline routes and fares Electrical circuits Job and manufacturing scheduling
By Jonathan Shewchuk
Graphs as Models Graph Theory
EXAMPLES KOENIGSBERG HISTORY
World Wide Web Graph Theory
• Nodes:
EXAMPLES KOENIGSBERG HISTORY
– Internet Servers
• Connections
– Links
NASA CFD labs By Paul Heckbert and David Garland See also http://java.sun.com/applets/jdk/1.1/demo/WireFrame/index.html and http://www.mapquest.com
11
Food Web Graph Atlantic North Theory
EXAMPLES KOENIGSBERG HISTORY
Social Co-Authorship Network Max Plank Institute
Graph Theory
EXAMPLES KOENIGSBERG HISTORY
• Nodes:
– Species
• Nodes:
– Researchers
• Connections
– Predator-prey
• Connections
– Co-authorship
Economic Network Graph Theory World Trade 1992
EXAMPLES KOENIGSBERG HISTORY
Yeast Protein Interaction Network Graph Theory
EXAMPLES KOENIGSBERG HISTORY
• Nodes:
– Countries
• Connections
– Trade Volume
• Nodes:
– Proteins
• Connections
– Protein-Protein Interactions
12
Protein Network Graph Theory
EXAMPLES KOENIGSBERG HISTORY
Network Types Graph Theory
RANDOM KOENIGSBERG HISTORY NETWORK
• Erdos-Renyi model
– Start with N nodes – Connect each pair of node with probability p – Graph has ~pN(N1)/2 randomly placed links
• Nodes:
– Residues
• Connections
– Interactions
• Van der Waals, h-bonds, hydrophobic etc etc
Network Types Graph Theory
RANDOM KOENIGSBERG HISTORY NETWORK
Network Types Graph Theory
RANDOM KOENIGSBERG HISTORY NETWORK
• Degree distribution P(k)
– Follows Poisson distribution
• ==> Most nodes have same number of nodes = average
• Clustering Coefficient C(k)
– Independent of Node degree – Horizontal line – Mean path length l ~ logN , N = network size
• Indicates characteristic small world property • Small World property implies any two nodes can be connected by just a few links
– Tail of distribution decreases exponentially
• ==> very few nodes have degree different from average
13
Network Types Graph Theory
• Characterized by power-law distribution
SCALE FREE KOENIGSBERG HISTORY NETWORK
Network Types Graph Theory
SCALE FREE KOENIGSBERG HISTORY NETWORK
– P(k) ~k-γ – Small number of highly connected hubs
• Power law distributions show up as a straight line on a log-log plot • C(k) is independent of k • Most biological networks have 2<γ <3
– Average path length l ~ log log N which is much shorter than logN γγ for random networks
Network Types Graph Theory
HIERARCHICAL KOENIGSBERG HISTORY NETWORK
Network Types Graph Theory
HIERARCHICAL KOENIGSBERG HISTORY NETWORK
• Accounts for coexistance of modularity, local clustering and scale-free topology in many real systems • Integrates scale-free topology with an inherent modular structure • Power law degree distribution
• P(k) very similar to scale free network • C(k) ~ k-1 has a straight line slope on a log-log plot • Implies sparsely connected nodes are part of highly clustered areas • Connection between highly connected neighborhoods maintained by a few hubs
14
Origin ofGraph Theory Scale-Free Networks
• Two basic mechanisms
– Growth
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
Origin ofGraph Theory Scale-Free Networks
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
• Preferential Attachment
– New nodes prefer to link to more connected nodes – Eg. Red node has 2 times greater probability of connecting to node 1 than node 2
• Network emerges through the subsequent addition of new nodes
• Growth and preferential attachment
– More connected a hub is, more nodes will link to it… which means they get still more links and so on….
– Preferential Attachment
Origin ofGraph Theory Scale-Free Networks
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
World Wide Web Graph Theory
• Nodes:
EXAMPLES KOENIGSBERG HISTORY
• Scale free model predicts that evolutionarily older nodes are more connected • Eg. Metabolic Hubs: Remnants of RNA world like coenzyme A, NAD and GTP are most connected substrates • For protein networks:
– Evolutionarily older proteins have more links to other proteins than their younger counterparts
– Internet Servers
• Connections
– Links
15
Food Web Graph Atlantic North Theory
EXAMPLES KOENIGSBERG HISTORY
Social Co-Authorship Network Max Plank Institute
Graph Theory
EXAMPLES KOENIGSBERG HISTORY
• Nodes:
– Species
• Nodes:
– Researchers
• Connections
– Predator-prey
• Connections
– Co-authorship
Economic Network Graph Theory World Trade 1992
EXAMPLES KOENIGSBERG HISTORY
Yeast Protein Network Graph Theory
• Nodes:
– Proteins
EXAMPLES KOENIGSBERG HISTORY
• Nodes:
– Countries
• Connections
– Trade Volume
• Connections
– Protein-Protein Interactions
16
Protein Network Graph Theory
EXAMPLES KOENIGSBERG HISTORY
Graph Theory Modularity
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
• Cellular functions are likely to be carried out in a modular manner • Modularity
– group of physically or functionally linked molecules (nodes) that work together to achieve a (relatively) distinct function.
• Examples
– Relatively invariant protein-protein and proteinRNA complexes are at the core of many basic biological functions – Temporally regulated groups of molecules
• Involved in Cell Cycle • Convey extracellular signals in bacterial chemotaxis
Graph Theory Motifs
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
Graph Theory Motifs
• How to identify motifs?
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
• Some subgraphs are over-represented in motifs compared to a random network • Ex: feedforward loops emerge in transcriptional regulatory as well as neural networks • Four-node networks occur in electrical circuits but not in biological networks.
– All subgraphs of n nodes are determined – Network is randomized keeping number of nodes, links and degree distribution the same – Subgraphs that occur significantly more frequently in real networks than in random networks are designated as motifs
17
Graph Theory Motif Clusters
• Motifs also form clusters • Example
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
Network Robustness Graph Theory
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
– Transcriptional network from E. Coli – Shows only the bi-fan motifs (motif with four nodes)
• Robustness --> ability to respond to external changes while maintaining relatively normal behavior • Random networks:
– If a critical fraction of nodes is removed, then functional disruption takes place
• Such clustering of motifs seems to be a general property of networks
• Complex systems can be surprisingly resilient (from internet to the cell) • Topology has a major role to play in this resilience
Network Robustness Graph Theory
• Scale-free networks
– – – – Amazingly robust Even if > 80% of nodes are disconnected This is due to the presence of few hubs However, this can lead to attack vulnerability
BIOLOGICAL KOENIGSBERG HISTORY SYSTEMS
Graph Theory Conclusions
• Studied the basics of graph theory • Examples of networks • Analyzed types of Networks
Introduction to KOENIGSBERG HISTORY Networks
• Deletion of a few of this hubs can completely disrupt network
– Strong relationship between hub status of molecule and effect on cell viability – Eg: In S. Cerevisiae:
• ~10% of proteins with < 5 links are essential • ~60% of proteins with > 15 links are essential
– Random, scale-free, hierarchical – We saw how most networks were small-scale in nature
• Studied occurrence of motifs, motif clusters • Looked at network robustness.
• Hubs tend to be better evolutionarily conserved!!
18
Software Setup Graph Theory
• Recurrence Quantification Anaysis
– Download from
Introduction to KOENIGSBERG HISTORY Networks
Software Setup Graph Theory
• Installation Instructions
Introduction to KOENIGSBERG HISTORY Networks
• http://www.iab.keio.ac.jp/~krishnan/downloads/Course_Materia ls/Eval3DStruct
– a) Do you want to install a parallel version of the program? [Y/N]
• Y
• Protein Modularity Detection
– Download from
• http://www.iab.keio.ac.jp/~krishnan/downloads/Course_Materia ls/GANDivA.tar.gz
– b) Do you have MPI Installed? [Y/N]
• Y
– Copy this to account on cacao.bioinfo.ttck.keio.ac.jp
– c) Where would you like to have PGA installed?
• Give full path of directory in which to install • Eg: /home/krishnan/GANDivA_v1.0/PGA
– Installation Instructions
• Tar and unzip the package using
– tar zxf GANDivA.tar.gz
– d) Please enter the path of the MPI library file
• /usr/local/lib/libmpich.a
• Change directory to the main GANDivA directory
– cd GANDivA_v1.0
• Run the install script
– perl install_gandiva.pl
– e) Please enter the path of the MPI include directory
• /usr/local/include
• You will be asked a series of questions
– This should automatically install the GANDivA binary in
• /path/to/GANDivA_v1.0/bin
Software Setup Graph Theory
Introduction to KOENIGSBERG HISTORY Networks
Graph Theory References
Introduction to KOENIGSBERG HISTORY Networks
• You will be using these two programs (Eval3DStruct) and GANDivA for assignments in the later classes. • If you have any problems, please drop me an email at:
– krishnan@ttck.keio.ac.jp
Albert-László Barabási & Zoltán N. Oltvai, Network, Biology, understanding the cell’s functional organization, Nature Reviews, 5, 101-114, 2004
19