Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Data structure
1.
2. Topological Sort ?
-it is ordering of vertices in a directed acyclic group .
If its path vi to vj then vj appears after vi in the ordering
Topological ordering is not possible if the graph has acyclic ?.
E.g: v1 v2
v3 v4
v5
v6 v7
3. Algorithm for topologies :
• Create an array of length equal to the number of vertices.
• While the number of vertices is greater than 0, repeat:
.
:• Find a vertex with no incoming edges (“no prerequisites”).
.
• Put this vertex in the array.
.•Note that this destructively updates a graph; often this is a
bad idea, so make a copy of the graph first and do
topological sort on the copy.
4. Topological Sort Algorithm
The Topological sort algorithm is:
int topologicalOrderTraversal( ){
int numVisitedVertices = 0;
while(there are more vertices to be visited){
if(there is no vertex with in-degree 0)
break;
else{
select a vertex v that has in-degree 0;
visit v;
numVisitedVertices++;
delete v and all its emanating edges;
}
}
return numVisitedVertices;
}
5. Just we take this example 4 solve topological graph
Here a=0 because in degree is 4 ‘a’
6. Graph 1
vertex A B C D E F G H
A 0 1 1 0 1 0 0 0
B 0 0 0 0 0 1 0 0
C 0 0 0 1 0 1 1 0
D 0 1 0 0 1 0 0 1
E 0 0 0 0 0 1 0 0
F 0 0 0 0 0 0 0 1
G 0 0 0 0 1 0 0 1
h 0 0 0 0 0 0 0 0
Sum 0 2 1 1 3 3 1 3
of
colum
10. • Prototype of the Ethernet Standard
• Characteristics:
– A central cable (coaxial cable)
– Lines to the attached stations
– Decentralized structure (stations with equal standing)
– All attached stations are affected by disturbance at the central
cable
11. RING Topology
• One token "moves" in the circle (Ring
structure of the network)
• If the token is "free", then the station
can attach a network package
RING TYPE