tailieunhanh - ALGORITHMS phần 9

mà có thể được coi như trở về góc giữa pl, p2 và ngang (mặc dù nó thực sự trả về một số dễ dàng tính toán hơn với đặt hàng cùng một thuộc tính). Chương trình sau đây tìm thấy thân tàu lồi của một mảng p [I. IV.] Của điểm, biểu diễn như mô tả trong chương trước (vị trí mảng p [N + l] cũng được sử dụng, để giữ một trọng điểm): | 434 CHAPTER 33 The Network Flow Problem Consider the following rather idealized drawing of a small network of oil pipes The pipes are of fixed capacity proportional to their size and oil can flow in them only in the direction indicated perhaps they run downhill or have unidirectional pumps Furthermore switches at each junction control how much of the oil goes in each direction. No matter how the switches are set the system reaches a state of equilibrium when the amount of oil flowing into the system at the left is equal to the amount flowing out of the system at the right this is the quantity that we want to maximize and when the amount of oil flowing in at each junction is equal to the amount of oil flowing out. We measure both flow and pipe capacity in terms of integral units say gallons per second . It is not immediately obvious that the switch settings can really affect the total flow the following example will illustrate that they can. First suppose that all switches are open so that the two diagonal pipes and the top and bottom pipes are full. This gives the following configuration The total into and out of the network in this case is less than half the capacity of the input pipe only slightly more than half the capacity of the output pipe. Now suppose that the upward diagonal pipe is shut off. This shuts flow equal to its capacity out of the bottom and the top is unaffected because there s room to replace its flow from the input pipe thus we have NETWORK FLOW 435 The total flow into and out of the network is increased to substantially. This situation can obviously be modeled using a directed graph and it turns out that the programs that we have studied can apply. Define a network as a weighted directed graph with two distinguished vertices one with no edges pointing in the source one with no edges pointing out the sink . The weights on the edges which we assume to be non-negative are called the edge capacities. Now a flow is defined as another set of weights

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.