• No results found

Matrix Representation of Graphs:

N/A
N/A
Protected

Academic year: 2022

Share "Matrix Representation of Graphs:"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

Graph Theory

Unit II

(2)

Graph:

Let V be a finite set with v1, v2, v3, ……., vn and E be a finite set with e1, e2, e3, ……., em as the members of E, then graph G can be defined as a mathematical system <V, E, φ > where φ is the mapping of edges e in E to ordered or unordered pairs in V.

Adjacent Nodes:

Two nodes n1 and n2 are said to be adjacent if there exists an edge between n1 and n2.

Undirected Edge:

An edge e which does not have any orientation or direction is known as undirected edge or in other words e is associated with unordered pair of

nodes.

(3)

Directed Edge:

An edge e which has orientation or direction is known as directed edge or in other words e is associated with ordered pair of nodes.

Digraph:

A graph G=<V, E> is said to be a directed graph or digraph if all edges in E are having some orientation.

Undirected Graph:

A graph G=<V, E> is said to be a undirected graph if all edges in E are not having some orientation.

Mixed Graph:

A graph in which some of the edges have orientation while some do not.

Weighted Graph:

A graph in which weights are assigned to every edge is called weighted graph.

(4)

Indegree:

It is defined as the number of edges incident on a given node.

Outdegree:

It is defined as the number of edges originating from a given node.

Parallel Edges:

Two edges e1 and e2 are known as parallel edges if they originate from one node say v1 and terminate at another node, say v2.

(5)

Self Loop:

An edge e is said to be a self loop if it originates and terminates at the same node.

* Self loop always constitutes one indegree and one outdegree.

Isolated Node:

A node n which is not adjacent to any other node is known as an isolated node.

Null Graph:

A graph G=<V, E> in which all the nodes are isolated is known as a null graph.

(6)

Multigraph:

A graph which contains some parallel edges is called a multigraph.

Simple Graph:

A graph G=<V, E> is said to be a simple graph if it does not contain parallel edges. e.g. For the following graph determine the indegree, outdegree and total degree.

(7)

Theorem:

The sum of the total degrees in a graph is always equivalent to twice the number of edges.

Proof:

Every edge constitutes one indegree and one outdegree.

ÞTotal degree is 2 for each edge.

ÞSum of the total degrees is equivalent to twice the number of edges.

(8)

Problem: Show that in any graph G, the number of nodes of odd degree is even.

Proof:

By theorem 1- = 2e

=> = + = 2e (i = k+l)

=> + is even

Now, sum of the degrees of even degree nodes is even.

ÞSum of the degrees of odd degree nodes is even Number of odd degree nodes is even.

(9)

Problems:

1. Determine how many nodes are necessary to construct a graph with exactly six edges in which each node is of degree 2.

2. Determine whether it is possible to construct a graph with 12 edges such that two of the nodes have degree 3 and remaining have degree 4.

(10)

Converse of a graph:

Let G=<V, E> be a directed graph.

Then the converse of G, written as , is nothing but the directional dual of G, i.e. graph obtained by simply reversing the direction of edges in G.

(11)

Complement of a Graph:

Let G = <V, E> be a directed graph. Then the compliment of G written as , is the system

=<V, > where = V x VE

Problem: Let G=<V,E> be a graph where V =

{v1,v2,v3,v4} & E =

{<v1,v2>,<v1,v1>,<v2,v3>,<v3,v3>,<v4,v1

>, <v4,v3>} determine and sketch the graph of G and .

(12)

Path:

It is defined as a sequence of edges, in which the terminating node of one edge becomes the starting node of the other edge.

e.g. Path is from v1 to v3.

Length of the path:

The number of edges appearing in a path is designated as length of the path and it is always equal to n-1, where n is the number of nodes appearing in a path.

(13)

Elementary Path:

A path P is said to be an elementary path if the nodes are not repeated in a path. This is also known as node simple path.

Simple Path:

A path is P said to be a simple path if the edges in sequence are not repeated.

This is also known as edge simple path.

Determine as many number of paths as you can between nodes 1 and 3.

(14)

Circuit:

A circuit in a graph G is defined as a route, which begins and ends at the same node.

Euler’s Circuit:

Let G be a graph, then Euler’s circuit in G is a route that begins and ends at the same node, traversing each edge exactly once.

Necessary condition for the presence of Euler’s circuit is that each node must have an even degree.

(15)

Konigsberg’s Bridge Problem:

The Graph of Konigsberg Bridge

(16)

Problem:

Find the degree of each vertex for the graphs shown and is it possible to trace the graphs I and II without lifting your pencil from the paper beginning and ending at the same point, retracing of lines is not permitted.

Justify your answer.

(17)

Hamiltonian Circuit:

Let G be a graph, then a route that begins and ends at the same node, traversing each node exactly once is known as Hamiltonian circuit.

Generally it is used for travelling salesman problem.

Travelling Salesman Problem:-

Given a set of cities and distances

between each pair. Find the shortest route that visits each city once and returns to the initial city.

(18)

Matrix Representation of Graphs:

Two Methods are available –

1)Adjacency matrix representation

2)Incidence matrix representation

(19)

Adjacency Matrix

Let G be a graph with M number of nodes. Then this graph can be represented by a MxM matrix A = [aij], where aij = 1 if arc(xi, xj) G

0 if arc(xi, xj) G.

e.g. A = ?

Drawback of Adjacency matrix is that it does not represent the graph with parallel edges.

(20)
(21)
(22)
(23)
(24)
(25)
(26)

Path matrix can be determined by using Adjacency Matrix Method.

(27)
(28)
(29)
(30)
(31)
(32)

Feasible Flow:

A flow through a T.N. is said to be feasible if it follows the following rules –

1) ф(i, j) ≤ c(i, j)

2) Flows at source and sink must balance each other.

3) At all intermediate nodes, other than source and sink, the flows must balance each other.

Determine the

max. flow through the given TN.

(33)

Problem: For the following TN determine whether the flow is feasible or not. Also find out themax. flow.

References

Related documents

The simplest algorithm for multipass decoding is to modify the Viterbi algorithm to return the N-best sentences (word sequences) for a given speech

A  small­world  graph  is  a  type  of  mathematical  graph  in  which  most  nodes  are  not  neighbors  of 

The problem of deciding whether a graph can be rainbow coloured using 3 colours remains NP-complete even when restricted to the class of split graphs.. However, any split graph can

A cograph G is clique vertex irreducible if and only if it can be reduced to a trivial graph by recursively deleting vertices of full degree in each of the

DEPARTMENT OF MECHANICAL ENGINEERING, NIT ROURKELA Page 36 Graph 4.8: Graph showing the effect of conduit dimension for fluid pair kerosene-water It can be observed from the

Sum product algorithm uses the Tanner graph created from the parity check matrix H, as factor graph and sends belief messages between bit nodes (variable nodes for LDPC Tanner

If the graph is Open Eulerian then pick any of the two odd degree vertices as start vertex and find Eulerian trail by applying the above mentioned algorithm.. If the graph is

4 for the case when a median graph G is isometrically embedded into a hypercube to obtain a fast algorithm for computing median sets in median graphs.. (Unfortunately, a similar