Tải bản đầy đủ (.pdf) (10 trang)

Tài liệu Thuật toán Algorithms (Phần 47) docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (80.94 KB, 10 trang )

453
Exercises
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Find all the matchings with five edges for the given sample bipartite
graph.
Use the algorithm given in the text to find maximum matchings for
random bipartite graphs with 50 vertices and 100 edges. About how many
edges are in the matchings?
Construct a bipartite graph with six nodes and eight edges which has a
three-edge matching, or prove that none exists.
Suppose that vertices in a bipartite graph represent jobs and people and
that each person is to be assigned to two jobs. Will reduction to network
flow give an algorithm for this problem? Prove your answer.
Modify the network flow program of Chapter 33 to take advantage of the
special structure of the O-l networks which arise for bipartite matching.
Write an efficient program for determining whether an assignment for the
marriage problem is stable.
Is it possible for two men to get their last choice in the stable marriage
algorithm? Prove your answer.
Construct a set of preference lists for = 4 for the stable marriage
problem where everyone gets their second choice, or prove that no such
set exists.


Give a stable configuration for the stable marriage problem for the case
where the preference lists for men and women are all the same: in ascend-
ing order.
Run the stable marriage program for = 50, using random permutations
for preference lists. About how many proposals are made during the
execution of the algorithm?
454
SOURCES for Graph Algorithms
There are several textbooks on graph algorithms, but the reader should
be forewarned that there is a great deal to be learned about graphs, that
they still are not fully understood, and that they are traditionally studied
from a mathematical (as opposed to an algorithmic) standpoint. Thus, many
references have more rigorous and deeper coverage of much more difficult
topics than our treatment here.
Many of the topics that we’ve treated here are covered in the book by
Even, for example, our network flow example in Chapter 33. Another source
for further material is the book by Papadimitriou and Steiglitz. Though most
of that book is about much more advanced topics (for example, there is a full
treatment of matching in general graphs), it has up-to-date coverage of many
of the algorithms that we’ve discussed, including pointers to further reference
material.
The application of depth-first search to solve graph connectivity and other
problems is the work of R. E. whose original paper merits further
study. The many variants on algorithms for the union-find problem of Chapter
are ably categorized and compared by van Leeuwen and The
algorithms for shortest paths and minimum spanning trees in dense graphs
in Chapter 31 are quite old, but the original papers by Dijkstra, Prim, and
Kruskal still make interesting reading. Our treatment of the stable marriage
problem in Chapter 34 is based on the entertaining account given by Knuth.
E. W. Dijkstra, “A note on two problems in connexion with graphs,”

Muthemutik,
1 (1959).
S. Even, Graph Algorithms, Computer Science Press, Rockville, MD, 1980.
D. E. Knuth, Marriages stables, Les Presses de de Montreal,
Montreal, 1976.
J. R. Kruskal Jr., “On the shortest spanning of a graph and the
traveling salesman problem,” Proceedings AMS, 7, 1 (1956).
C. H. Papadimitriou and K. Steiglitz, Combinatorial Optimization: Algorithms
and Complexity, Prentice-Hall, Englewood Cliffs, NJ, 1982.
R. C. Prim, “Shortest connection networks and some generalizations,” Bell
System Technical Journal, 36 (1957).
R. E. “Depth-first search and linear graph algorithms,” SIAM Journal
on Computing, 1, 2 (1972).
J. van Leeuwen and R. E. “Worst-case analysis of set-union algo-
rithms,” Journal of the ACM, to appear.
ADVANCED TOPICS

35. Algorithm Machines
The algorithms that we have studied are, for the most part, remarkably
robust in their applicability. Most of the methods that we have seen
are a decade or more old and have survived many quite radical changes in
computer hardware and software. New hardware designs and new software
capabilities certainly can have a significant impact on specific algorithms, but
good algorithms on old machines are, for the most part, good algorithms on
new machines.
One reason for this is that the fundamental design of “conventional”
computers has changed little over the years. The design of the vast majority
of computing systems is guided by the same underlying principle, which was
developed by the mathematician J. von Neumann in the early days of modern
computing. When we speak of the von Neumann model of computation, we

refer to a view of computing in which instructions and data are stored in the
same memory and a single processor fetches instructions from the memory
and executes them (perhaps operating on the data), one by one. Elaborate
mechanisms have been developed to make computers cheaper, faster, smaller
(physically), and larger (logically), but the architecture of most computer
systems can be viewed as variations on the von Neumann theme.
Recently, however, radical changes in the cost of computing components
have made it plausible to consider radically different types of machines, ones
in which a large number of instructions can be executed at each time instant
or in which the instructions are “wired in” to make special-purpose machines
capable of solving only one problem or in which a large number of smaller
machines can cooperate to solve the same problem. In short, rather than
having a machine execute just one instruction at each time instant, we can
think about having a large number of actions being performed simultaneously.
In this chapter, we shall consider the potential effect of such ideas on some of
the problems and algorithms we have been considering.
457

×