Graph theory and network
analysis
Devika Subramanian
Comp 140
The bridges of Konigsburg
The city of Königsberg in Prussia was set on both
sides of the Pregel River, and included two large islands which were connected to each other and the mainland by seven bridges.
Leonard Euler posed the following problem: can
we find a walk through the city that crosses each bridge once and only once, and begins and ends at the same point?
Rules: The islands cannot be reached by any
route other than the bridges, and every bridge must have been crossed completely every time (one cannot walk halfway onto the bridge and then turn around to come at it from another
A schematic of the seven bridges problem
A B C D b1 b2 b3 b4 b5 b6 b7First paper on graph theory
Leonard Euler presented a solution to the St. Petersburg
Academy on
August 26
,
1735
Solutio problematis ad geometriam situs pertinentis
(The solution of a problem relating to the geometry of
position),
Commentarii academiae scientiarum
Abstract representation
C D B A b1 b2 b5 b4 b3 b6 b71. Only land masses and the bridges connecting them matter!
2. Shapes of land masses and lengths of bridges are not relevant. Relative distances between land masses also not relevant.
3. Topological connectivity is the only relevant aspect for solving the problem.
4. The structure shown alongside makes only the relevant factors of the problem explicit.
Euler’s insight
When one enters a land mass (that is not the start or the
end of the tour) by a bridge, one leaves it by a bridge.
If each bridge is to be traversed exactly once, then each
land mass that is not the start or the end, needs to have an
even number of bridges touching it.
Land mass A has five bridges touching it, land masses B, C
and D each have three bridges touching them.
So a tour that starts and ends on any of these land masses
Elements of graph theory
Land masses are
vertices
.
Bridges are
edges
.
The problem is represented as an
undirected multi-graph
.
The
degree
of a vertex is the
number of edges on it.
all vertexes in this problem
have odd degree.
Euler’s insight: An Eulerian tour in
a
connected graph
is possible only
if all vertexes in it have
even
degree.
C D B A b1 b2 b5 b4 b3 b6 b7Some definitions
A graph G is a pair of sets V and E
V is a non-empty set of vertices
E is a set of pairs of vertices
B A C E F
V = {A,B,C,D,E,F}
E={{A,B},{A,D},{B,C},{B,E},
{C,D},{C,E},{E,F}}
G={V,E}
Subgraphs
Deleting some vertices or edges from a
graph leaves a subgraph.
Formally, G’=(V’,E’) is a subgraph of G =
(V,E) if
V’ is a non-empty subset of V
E’ is a subset of E
A computer scientist reads the paper
A 1994 University of Chicago entitled
“The Social Organization of Sexuality”
found that on average men have 74%
more opposite-gender partners than
women.
Analysis
Every edge in this graph connects an M
vertex to a W vertex.
So the sum of the degrees of the M
vertices must equal the sum of the
degrees of the W vertices.
!Avg. deg in M |W| = Avg. deg in W |M| Avg. deg in M = |W| |M|.Avg. deg in W ! x∈M deg(x) |M| . 1 |W| = ! y∈W deg(y) |W| . 1 |M|
Analysis contd.
Analysis contd.
Census Bureau reports |W|/|M| is about 1.035.
Therefore, on average men have 3.5% more
opposite-gender partners.
The University of Chicago study has problematic
data.
The average number of opposite-gender partners is
Graph variations
Multigraph: more than one edge between a pair of
vertices.
Directed graph: edges have direction.
the edges of a directed graph are ordered pairs of
vertices.
indegree of a vertex is the number of edges directed
into a vertex.
outdegree of a vertex is the number of edges directed
Problems that map to graphs
Social networks: nodes are people, edges
represent the “is-friends-with” relation.
Terrorist networks: nodes are terrorist
groups/individuals, edges are
‘participated-in-an-incident-with’
Conflict networks: nodes are countries,
The SHSU database
A human curated database of global terrorist
incidents from 1/22/1990 to 12/31/2007
31,199 incidents
1257 groups
Very detailed information on incidents (e.g.
weapons used, fatalities, etc) and some
information on the groups.
Pre-Bali network
Palestine groups Kashmir groups
Philippines, Indonesian groups Hamas
Al Qaeda US terror groups (KKK etc)
Columbia
Post Bali network
Al Qaeda
US environmental Terror groups Bangladesh
All the rest are fragments
More problems
The web: each vertex is a page, directed edges
between vertices represent hyperlinks
Algorithm to compute hubs and authorities to determine page
rank in Google
Modeling the spread of infection in a community:
vertices are people, and edges represent contact
between them.