Posted by: tagrawal | September 30, 2010

Lecture-13 Graphs

(Guest post by Tushar Agrawal)

In today’s lecture we learned some basic definitions of graphs.

Graph:-

  • G = (V, E), Where V (set of vertices) and E (set of edges).
  • Two vertices, u and v are connected by an edge ((u,v) Є E).

Undirected Graphs (Symmetric)

  • if (u,v) Є E. then (v,u) Є E ( V goes to U  and U goes to V)



But we can make an undirected graph to it’s equivalent directed graph.

Directed Graphs (Asymmetric)

  • (u,v) Є E but there is no edge where (v,u). which basically means U goes to V but V does not go to U

Couple of Examples from class:

1)    TV host graph

2)    Airplane Route

3)    Internet graph (Depends on conditions given)

Path:

  • A path is a sequence of vertices (V1,V2,………Vk)

Such that (Vi,Vi+1) Є E    1≤ i ≤ k-1

V1————– V2—————– V3

Cycle:

  • A cycle is a sequence (V1,V2,………Vk-1) where Vk = V1
  • Distance between V & U = shortest path length between V & U
  • A simple path is a path with no repeated vertices.
  • Length of path = number of edges in it
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: