**fig9_7.txt** /* 1*/ void /* 2*/ Topsort( Graph G ) /* 3*/ { /* 4*/ unsigned int Counter = 1; /* 5*/ Vertex V, W; /* 6*/ Queue Q( Num_Vertex ); /* 7*/ for Each Vertex V /* 8*/ if( Indegree[ V ] == 0 ) /* 9*/ Q.Enqueue( V ); /*10*/ while( !Q.Is_Empty( ) ) /*11*/ { /*12*/ V = Q.Dequeue( ); /*13*/ Top_Num[ V ] = Counter++; /*14*/ for Each W Adjacent To V /*15*/ if( --Indegree[ W ] == 0 ) /*16*/ Q.Enqueue( W ); /*17*/ } /*18*/ if( Counter <= Num_Vertex ) /*19*/ Error( "Graph has a cycle" ); /*20*/ }