abstract.plaintex
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:11k
源码类别:

通讯编程

开发平台:

Visual C++

  1. % EXTENDED ABSTRACT DESCRIBING THE STANFORD GRAPHBASE
  2. magnificationmagstep1
  3. advancevsize by 1.5baselineskip
  4. parskip3pt plus 1pt
  5. fontsc=cmcsc10
  6. defdisleft#1:#2:#3par{parhangindent#1noindent
  7.  hbox to #1{#2 hfill hskip .1em}ignorespaces#3par}
  8. defTeX{Thbox{hskip-.1667emlower.424exhbox{E}hskip-.125em X}}
  9. defbiba{parparindent 40pthangindent 60pt}
  10. centerline{bf The Stanford GraphBase:
  11.                 A Platform for Combinatorial Computing}
  12. smallskip
  13. centerline{sl Donald E. Knuth, Stanford University}
  14. noindent
  15. A highly portable collection of programs and data is now
  16. available to researchers who study combinatorial algorithms and data
  17. structures. All files are in the public domain and usable with
  18. only one restriction: They must not be changed! A~``change file''
  19. mechanism allows local customization while the master files stay
  20. intact.
  21. The programs are intended to be interesting in themselves as examples
  22. of ``literate programming.'' Thus, the Stanford GraphBase can also be
  23. regarded as a collection of approximately 30 essays for programmers to
  24. enjoy reading, whether or not they are doing algorithmic research. The
  25. programs are written in {tt CWEB}, a~combination of TeX and~C that
  26. is easy to use by anyone who knows those languages and easy to read by
  27. anyone familiar with the rudiments of~C. (The {tt CWEB} system is
  28. itself portable and in the public domain.)
  29. Four program modules constitute the {it kernel/} of the GraphBase:
  30. {
  31. biba
  32. {sc gb_$,$flip} is a portable random number generator;
  33. biba
  34. {sc gb_$,$graph} defines standard data structures for graphs and
  35. includes routines for storage allocation;
  36. biba
  37. {sc gb_$,$io} reads data files and makes sure they are uncorrupted;
  38. biba
  39. {sc gb_$,$sort} is a portable sorting routine for 32-bit keys
  40. in linked lists of nodes.
  41. }
  42. noindent
  43. All of the other programs rely on {sc gb_$,$graph} and some subset
  44. of the other three parts of the kernel.
  45. A dozen or so {it generator modules/} construct graphs that are of
  46. special interest in algorithmic studies. For example, {sc
  47. gb_$,$basic} contains 12~subroutines to produce standard graphs,
  48. such as the graphs of queen moves on $d$-dimensional rectangular
  49. boards with ``wrap-around'' on selected coordinates. Another generator
  50. module, {sc gb_$,$rand}, produces several varieties of
  51. random graphs.
  52. Each graph has a unique identifier that allows researchers all over
  53. the world to work with exactly the same graphs, even when those graphs
  54. are ``random.'' Repeatable experiments and standard benchmarks will
  55. therefore be possible and widely available.
  56. Most of the generator modules make use of {it data sets}, which the
  57. author has been collecting for 20~years in an attempt to provide
  58. interesting and instructive examples for some forthcoming books on
  59. combinatorial algorithms ({sl The Art of Computer Programming},
  60. Volumes 4A, 4B, and~4C). For example, one of the data sets is {tt
  61. words.dat}, a~collection of 5-letter words of English that the author
  62. believes is ``complete'' from his own reading experience. Each word is
  63. accompanied by frequency counts in various standard corpuses of text,
  64. so that the most common terms can be singled out if desired. {sc
  65. gb_$,$words} makes a subset of words into a graph by saying that two
  66. words are adjacent when they agree in~4 out of~5 positions. Thus, we
  67. can get from {tt words} to {tt graph} in seven steps:
  68. disleft 30pt::
  69. {tt words, wolds, golds, goads, grads, grade, grape,  graph.}
  70. noindent
  71. This is in fact the shortest such chain obtainable from {tt
  72. words.dat}.
  73. A dozen or so {it demonstration modules/} are also provided, as
  74. illustrations of how the generated graphs can be used. For example,
  75. the {sc ladders} module is an interactive program to construct chains
  76. of 5-letter words like the one just exhibited, using arbitrary subsets
  77. of the data. If we insist on restricting our choices to the 2000 most
  78. common words, instead of using the entire collection of about 5700, the
  79. shortest path from {tt words} to {tt graph} turns out to have
  80. length~20:
  81. disleft 30pt::
  82. {tt words, lords, loads, leads, leaps, leapt, least,}
  83. vskip-5pt
  84. disleft 30pt::
  85. {tt  lease, cease, chase, chose, chore, shore, shone,}
  86. vskip-5pt
  87. disleft 30pt::
  88. {tt phone, prone, prove, grove, grave,
  89. grape, graph.}
  90. Several variations on this theme have also been implemented. If we consider
  91. the distance between adjacent words to be alphabetic distance, for
  92. example, the shortest path from {tt words} to {tt graph} turns out
  93. to be
  94.  
  95. disleft 30pt::
  96. {tt words} (3) {tt woods} (16) {tt goods} (14) {tt goads} (3)
  97. {tt grads} (14) {tt grade} (12) {tt grape} (3) {tt graph},
  98. noindent
  99. total length 65. 
  100. The {tt LADDERS} module makes use of another GraphBase module called
  101. {sc gb_$,$dijk}, which carries out Dijkstra's algorithm for
  102. shortest paths and allows the user to plug in arbitrary
  103. implementations of priority queues so that the performance of
  104. different queuing methods can be compared.
  105. The graphs produced by {sc gb_$,$words} are undirected. Other
  106. generator modules, like {sc gb_$,$roget}, produce directed graphs.
  107. Roget's famous {sl Thesaurus/} of 1882 classified all concepts into 1022
  108. categories, which we can call the vertices of a graph; an arc goes
  109. from~$u$ to~$v$ when category~$u$ contains a cross reference to
  110. category~$v$ in Roget's book. A~demonstration module called {sc
  111. roget_$,$components} determines the strong components of graphs
  112. generated by {sc gb_$,$roget}. This program is an exposition of
  113. Tarjan's algorithm for strong components and topological sorting of
  114. directed graphs.
  115. Similarly, 
  116. world literature leads to further interesting families of undirected
  117. graphs via
  118. the {sc gb_$,$books} module. Five data sets {tt anna.dat}, {tt
  119. david.dat}, {tt homer.dat}, {tt huck.dat}, and {tt jean.dat} give
  120. information about {sl Anna Karenina}, {sl David Copperfield}, {sl
  121. The Iliad}, {sl Huckleberry Finn}, and {sl Les Mis'erables}. As
  122. you might expect, the characters of each work become the vertices of a
  123. graph. Two vertices are adjacent if the corresponding characters
  124. encounter each other, in selected chapters of the book. 
  125. A~demonstration program called
  126. {sc book_$,$components} finds the blocks (i.e., biconnected
  127. components) of these graphs using the elegant algorithm of Hopcroft
  128. and Tarjan.
  129. Another module, {sc gb_$,$games}, generates graphs based on college
  130. football scores. All the games from the 1990 season
  131.  between America's leading 120
  132. teams are recorded in {tt games.dat}; this data leads to ``cliquey''
  133. graphs, because most of the teams belong to leagues and they play
  134. every other team in their league. The overall graph is, however,
  135. connected. A~demonstration module called {sc football} finds long
  136. chains of scores, to prove for instance that Stanford might have trounced
  137. Harvard by more than 2000 points if the two teams had met---because
  138. Stanford beat Notre Dame by~5, and Notre Dame beat Air Force by~30,
  139. and Air Force beat Hawaii by~24, and dots~, and Yale beat Harvard
  140. by~15. (Conversely, a~similar ``proof'' also ranks Harvard over
  141. Stanford by more than 2000 points.) No good algorithm is known for
  142. finding the optimum solution to problems like this, so the data
  143. provides an opportunity for researchers to exhibit better and better
  144. solutions with better and better techniques as algorithmic
  145. progress is made.
  146. The {sc gb_$,$econ} module generates directed graphs based on the
  147. flow of money between industries in the US economy. A~variety of
  148. graphs can be obtained, as the economy can be divided into any number of
  149. sectors from~2 to~79 in this model.
  150.  A~demonstration program {sc econ_$,$order}
  151. attempts to rank the sectors in order from ``suppliers'' to
  152. ``consumers,'' namely to permute rows and columns of a matrix so as to
  153. minimize the sum of entries above the diagonal. A reasonably efficient
  154. algorithm for this problem is known, but it is very complicated. Two
  155. heuristics are implemented for comparison, one ``greedy'' and the other
  156. ``cautious.'' Greed appears to be victorious, at least in the economic sphere.
  157. The highway mileage between 128 North American cities appears in {tt
  158. miles.dat}, and the {sc gb_$,$miles} module generates a variety of
  159. graphs from~it. Of special interest is a demonstration module called
  160. {sc miles_$,$span}, which computes the minimum spanning trees of
  161. graphs output by {sc gb_$,$miles}. Four algorithms for minimum
  162. spanning trees are implemented and compared, including some that are
  163. theoretically appealing but do not seem to fare so well in practice.
  164. An approach to comparison of algorithms called ``mem counting'' is
  165. shown in this demonstration to be an easily implemented
  166. machine-independent measure of efficiency that gives a reasonably fair
  167. comparison between competing techniques.
  168. A generator module called {sc gb_$,$raman} produces ``Ramanujan
  169. graphs,'' which are important because of their role as expander
  170. graphs, useful for communication. A~demonstration module called {sc
  171. girth} computes the shortest circuit and the diameter of Ramanujan
  172. graphs. 
  173. Notice that some graphs, like those produced by {sc gb_$,$basic} or
  174. {sc gb_$,$raman}, have a rigid mathematical structure; others, like
  175. those produced by {sc gb_$,$roget} or {sc gb_$,$miles}, are more
  176. ``organic'' in nature. It is interesting and important to test
  177. algorithms on both kinds of graphs, in order to see if there is any
  178. significant difference in performance.
  179. A generator module called {sc gb_$,$gates} produces graphs of logic
  180. circuits. One such family of graphs is equivalent to a simple RISC
  181. chip, a~programmable microcomputer with a variable number of registers.
  182. Using such a ``meta-network''
  183. of gates, algorithms for design automation can be tested for a range
  184. of varying parameters. A~demonstration module {sc take_$,$risc}
  185. simulates the execution of the chip on a sample program. Another
  186. meta-network of gates will perform parallel multiplication of $m$-bit
  187. numbers by $n$-bit numbers or by an $n$-bit constant; the {sc
  188. multiply} module demonstrates these circuits.
  189. Planar graphs are generated by {sc gb_$,$plane}, which includes
  190. among other things an implementation of the best currently known
  191. algorithm for Delaunay triangulation.
  192. Pixel data can lead to interesting bipartite graphs. Leonardo's {sl
  193. Gioconda/} is represented by {tt lisa.dat}, an array of pixels that
  194. is converted into graphs of different kinds by {sc gb_$,$lisa}.
  195. A~demonstration routine {sc assign_$,$lisa} solves the assignment
  196. problem by choosing one pixel in each row and in each column so that
  197. the total brightness of selected pixels is maximized. Although the
  198. assignment problem being solved here has no relevance to art
  199. criticism or art appreciation, it does have great pedagogical value,
  200. because there is probably no better way to understand the
  201. characteristics of a large array of numbers than to perceive the array
  202. as an image.
  203. A~module called {sc gb_$,$save}
  204. converts GraphBase graphs to and from an ASCII format that
  205. readily interfaces with other systems for graph manipulation.
  206. For further information see {sl The Stanford GraphBase}, published by
  207. ACM Press in 1993. The book could also be
  208. called ``Fun and games with the Stanford GraphBase,'' because the
  209. demonstration programs are great toys to play with. Indeed, the author
  210. firmly believes that the best serious work is also good fun. We
  211. needn't apologize if we enjoy doing research.looseness-1
  212. bye