100% found this document useful (1 vote)
577 views14 pages

Graph Theory - Imed - Bca

This document discusses graph theory and defines various terms used to describe graphs and their components. It introduces graphs and defines them as a set of vertices and edges connecting those vertices. It then defines and provides examples of walks, paths, cycles, trails, and circuits in graphs. The document also defines bipartite graphs and how they can be represented using an edge list or adjacency matrix.

Uploaded by

shantanukanade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
577 views14 pages

Graph Theory - Imed - Bca

This document discusses graph theory and defines various terms used to describe graphs and their components. It introduces graphs and defines them as a set of vertices and edges connecting those vertices. It then defines and provides examples of walks, paths, cycles, trails, and circuits in graphs. The document also defines bipartite graphs and how they can be represented using an edge list or adjacency matrix.

Uploaded by

shantanukanade
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

GRAPH THEORY

INTRODUCTION
• E-commerce, (AMAZON)
• Logistics (DHL)
• Designing electrical/ computer networks
• Social Networking ( FACEBOOK, TWITTER, LINKEDIN)
What is Graph
A set of points and lines joining these points.
Formally: G=(V,E), V-vertices, E-edges
e6
v1
v4
v3
e1
e2 V2 and v3 are adjacent. e2
e3
e5
is incident with v2.
v2
e4 v5
Walk in Graph Theory-
 In graph theory,
 A walk is defined as a finite length alternating sequence of vertices
and edges.
 The total number of edges covered in a walk is called as Length of
the Walk.
 
In graph theory, a walk is called as an Open walk if-
 Length of the walk is greater than zero
 And the vertices at which the walk starts and ends are
different.
 
 
In this graph, few examples of walk are- In graph theory, a walk is called as a Closed walk if-
•A , B , C , E , D                    (Length = 4)
•D , B , A , C , E , D , E , C     (Length = 7)  Length of the walk is greater than zero
•E , C , B , A , C , E , D          (Length = 6)  And the vertices at which the walk starts and ends are same.
Path in Graph Theory-
 
In graph theory, a path is defined as an open walk in which-

 Neither vertices (except possibly the starting and ending vertices) are allowed to
repeat.
 Nor edges are allowed to repeat.
 

Cycle in Graph Theory-  


In graph theory, a cycle is defined as a closed walk in which-

 Neither vertices (except possibly the starting and ending vertices) are allowed to
repeat.
 Nor edges are allowed to repeat.
Trail in Graph Theory-
 
In graph theory, a trail is defined as an open walk in which-
 Vertices may repeat.
 But edges are not allowed to repeat.
 

Circuit in Graph Theory-  


In graph theory, a circuit is defined as a closed walk in which-
 Vertices may repeat.
 But edges are not allowed to repeat.
Bipartite Graphs – A simple graph G is said to be bipartite if
its vertex set V can be divided into two disjoint sets such that
every edge in G has its initial vertex in the first set and the
terminal vertex in the second set. Total number of edges are
(n*m) with (m+n) vertices in bipartite graph.

A simple graph is bipartite if and only if it is possible to


assign one of two different colors to each vertex of the graph
so that no two adjacent are assigned the same color.

A bipartite graph with m and n vertices in its two disjoint


subsets is said to be complete if there is an edge from every
vertex in the first set to every vertex in the second set, for a
total of mn edges. A complete bipartite graph with m vertices
in the first set and n vertices in the second set is denoted as
K{m,n}.
Edge List
One simple way to represent a graph is just a list, or array,
of |E| which we call an edge list. To represent an edge, we
just have an array of two vertex numbers, or an array of
objects containing the vertex numbers of the vertices that
the edges are incident on. If edges have weights, add either
a third element to the array or more information to the
object, giving the edge's weight.

[ [0,1], [0,6], [0,8], [1,4], [1,6], [1,9],


[2,4], [2,6], [3,4], [3,5],
[3,8], [4,5], [4,9], [7,8], [7,9] ]

Edge lists are simple, but if we want to find whether the


graph contains a particular edge, we have to search
through the edge list. If the edges appear in the edge list in
no particular order, that's a linear search through |E|
Adjacency matrices
For a graph with |V|, an adjacency matrix is a |V| x |V| matrix
of 0s and 1s, where the entry in row i and column j is 1 if and
only if the edge (i,j) is in the graph. If you want to indicate an
edge weight, put it in the row i, column j entry, and reserve a
special value (perhaps null) to indicate an absent edge.

Here's the adjacency matrix for the social network graph:


Adjacency lists
Representing a graph with adjacency lists combines
adjacency matrices with edge lists. For each vertex i, store
an array of the vertices adjacent to it. We typically have an
array of |V|, one adjacency list per vertex. Here's an
adjacency-list representation of the social network graph:

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy