Topological sorting problems
1. The minimum spanning tree and the terminal path belong to the graph application with loops. Topological sequencing and critical paths are non-ring graph applications. No loop, that is, there is no loop in the figure.
2. Topology sequencing Introduction: In a graph that represents a project, a vertex is used to represent the activity, and an arc is used to denote the priority relationship between the activities , so that the graph is called the net of the activity of the vertex , which we call the AOV net (activity on Vertex Network). The arc in the AOV network indicates that there is some kind of restrictive relationship between the activities. For example, there are actors and venues in order to enter the shooting. In addition, the AOV network can not exist in the loop , so that the beginning of an activity with its own completion as a prerequisite, obviously is not possible.
3. Set g= (v,e) is a direction graph with n vertices, the vertex sequence in V is V1,v2,..... vn, satisfies if there is a path from Vertex VI to VJ, in the vertex sequence, vi must appear before VJ. Then we call such a vertex sequence as a topological sequence (there may be more than one topological sequence for a AOV network).
The so-called topological ordering, in fact, is the process of constructing topological sequences for a graph of graphs. The structure will have two results, if all the vertices of this network are output, then it is no ring (loop) of the AOV network, if the output of the vertex less, even one less, also indicates that the network exists ring (loop), not AOV network. A AOV network with no loops can be used in a variety of engineering or project flowcharts to meet the needs of various application scenarios.
4. The basic idea of the topological sorting algorithm: from the AOV network, select a vertex output with a degree of 0, then delete the vertex and delete the arc at the end of the vertex, and continue repeating this step until all vertices are output or there are no vertices in the AoV net with a 0 (presence ring). The shortest path and minimum spanning tree use the adjacency matrix to store the graph, but because the topology sort needs to delete vertices, it is obviously more convenient to use adjacency tables. The time complexity of the algorithm is O (n+e). n is the number of vertices, and e is the number of edges.
Topological sorting problems