• No results found

Graph Theory and Its Applications

N/A
N/A
Protected

Academic year: 2020

Share "Graph Theory and Its Applications"

Copied!
28
0
0

Loading.... (view fulltext now)

Full text

(1)

Graph Theory

N O M A N I S L A M

(2)

Outline

 Introduction

 Graph Models in Communication and Operating Systems

 Representing Graphs in Computers

 Graph Coloring

 Spanning Trees

 Other Problems in Graph Theory

(3)

Graph

 A graph G(V,E) is mathematical

structure usually represented as a diagram consisting of

points/nodes/vertices V joined by lines/edges E

 Vertices may correspond to chemical

elements, towns, terminals)

 Edges may correspond to chemical

bonds, roads, wires

 Graph theory has applications in

(4)

Terminologies

 directed & undirected

graph

simple and multigraphvertex and edge

adjacency

in and out-degree

(valency)

bipartite graph  path, circuit, loop  connected graphcomplete graph K

n and

(5)

Terminologies (contd)

 weighted graph

 Euler cycle and

Hamiltonean cycle

 tree and forest

 spanning tree

Weighted Graph with Hamiltonean Cycle

A,B,C,D,E,A

Spanning Trees of K

Euler Cycle

(6)

Graph in Communication

Interconnection network for five processors (a complete graph)

(7)

Graph in Operating Systems

New Ready Running

Exit

Blocked

Admit Dispatch

Timeout Release

Event

Occurs Event

Wait

(8)

Graph in Operating Systems

0 1 2 3 4

5

(9)

Eulerian and Hamiltonean Type

Problems

Eulerian Type Problems

– Diagrams Tracing Puzzles – Mazes

Hamiltonean Type Problems

– Gray Codes

– Traveling Sales Man Problem

 A sales person wants to minimize the total traveling cost

to visit all the cities in a territory and return to the starting point. Other applications include routing trucks for

(10)

Exercise

Draw the digraphs whose vertices and arcs are as follows.

In each case say if the digraph is a simple digraph.

– a) V = {u, v, w, x}, A = {vw, wu, wv, wx, xu}

b) V = {1, 2, 3, 4, 5, 6, 7, 8}, A = {12, 22, 23, 24, 34, 35, 67,

68, 78}

– c) V = {n, p, q, r, s, t}, A = {np, nq, nt, rs, rt, st, pq, tp}

Which of the following graphs are Eulerian and/or

(11)

Representing Graphs

Adjacency Matrix

aij = 1 if {vi,vj} is an edge of G 0 otherwise

Incidence Matrix

mij = 1 if edge eJ is incident with vi 0 otherwise

0 1 0 1

1 0 1 1

0 1 0 0

1 1 1 0

1 2

4 3

1 0 0 1 0

1 1 0 0 1

0 1 1 0 0

0 0 1 1 1

1

4 5 2

3

(12)

Exercise

 Write down the

adjacency and

incidence matrices of the following graphs and digraphs:

 Draw the digraphs

(13)

Exercise

How many edges are there in a complete

graph on 5 vertices?

How many edges are there in general in a

(14)

Shortest Path Algorithm

In a weighted graph, what is the shortest

path between two given vertices?

In computer network for example, what are

the set of telephone lines that for connecting

Karachi and London gives the least cost or

the fastest communication (Circuit Switching)

(15)

Graph Coloring

Assignment of colors to each vertex of graph

so that adjacent vertices have different colors

Least number of colors needed to color a

graph is called chromatic number

(16)

Graph Coloring Applications

Scheduling Final Exams

– How can the final exams be scheduled so that no

students has two exams at the same time

– The nodes of graph corresponds to the courses

and there will be links between two nodes if the exam of the two courses can’t be taken

simultaneously

(17)

Graph Coloring Applications

Frequency Assignments

– Assigning frequencies to mobile radios and other

users of the electromagnetic spectrum

– Two customers that are sufficiently close must

be assigned different frequencies, while those that are distant can share frequencies

– The nodes of graphs are mobile and there will be

links between two nodes if they can’t use the same frequencies

– The problem of minimizing the number of

(18)

Graph Coloring Applications

Register Allocation

– Assign variables of a program to a limited number

of hardware registers during program execution

– The goal is to assign variables that do not conflict

so as to minimize the use of non-register memory.

– Create a graph where the nodes represent

(19)

Graph Coloring Applications

 Aircraft Scheduling

– We have k aircrafts and we have to assign n-flights

If two flights overlap, we can’t assign same aircraft to both

flights

– Vertices of graph corresponds to flights, two vertices are

connected if corresponding time intervals overlap

Assignment of colors means assignment of aircrafts

– Graph Coloring will then try to minimize the number of

(20)

Graph Coloring Algorithms

Graph Coloring is NP-Complete problem

Sequential Coloring – Always colors the next

vertex with the minimum acceptable color

(i.e. the minimum color not already assigned

to a vertex adjacent to v

i

)

Sequential Color Interchange

(21)

Spanning Tree

A sub-graph of a graph that is a tree

containing every vertex of G

(22)

Spanning Tree Applications

IP Multicasting

– Unicasting, Multicasting, Broadcasting

– Multicasting means to send data from on

computer to a set of other computers

– Instead of unicasting to each source individually,

(23)

Exercise

Find all the spanning trees in each of the two

graphs shown:

Prove that any tree is bipartite

Show that any tree can be colored with two

(24)

Some Other Graph Problems

 Vertex Cover Problem – A subset of vertices such

that each edge is incident upon some vertex in C

(what is the minimum number of sentries that can be posted at intersections such that all corridors are

monitored)

 Clique Problem – A subset of vertices K such that

every pair of distinct vertices in K is joined by an edge of G

(25)

Some Other Graph Problems

C

C C

I

I

I

K

K

K

Vertex Cover Independent Set

(26)
(27)

References

 URLs

‘Graph Theory Glossary’, http://www.utm.edu

‘Graph Theory Glossary’, http://exchange.manifold.net

‘Graph coloring applications’, http://mat.gsia.cmu.edu

/COLOR

– http://www.personal.kent.edu/~rmuhamma/GraphTheory/gr

aphTheory.htm

(28)

Relevant Questions

http://mat.gsia.cmu.edu/COLOR http://www.personal.kent.edu/~rmuhamma/GraphTheory/graphTheory.htm

References

Related documents

Using Graph Theory to Analyze Gene Network Coherence..

The water system minimum-cost flow problem is solved using the successive shortest path (SSP), graph theory algorithm, by representing the network as a directed graph.. The

A bipartite graph, also called a bi-graph is a set of graph vertices decomposed into two disjoint subset A and B such that every edge in G joins a vertex in A with vertex B then

Models with Interconnection Networks memory RAMs network 0 processors 1

A graph based modified algorithm using an anti-magic labeling process on a cube to arrive at a secret cipher key that reduces the probability of various attacks is

A classical result of Ramsey [ 96 ] says that when the edges of a complete graph on a countably infinite vertex set are finitely coloured, one can always find a complete

We constructed a gene co-expression network at increas- ingly stringent thresholds by beginning with a complete graph with vertices representing gene transcripts. The

A minimal set of edges in a connected graph whose removal reduces the rank by one is called minimal cut set (simple cut-set or cocycle).  In a connected graph G,