applications of graphs

42
APPLICATIONS OF GRAPHS

Upload: techmx

Post on 28-Nov-2014

2.339 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Applications of graphs

APPLICATIONS OF GRAPHS

Page 2: Applications of graphs

GRAPHS• Graph theory has turned out to be a vast area with

innumerable applications in the field of social networks , data organization , communication network and so on…

• We have considered here 1.Dijkstra’s algorithm 2. Fingerprint classification using graph theory

Page 3: Applications of graphs

DIJKSTRA’S ALGORITHM

Page 4: Applications of graphs

DIJKSTRA’S ALGORITHM

• Djikstra's algorithm (named after its discover, E.W. Dijkstra) solves the problem of finding the shortest path from a point in a graph (the source) to a destination.

• It turns out that one can find the shortest paths from a given source to all points in a graph in the same time, hence this problem is sometimes called the single-source shortest paths problem.

Page 5: Applications of graphs

• Given a network of cities and the distances between them, the objective of the single-source, shortest-path problem is to find the shortest path from a city to all other cities connected to it.

• The network of cities with their distances is represented as a weighted graph.

Page 6: Applications of graphs

• Let V be a set of N cities (vertices) of the digraph. Here the source city is 1.

• The set T is initialized to city 1.• The DISTANCE vector, DISTANCE [2:N] initially records the

distances of cities 2 to N connected to the source by an edge (not path!)

110

3

4

5

2

1

60 2030

20 40

70

SOURCE

Page 7: Applications of graphs

• If there is no edge directly connecting the city to source, then we initialize its DISTANCE value to ‘∞’

• Once the algorithm completes iterations, the DISTANCE vector holds the shortest distance of two cities 2 to N from the source city 1

• It is convenient to represent the weighted digraph using its cost matrix COSTN x N

• The cost matrix records the distances between cities connected by an edge.

• Dijkstra’s algorithm has a complexity of O(N2) where N is the number of vertices (cities) in the weighted digraph

Page 8: Applications of graphs

DIJKSTRA’S ALGORITHMProcedure DIJKSTRA_SSSP(N, COST)

/* N is the number of vertices labeled {1,2,3,….,N} of the weighted digraph. If there is no edge then COST [I, j] = ∞ */

/* The procedure computes the cost of the shortest path from vertex 1 the source, to every other vertex of the weighted digraph */

T = {1}; /* initialize T to source vertex */ for i = 2 to N do DISTANCE [i] = COST [1,i];

/* initialize DISTANCE vector to the cost of the edges connecting vertex I with the source vertex 1. If there is no edge then COST[1,i] = ∞ */

Page 9: Applications of graphs

for i = 1 to N-1 do Choose a vertex u in V – T such that DISTANCE [u] is a

minimum; Add u to T; for each vertex w in V – T do DISTANCE [w] = minimum ( DISTANCE [w] , DISTANCE [u] + COST [u ,w]); end end end DIJKSTRA_SSSP

Page 10: Applications of graphs

EXAMPLE• Consider the weighted graph of cities and its cost matrix

given below.

3

4

5

2

1

60 2030

20 40

70

1 2 3 4 5

1 0 20 ∞ 40 110

2 ∞ 0 60 ∞ ∞

3 ∞ ∞ 0 ∞ 20

4 ∞ ∞ 30 0 70

5 ∞ ∞ ∞ ∞ 0

WEIGHTED GRAPH COST MATRIX C5X5

SOURCE

Page 11: Applications of graphs

Trace of The Table following that shows the trace of the Dijkstra’s algorithm

Page 12: Applications of graphs

• The DISTANCE vector in the last iteration records the shortest distance of the vertices {2,3,4,5} from the source vertex 1.

• To reconstruct the shortest path from the source vertex to all other vertices, a vector PREDECESSOR [1:N] where PREDECESSOR [v] records the predecessor of vertex v in the shortest path, is maintained.

• PREDECESSOR [1:N] is initialized to source for all v != source

Page 13: Applications of graphs

• PREDECESSOR [1:N] is updated by

if (( DISTANCE [u] + COST [u, w]) < DISTANCE [w]) then PREDECESSOR [w] = u

soon after DISTANCE [w] = minimum ( DISTANCE [w] , DISTANCE [u] + COST [u ,w]) is computed in procedure DIJKSTRA_SSS

• To trace the shortest path we move backwards from the destination vertex, hopping on the predecessors recorded by the PREDECESSOR vector until the source vertex is reached

Page 14: Applications of graphs

EXAMPLE• To trace the paths of the vertices from vertex 1 using

Dijkstra’s algorithm, inclusion of the statement updating PREDECESSOR vector results in

Page 15: Applications of graphs

• To trace the shortest path from source 1 to vertex 5, we move in the reverse direction from vertex 5 hopping on the predecessors until the source vertex is reached. The shortest path is given by

PREDECESSOR(5)=3 PREDECESSOR(3)=4 PREDECESSOR(4)=1

Vertex 5 Vertex 3 Vertex 4 Source Vertex 1 Thus the shortest path between vertex 1 and vertex 5 is 1-4-3-5 and the distance is given by DISTANCE [5] is 90

