Algorithm: Activity on edge network and key paths

Source: Internet
Author: User

Previously we mentioned that topological sorting is mainly used to solve the problem of whether a project can be executed sequentially, but sometimes we still need to solve the shortest time required for project completion. If we want to obtain the shortest time for a flowchart, we must analyze their topological relationships and find the most critical process. The shortest time is the shortest time.

Based on the previous AOV network, we will introduce a new concept. In a weighted directed graph that represents a project, vertex is used to represent an event, directed edge is used to represent an activity, and edge weight is used to represent the activity duration, the edge of this directed graph indicates the active network, which is called the AOE network ). Because of a project, there is always a start and end. Under normal circumstances, the AOE network has only one source point and one sink point.

Since AOE network represents the engineering process, it has obvious engineering attributes. Each activity starting from a vertex can only start after an event represented by a vertex occurs. The event represented by this vertex can only occur when all activities entering a vertex have been completed.

Although both the AOV network and the AOE network are used to model projects, they are quite different, mainly because the AOV network is a network where vertices represent activity, it only describes the constraints between activities, while the AOE network uses edges to represent the active network. The weights on edges indicate the duration of the activity, and the comparison between the two charts is 7-9-3. Therefore, the AOE network is based on the fact that there is no conflict between the constraints between the activities, and then analyzes the time required to complete the entire project, or to shorten the time required to complete the project, which activities should be accelerated.


After the duration of each activity on the path is called the path length, the path with the maximum length from the source point to the sink point is called the Key Path, and the activity completed on the Key Path is called the key activity. Obviously, for the AOE network in Figure 7-9-3, start-> engine completion-> component concentration in place-> Assembly completion is the Key Path, with a path length of 5.5.

If we need to shorten the entire construction period and improve the production efficiency of the wheel, even if we change it to 0.1, it will not be conducive to the change of the entire construction period, only by shortening the key activity time on the Key Path can the entire duration be reduced. For example, if the engine manufacturing is shortened to 2.5 and the assembly of the entire vehicle is shortened to 1.5, the critical path is 4.5 and the whole day is shortened.

If the earliest start time of an activity is the same as the latest start time, it indicates that there is no gap in the middle, then this activity is a key activity. Therefore, we need to define the following parameters.

1. The earliest event occurrence time ETV (earliest time of vertex): the earliest occurrence time of the vertex VK.

2. The latest event occurrence time LTV (latest time of vertex): the shortest occurrence time of the vertex VK. That is, the latest start time of the event corresponding to each vertex. exceeding this time will delay the entire construction period.

3. the earliest start time of the activity, ete (earliest time of edge), is the earliest occurrence time of the arc AK.

4. The latest start time of the activity, LTE (latest time of edge): The latest occurrence time of the arc AK, that is, the latest start time without delay.


We first obtain 1 and 2, and ete originally represents the earliest start time of the activity <VK, VJ>, which is for the arc, however, only the event of the VK vertex at the end of the arc can start. Therefore, ete = ETV [K].

LTE indicates the last start time of the activity <VK, VJ>, but this activity cannot start until the VJ event occurs, therefore, LTE = LTV [J]-len <VK, VJ>.

In the end, let's determine whether ete and LTE are equal, which means that the activity is not idle and is the Key Path. Otherwise, it is not.


Now let's talk about how to find ETV and LTV.

Suppose we have obtained the ETV [0] = 0 corresponding to vertex v0, ETV [1] = 3 corresponding to vertex V1, ETV [2] = 4 corresponding to vertex V2, now we need to request the ETV [3] corresponding to the vertex V3, which is to find the ETV [1] + Len <V1, V3> and ETV [2] + Len <V2, v3>. Obviously 3 + 5 <4 + 8, and get ETV [3] = 12, 7-9-5.


From this we can also obtain the formula for calculating the earliest occurrence time of the vertex VK, that is, the ETV [k] is:


P [k] indicates a set of all arcs that reach the vertex VK. For example, P [3] of 7-9-5 is two arcs: <V1, V3> and <V2, V3>. Len <VI, VK> is the weight on the arc <VI, VK>.


Suppose we have obtained V9 ~ The LTV value of the V5 vertex, which now requires the LTV value of V4. From the adjacent table, we can obtain that V4 has two arcs: <V4, V6>, <V4, V7>.

LTV [4] = min (LTV [7]-4, LTV [6]-9) = 15, 7-9-8.


We can find that when calculating LTV, we actually reverse the topological sequence. Therefore, we can obtain the formula for calculating the last occurrence time of the vertex VK, that is, the formula for finding the LTV [k] is:


S [k] indicates the set of all arcs starting from the vertex VK. S [4] of 7-9-8 is the two arcs <V4, V6> and <V4, V7>. Len <VK, VJ> is the weight value on the arc <VK, VJ>.


For code analysis, see solving the key path of AOE network.


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.