Algorithm research: AOV Network and topology sequencing

Source: Internet
Author: User

In a direction diagram of a representation project, an activity is represented by a vertex, and an arc is used to denote the priority relationship between activities, such that a graph is a vertex representing an active network, which we call the AOV network (activity on Vextex Network). The arcs in the AOV network indicate that there is some kind of restriction relationship between the activities, the AOV network can not exist in the circuit, so that the beginning of an activity to complete its own as a prerequisite, it is obviously not possible.

Set g= {V, E} is a forward graph with n vertices, vertex sequences in V, V2, ..., vn, satisfying if there is a path from the Vertex VI to the VJ, then the Vertex VI must precede the VJ in the vertex sequence, then we call such a vertex sequence to be a topological sort.

The so-called topological ordering, in fact, is the process of constructing a topological sequence for a direction graph. Construction will have two results, if the entire vertex of the network is output, it is not exist (loop) of the AOV network; If the output vertex is less, even if one is missing, it also shows that the network has a loop, not a AOV network.

The basic idea of topology sequencing for AOV Networks is: Select a vertex output of 0 from the AOV network, then delete the vertex and remove the arc at the end of the vertex, and continue to repeat this step until all vertices are output or 0 vertices are not present in the AOV network.

Because in the process of topology sequencing, the need to delete vertices, it is obvious that the structure of the adjacency table will be more convenient, considering the algorithm is always to find the degree of 0 vertex, we can in the original vertex table node structure, add an entry field in, that is, the number of degrees, The deletion of an arc at the end of a vertex, as mentioned above, also removes the arc of the intermediate connection by subtracting 1 from the adjacent point of a vertex.

For the first graph of graph 7-8-2, the data structure of adjacency table can be obtained AOV the second image.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.