Page 16: Applications of graphs

FINGERPRINT RECOGNITION USING GRAPH REPRESENTATION

Page 17: Applications of graphs

The three characteristics of FINGER PRINTS are:

1. There are no similar fingerprints in the world.2. Fingerprints are unchangeable.3. Fingerprints are one of the unique features for

identification systems.

Page 18: Applications of graphs

FINGERPRINT TYPES

The lines that flow in various patterns across fingerprints are called Ridges and the space between ridges are Valleys.

Page 19: Applications of graphs

Cont..

Types of patterns in Fingerprint.

1 and 2 are terminations. 3 is bifurcation.

Page 20: Applications of graphs

MINUTE, CORE AND DELTA

Minute – The places at which the ridges intersects or ends.

Core – The places where the ridges form a half circle.Delta – The places where the ridges form a triangle.

Page 21: Applications of graphs

DIFFERENT CLASSIFICATION

Page 22: Applications of graphs

OLD METHOD

Page 23: Applications of graphs

NEW METHOD

Page 24: Applications of graphs

PROCESS FLOW

Page 25: Applications of graphs

FINGERPRINT CAPTURE DEVICES

Page 26: Applications of graphs

SEGMENTATION OF DIRECTIONAL IMAGE

Page 27: Applications of graphs
Page 28: Applications of graphs

SEGMENTATION

Page 29: Applications of graphs

Graph can be shown by G index including four parameters of G= (V, E, μ,υ).

whereV is number of nodes.E is number of edges.μ is weight of nodes.υ is weight of edges.

CONSTRUCTION OF RELATED WEIGHT GRAPH

Page 30: Applications of graphs

Some information can be used in constructing the graph related to a finger print like:

• Centre of gravity of regions.• The direction related to the elements of the various

regions.• The area of all the regions.• The distance between centres of gravity.• The perimeter of regions.

Page 31: Applications of graphs

Wn = Area (Ri) where i = 1,2,3,……,n. Wn is the weight of nodes .

Ri is the specified region in block directional image.

We = (Adj − p) × (Node − d) × (Diff −v) where Adj-p is the boundary of two adjacent regions linking with an edge. Node-d is the distance difference between nodes that links by an

edge Diff-v is the phase difference or direction difference between two

regions of block directional image.

WEIGHTAGE TO NODES AND EDGES

Page 32: Applications of graphs

The nodes are placed in the centre of gravity of each region. The nodes size vary according to the weight. The edges are shown by the lines and the thickness is proportional to the weight .

Page 33: Applications of graphs

We combine the properties of the Graph and model of the Super Graph to form,

• A node for region with similar directions.• Its co-ordinates is the centre of gravity related to those

regions of the graph.

CONSTRUCTING SUPER GRAPH

Page 34: Applications of graphs

Wsn = nΣi=1 Area (Ri)Where Area (Ri) is the area of all regions with similar directions. Ri includes regions with similar directions.

Wse = dis(sn) + Σ Adj-p(Ri,Rj)Where Wse is the weight of edges in super graph. dis(sn) is the distance between nodes of a super graph.

Adj-p is the sum of the adjacent perimeter between two regions.

WEIGHTAGE TO sNODES AND sEDGES

Page 35: Applications of graphs

The obtained block directional image have four directions, so we have four nodes.

All the nodes are connected with the other three edges.

If the number of nodes are high, its takes much time to find a match.

SUPER GRAPHSUPER GRAPH

Page 36: Applications of graphs

• Fingerprints are classified according to their structure.• A sample from each structure is taken for comparison.

Cost Function = (Σi (Wi.node – *Wi.node )) * (Σj (Wj.edge - *Wj.edge))

whereWi.node and Wj.edge are the node weight and edge weight ofthe Super graph.*Wi.node and *Wj.edge are the node weight and edge weight of model super graph.

RETRIEVING THE FINGERPRINTS

Page 37: Applications of graphs

• Different classifications give different cost value.Among that the lowest cost value function is taken and the comparison of the fingerprint proceeds in that class.

• By this method high accuracy is achieved in short comparison time.

• Previously FBI used 3 major classifications for matching the fingerprints and they had many sub-classifications.

• But now they use around 10 major classifications and many sub-classifications which gives them a fast result.

Page 38: Applications of graphs

SOME MORE INTERESTING APPLICATIONS…..

Page 39: Applications of graphs

EPIDEMOLOGY• Networks model used to represent the spread of infectious diseases and design prevention and response strategies.

• Vertices represent individuals, and edges their possible contacts. It is useful to calculate how a particular individual is connected to others.

• Knowing the shortest path lengths to other individuals can be a relevant indicator of the potential of a particular individual to infect others.

Page 40: Applications of graphs

SOCIAL NETWORKS

Page 41: Applications of graphs

NETWORKS (ROADS, FLIGHTS, COMMUNICATIONS)

LAX

JFK

HJK

LAX

DFW

STL

HNL

Page 42: Applications of graphs

THANK YOU!!!