Documente Academic
Documente Profesional
Documente Cultură
OF
GRAPH THEORY
&
PROBABILITY
SUBMITTED TO SUBMITTED BY
MISS MANJIT KAUR PARKASH GUPTA
BCA-MCA(INT)
IIIRD SEMESTER
3010070322
Euler's Formula
If G is a planar graph, then any plane drawing of G divides the plane
into regions, called faces. One of these faces is unbounded, and is
called the infinite face. If f is any face, then the degree of f (denoted
by deg f) is the number of edges encountered in a walk around the
boundary of the face f. If all faces have the same degree (g, say), the
G is face-regular of degree g.
For example, the following graph G has four faces, f4 being the infinite
face.
It is easy to see from above graph that deg f1=3, deg f2=4, deg f3=9,
deg f4=8.
Note that the sum of all the degrees of the faces is equal to twice the
number of edges in the the graph , since each edge either borders
two different faces (such as bg, cd, and cf) or occurs twice when walk
around a single face (such as ab and gh). The Euler's formula relates
the number of vertices, edges and faces of a planar graph. If n, m,
and f denote the number of vertices, edges, and faces respectively of
a connected planar graph, then we get n-m+f = 2.
n - (m - 1) + (f - 1) = 2
which implies that
n - m + f = 2.
This page lists proofs of the Euler formula: for any convex
polyhedron, the number of vertices and faces together is exactly two
more than the number of edges. Symbolically V-E+F=2. For instance,
a tetrahedron has four vertices, four faces, and six edges; 4-6+4=2.
The
shadows of
the
polyhedron
edges form
a planar
graph,
embedded
in such a
way that the
edges are
straight line
segments. The faces of the polyhedron correspond to convex
polygons that are faces of the embedding. The face nearest the light
source corresponds to the outside face of the embedding, which is
also convex. Conversely, any planar graph with certain connectivity
properties comes from a polyhedron in this way.
Some of the proofs below use only the topology of the planar graph,
some use the geometry of its embedding, and some use the three-
dimensional geometry of the original polyhedron. Graphs in these
proofs will not necessarily be simple: edges may connect a vertex to
itself, and two vertices may be connected by multiple edges. Several
of the proofs rely on the Jordan curve theorem, which itself has
multiple proofs; however these are not generally based on Euler's
formula so one can use Jordan curves without fear of circular
reasoning.
History
The Königsberg Bridge problem
The four color problem remained unsolved for more than a century. A
proof produced in 1976 by Kenneth Appel and Wolfgang Haken[6][7],
which involved checking the properties of 1,936 configurations by
computer, was not fully accepted at the time due to its complexity. A
simpler proof considering only 633 configurations was given twenty
years later by Robertson, Seymour, Sanders and Thomas.[8]
OK, so this attempt didn't work. But might there be some other path
that would cross every bridge exactly once? This problem was first
solved by the prolific Swiss mathematician Leonhard Euler
(pronounced "Oiler"), who invented the branch of mathematics now
known as graph theory in the process of his solution.
Graphs
Euler's approach was to regard the spots of land (there are 4 of them)
as points to be visited, and the bridges as paths between those
points. The mathematical essentials of the map of Königsberg can
then be reduced to the following diagram, which is an example of
what is called a graph:
For each of the vertices of a graph, the order of the vertex is the
number of edges at that vertex. The figure below shows the graph of
the Königsberg bridge problem, with the orders of the vertices
labeled.
Euler's Solution
Euler's solution to the problem of the Königsberg bridges involved the
observation that when a vertex is "visited" in the middle of the
process of tracing a graph, there must be an edge coming into the
vertex, and another edge leaving it; and so the order of the vertex
must be an even number. This must be true for all but at most two of
the vertices--the one you start at, and the one you end at, and so a
connected graph is traversible if and only if it has at most two vertices
of odd order. (Note that the starting and ending vertices may be the
same, in which case the order of every vertex must be even.) Now a
quick look at the graph above shows that there are more than two
vertices of odd order, and so the graph cannot be traced; that is the
desired walking tour of Königsberg is impossible.
2. Show how you could add a ninth bridge to the diagram above, to
make the walking tour once again impossible.
DEFINATION:-
PROPERTIES OF TREES
° A graph is a tree if and only if there is one and only one path joining any two of
its vertices.
° A connected graph is a tree if and only if every one of its edges is a bridge.
DEFINATION
° A sub graph that spans (reaches out to) all vertices of a graph are called a
spanning sub graph.
° A sub graph that is a tree and that spans (reaches out to) all vertices of the
original graph are called a spanning tree.
° among all the spanning trees of a weighted and connected graph, the one
(possibly more) with the least total weight is called a minimum spanning tree
(MST).
KRUSKAL'S ALGORITHM
• Step 1
Find the cheapest edge in the graph (if there is more than one, pick one at
random). Mark it with any given color, say red.
• Step 2
Find the cheapest unmarked (uncolored) edge in the graph that doesn't
close a coloured or red circuit. Mark this edge red.
• Step 3
Repeat Step 2 until you reach out to every vertex of the graph (or you
have N; 1 coloured edges, where N is the number of Vertices.) The red
edges form the desired minimum spanning tree.
PRIM’S ALGORITHM
• Step 0
Pick any vertex as a starting vertex. (Call it S). Mark it with any given
color, say red.
• Step 1
Find the nearest neighbor of S (call it P1). Mark both P1 and the edge SP1
red. Cheapest unmarked (uncolored) edge in the graph that doesn't close
a coloured circuit. Mark this edge with same color of Step 1.
• Step 2
Find the nearest uncolored neighbor to the red sub graph (i.e., the closest
vertex to any red vertex). Mark it and the edge connecting the vertex to the red
sub graph in red.
• Step 3
Repeat Step 2 until all vertices are marked red. The red sub graph is a
minimum spanning tree.
3. Of those you had in # 2, which one(s) is (are) minimum spanning trees. (i.e.,
those those have a minimum sum of their weighted edges.)
2. Use Prim's algorithm to find the minimum spanning tree and indicate the edges
in the graph shown below. Indicate on the edges that are selected the order of
their selection.
PRIM’S ALGORITHM
Suppose we are given G = (V, E). We assume G is connected. (If not, then
The algorithm will find a minimal spanning tree for the component we
Happen to start in.)
Choose any v in V.
While B <> V do
At step 4 we could have chosen to add edge (2, 4) instead of (3, 4).
Now it is fairly easy to see that the algorithm finds a spanning tree for G. But is it
a minimal spanning tree? To see that it is, we need the following lemma.
Proof. If the edge (u, v) is in the minimal spanning tree T, then we are done. If (u,
v) is not in T, on the other hand, then there is a path from u to v in T. Let (x, y) be
the edge in this path with exactly one vertex in V1. Call this vertex x. (Figure 4).
Let T1 be T with edge (x, y) removed and edge (u, v) added. Then E1 union {(u,
v)} is contained in T1 and T1 is a spanning tree. Now by the choice of (u, v) we
know that the weight of (u, v) is less than or equal to the weight of (x, y).
Therefore the weight of T1 is less than or equal to the weight of T, i.e., T1 is a
minimal spanning tree for G.
Now sort the edges in increasing order by weight and set T = the empty set.
Now examine each edge in turn. If an edge joins two components, add it to T and
merge the two components into one. If not, discard the edge.
Sorted edges: (1, 5), (2, 4), (2, 3), (3, 4), (1, 2), (4, 5)
PROPERTIES
Possible multiplicity
There may be several minimum spanning trees of the same weight; in particular,
if all weights are the same, every spanning tree is minimum.
UNIQUENESS
If each edge has a distinct weight then there will only be one, unique minimum
spanning tree. The proof of this fact can be done by induction or contradiction.
This is true in many realistic situations, such as the cable TV company example
above, where it's unlikely any two paths have exactly the same cost. This
generalizes to spanning forests as well.
CYCLE PROPERTIES
For any cycle C in the graph, if the weight of an edge e of C is larger than the
weights of other edges of C, then this edge cannot belong to an MST. Indeed,
assume the contrary, i.e., e belongs to an MST T1. If we delete it, T1 will be
broken into two subtrees with the two ends of e in different subtrees. The
remainder of C reconnects the subtrees, hence there is an edge f of C with ends
in different subtrees, i.e., it reconnects the subtrees into a tree T2 with weight
less than that of T1, because the weight of f is less than the weight of e.
CUT PROPERTIES
For any cut C in the graph, if the weight of an edge e of C is smaller than the
weights of other edges of C, then this edge belongs to all MSTs of the graph.
Indeed, assume the contrary, i.e., e does not belong to an MST T1. Then adding
e to T1 will produce a cycle, which must have another edge e2 from T1 in the cut
C. Replacing e2 with e, would produce a tree T1 of smaller weight.
ALGORITHMS
The first algorithm for finding a minimum spanning tree was developed by Czech
scientist Otakar Borůvka in 1926 (see Borůvka's algorithm). Its purpose was an
efficient electrical coverage of Moravia. There are now two algorithms commonly
used Prim's algorithm and Kruskal's algorithm. All three are greedy algorithms
that run in polynomial time, so the problem of finding such trees is in FP, and
related decision problems such as determining whether a particular edge is in the
MST or determining if the minimum total weight exceeds a certain value are in P.
Another greedy algorithm not as commonly used is the reverse-delete algorithm,
which is the reverse of Kruskal's algorithm.
The fastest minimum spanning tree algorithm to date was developed by Bernard
Chazelle, which is based on the Soft Heap, an approximate priority queue. [1] [2]
Its running time is O (e α (e, v)), where e is the number of edges, v is the number
of vertices and α is the classical functional inverse of the Ackermann function.
The function α grows extremely slowly, so that for all practical purposes it may be
considered a constant no greater than 4; thus Chazelle's algorithm takes very
close to linear time.
What is the fastest possible algorithm for this problem? That is one of the oldest
open questions in computer science. There is clearly a linear lower bound, since
we must at least examine all the weights. If the edge weights are integers with a
bounded bit length, then deterministic algorithms are known with linear running
time. For general weights, there are randomized algorithms whose expected
running time is linear.
Whether there exists a deterministic algorithm with linear running time for general
weights is still an open question. However, Seth Pettie and Vijaya
Ramachandran have found a provably optimal deterministic minimum spanning
tree algorithm, the computational complexity of which is unknown.
More recently, research has focused on solving the minimum spanning tree
problem in a highly parallelized manner. With a linear number of processors it is
possible to solve the problem in O (log n) time. A 2003 paper "Fast Shared-
Memory Algorithms for Computing the Minimum Spanning Forest of Sparse
Graphs" by David A. Bader and Guojing Cong demonstrates a pragmatic
algorithm that can compute MSTs 5 times faster on 8 processors than an
optimized sequential algorithm. Typically, parallel algorithms are based on
Boruvka's algorithm — Prim's and especially Kruskal's algorithm do not scale as
well to additional processors.
Other specialized algorithms have been designed for computing minimum
spanning trees of a graph so large that most of it must be stored on disk at all
times. These external storage algorithms, for example as described in
"Engineering an External Memory Minimum Spanning Tree Algorithm" by Roman
Dementiev et al.,[10] can operate as little as 2 to 5 times slower than a traditional
in-memory algorithm; they claim that "massive minimum spanning tree problems
filling several hard disks can be solved overnight on a PC." They rely on efficient
external storage sorting algorithms and on graph contraction techniques for
reducing the graph's size efficiently.
It has been shown by J. Michael Steele based on work by Alan M. Frieze that
given a complete graph on n vertices, with edge weights chosen from a
continuous random distribution f such that f'(0) > 0, as n approaches infinity the
size of the MST approaches ζ (3) / f'(0), where ζ is the Riemann zeta function.
For uniform random weights in [0, 1], the exact expected size of the minimum
spanning tree has been computed for small complete graphs.
Vertice
Expected size Approximate expected size
s
2 1/2 0.5
3 3/4 0.75
4 31 / 35 0.8857143
Related problems
A related graph is the k-minimum spanning tree (k-MST) which is the tree that
spans some subset of k vertices in the graph with minimum weight.
The Euclidean minimum spanning tree is a spanning tree of a graph with edge
weights corresponding to the Euclidean distance between vertices.
In the distributed model, where each node is considered a computer and no node
knows anything except its own connected links, one can consider Distributed
minimum spanning tree. Mathematical definition of the problem is the same but
has different approaches for solution.
For directed graphs, the minimum spanning tree problem can be solved in
quadratic time using the Chu–Liu/Edmonds algorithm.
REFERENCES