Application of-aov-to-loop graph and topological sorting

Source: Internet
Author: User

directed acyclic graph: acyclic directed graph, abbreviated DAG (Directed acycline graph).

A graph spanning tree is a forward tree, and a number of strongly connected components of a non-connected and forward graph generate a number of forward trees, which are formed to generate forests.

Application in engineering planning and management

In addition to the simplest case, almost all projects can be divided into several sub-projects called "Activities", and these sub-projects are usually subject to certain conditions, such as: Some of the sub-projects must be in other sub-works

Process is complete before you can begin. For the whole project and the system, people are concerned about two aspects of the problem:

First, whether the project can be carried out smoothly, that is, the engineering process is "reasonable";

The second is the shortest time required to complete the project.

Corresponding to the graph is the topological ordering (AoV net) and the critical path (AOE net).

Topological sorting

AOV Net: Use a graph to represent a project of each sub-project and its mutual constraint relationship, in which the vertex represents the activity, the arc represents the priority of the relationship between activities, called the graph as the vertex of the activity of the network , referred to as AOV (activity on Vertex Network).

For example, a project can be divided into 7 sub-projects (V0, V1, V2, V3, V4, V5, V6), if the use of vertices to represent sub-engineering (also known as activity), using arcs to represent the order of sub-engineering relations, the project flow can be described as the following AOV network.

Like a schedule.

AOV Features: If there is a direction path from I to J, I is the precursor of J, and J is the successor of I. If < I, J > is a forward edge in the net, then I is the direct precursor of J, and J is the direct successor of I. Loops are not allowed in the AOV network, because if there is a loop, it is obvious that an activity is a precondition for itself, which is obviously absurd.

Question: How to determine whether there is a circuit in the AOV network? That is, how to AOV network project can be carried out smoothly? Reasonable?

Topology Ordering:

In the AOV network without circuit, we will all the activities arranged into a linear sequence, so that if there is an arc <i in the AOV network, j> exists, then in this sequence, I must be in the front of J, the linear sequence with this property is called topological ordered sequence, the corresponding topological ordering algorithm is called topological row Order.

Attention:

1. If the vertices in the graph are lined up in topological order, all the forward edges in the graph are left-pointing to the right. 2, if there is a forward ring in the diagram, it is impossible to make the vertex to meet the topological order. 3. There may be multiple topological sequences for a DAG.

Detecting the presence of a ring method in a AOV network:

DFS (Depth-First search), there is a ring on the return edge;topological ordering, if all the vertices appear in the topological sort, no loops are present. If you use DFS for topological sorting, the result is an ordered sequence of reverse topological ordering. topology Sorting method:1) Select an unprecedented vertex v in the graph, output it, 2) remove the V from the graph and the arc with V as the tail;

3) Repeat 1), 2), the direct output of all the vertices or the directed graph does not exist without an unprecedented node.

Remove v2,v3,v4,v5,v6 and arcs with them as tails

Note: the topological sequence of a AOV network is not unique

Application of-aov-to-loop graph and topological sorting

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.