0% found this document useful (0 votes)
3 views2 pages

Graph

The document provides an overview of graph theory, including definitions of nodes, edges, and classifications of graphs such as directed, undirected, complete, and incomplete. It explains vertex degree calculations for both undirected and directed graphs, as well as concepts related to paths, connectivity, and spanning trees. Additionally, it discusses graph representation methods including adjacency matrices and lists, highlighting their complexities and applications in communication networks.

Uploaded by

hikalandsomeone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Graph

The document provides an overview of graph theory, including definitions of nodes, edges, and classifications of graphs such as directed, undirected, complete, and incomplete. It explains vertex degree calculations for both undirected and directed graphs, as well as concepts related to paths, connectivity, and spanning trees. Additionally, it discusses graph representation methods including adjacency matrices and lists, highlighting their complexities and applications in communication networks.

Uploaded by

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

Graph: doesn't have fixed shape as tree

Node/ vertex/ point Edge/ arc/ line

Classification
1-UnDirect: dual arc with no arrow 2-Dirtect: arc with arrow (1 direction)

Another classification according to completion


1-Complete graph: all possibilities are here ex: 3 nodes form a triangle all modes are
connected to each other
2-Incomplete graph: some possibilities are not here ex: if node space is empty

Number above edge is called weight/ Can be directed or undirected weighted.


EX: Applications: communication network
Vertex is city, edge is communication lines

Another classification according to number of edges (max num of edges)


1- directed: n(n-1)/2
2- undirected: n(n-1)

Vertex Degree
to calc the degree for each vertex
Undirected: number of edges connected with it (ex: 3 have 2 edges coming out of it,
degree(3)=2
sum of degree=2e=2*edges
Directed: 1-in degree(edges coming in v) 2-out degree(edges coming out of vertex)
sum of edges= sum in+sum out

Sample graph problem:


1-path: can have no path & can have more than 1 path
2-connceted: any 2 vertices must be connected with each other
if we added new node that is not connected with any other nodes(not connected)
Any graph consist of components if it is connected so all the graph is 1 component else
each sub graph is component
communication network: can communicate between every pair
cycles and connectedness: remove edges that does not affect connection

3-spanning: all vertices are connected (if v=n , so edges=n-1)


search for shortest path (min cost)
Representation: (important)
1-Adjacency matrix
-calc number of vertex -> n^2 (number of rows and cols)
-put the vertices horizontal/vertical
-if directed what is out=1, what is in=0 / if undirected both vertices=1
complexity: O(n^2)

Ex:

2-List
1)Linear list
-create list for each vertex
-write with each list the connected nodes
ex: list[1]=(2,4)
cost: (weighted graph)
C(i,j)=cost of edge(i,j)

2)Linked list
-draw array of n
-each list of array(vertex) connected to a linked list with the connected nodes
cost: (weighted graph)
each list is a pair
Ex:

You might also like