Introduction.tex
上传用户:gzelex
上传日期:2007-01-07
资源大小:707k
文件大小:11k
开发平台:

MultiPlatform

  1. chapter{Introduction} label{Introduction}
  2. pagenumbering{arabic}
  3. One of the major differences between combinatorial computing
  4. and other areas of computing such as statistics, numerical
  5. analysis and linear programming is the use of complex data types. 
  6. Whilst the built-in types, such as integers, reals, vectors, and matrices,
  7. usually suffice in the other areas, combinatorial computing relies heavily 
  8. on types like stacks, queues, dictionaries, sequences, sorted sequences, 
  9. priority queues, graphs, points, segments, $ldots$
  10. In the fall of 1988, we started a project (called {bf LEDA} for Library of
  11. Efficient Data types and Algorithms) to build a small, but growing library 
  12. of data types and algorithms in a form which allows them to be used by 
  13. non-experts. We hope that the system will narrow the gap between algorithms
  14. research, teaching, and implementation. The main features of LEDA are:
  15. begin{enumerate}
  16. item 
  17.     LEDA provides a sizable collection of data types and algorithms in a form 
  18.     which allows them to be used by non-experts. In the current version, this
  19.     collection includes most of the data types and algorithms described in the 
  20.     text books of the area. 
  21. item 
  22.     LEDA gives a precise and readable specification for each of the data types 
  23.     and algorithms mentioned above.  The specifications are short (typically, 
  24.     not more than a page), general (so as to allow several implementations), 
  25.     and abstract (so as to hide all details of the implementation). 
  26. item
  27.     For many efficient data structures access by position is important. In 
  28.     LEDA, we use an item concept to cast positions into an abstract form. We 
  29.     mention that most of the specifications given in the LEDA manual use this 
  30.     concept, i.e., the concept is adequate for the description of many data 
  31.     types. 
  32. item
  33.     LEDA contains efficient implementations for each of the data types, e.g., 
  34.     Fibonacci heaps for priority queues, skip lists and dynamic perfect 
  35.     hashing for dictionaries, ...
  36. item
  37.     LEDA contains a comfortable data type graph. It offers the standard 
  38.     iterations such as ``for all nodes v of a graph G do'' or ``for all 
  39.     neighbors w of v do'', it allows to add and delete vertices and edges 
  40.     and it offers arrays and matrices indexed by nodes and edges,...  
  41.     The data type graph allows to write programs for graph problems in a 
  42.     form close to the typical text book presentation.
  43. item 
  44.     LEDA is implemented by a CC class library. It can be used with almost
  45.     any CC compiler that supports templates. 
  46. item
  47.     {LEDA is available by anonymous ftp from {bf ftp.mpi-sb.mpg.de} in
  48.     directory /pub/LEDA. The distribution contains all sources, installation 
  49.     instructions, a technical report, and the user manual.}
  50. item
  51.     LEDA is not in the public domain, but can be used freely for research 
  52.     and teaching. Information on a commercial license is available from the 
  53.     author or leda@mpi-sb.mpg.de.
  54. end{enumerate}
  55. This manual contains the specifications of all data types and algorithms 
  56. currently available in LEDA. Users should be familiar with the CC 
  57. programming language (see cite{S91} or cite{Li89}).  The manual 
  58. is structured as follows: In chapter one, which is a prerequisite for all
  59. other chapters, we discuss the basic concepts and notations used in LEDA.
  60. The other chapters define the data types and algorithms available in
  61. LEDA and give examples of their use. These chapters can be consulted
  62. independently from one another.
  63. bigskip
  64. bigskip
  65. {largebf Version 3.0}
  66. The most important changes with respect to previous versions are
  67. begin{enumerate}
  68. item 
  69. Parameterized data types are realized by CC templates. In particular, 
  70. {it declare} macros used in previous versions are now obsolete and the 
  71. syntax for a parameterized data type $D$ with type parameters $T_1,dots,T_k$ 
  72. is $D<T_1,dots,T_k>$ (cf. section ref{Specifications}). 
  73. item
  74. Arbitrary data types (not only pointer and simple types) can be used as
  75. actual type parameters (cf. section ref{Specifications}). 
  76. item
  77. For many of the parameterized data types (in the current version: dictionary, 
  78. priority queue, d_array, and sortseq) there exist variants taking an additional
  79. data structure parameter for choosing a particular implementation 
  80. (cf. section ref{Implementation Parameters}).
  81. item
  82. The LEDA memory management system can be customized for user-defined classes
  83. (cf. section ref{Memory Management}).
  84. item
  85. The efficiency of many data types and algorithms has been improved.
  86. end{enumerate}
  87. See also the ``Changes" file in the LEDA root directory.
  88. newpage
  89. {largebf Version 3.1}
  90. Many changes were made to make LEDA work with new compilers (gg-2.6.3,
  91. Lucid CC, Watcom CC Sunpro CC, ...) and on more platforms (Silicon 
  92. Graphics, IBM, HP, Solaris-2.3, Linux, ...). All reported bugs of version
  93. 3.0 we were able to find and understand have been fixed (see LEDA/Fixes
  94. for a list). Several new data types and algorithms (especially in the graph 
  95. and window section) have been included.
  96. bigskip
  97. {bf Manual Pages}
  98.   All manual pages have been incorporated into the corresponding
  99.   header files. There are tools (in the directory man) to extract and
  100.   typeset the new user manual from these files. A postscript
  101.   version of the manual is available on the ftp server.
  102. bigskip
  103. {bf Parameterized Data Types}
  104.   The  LEDA_TYPE_PARAMETER macro that had to be called for type
  105.   arguments in parameterized data types when using the gg compiler
  106.   is not needed anymore for gg versions $>=$ 2.6.3.
  107. bigskip
  108. {bf Linear Orders, I/O, and Hashing}
  109.   $compare$, $Hash$, $Read$ and $Print$ functions only have to be 
  110.   defined for type parameters of a parameterized data type if they are 
  111.   actually used by operations of the data type. If one of these function 
  112.   is called and has not been defined explicitely, a default version giving
  113.   an error message is instantiated from a function template.
  114.   Except for the built-in types and some basic LEDA types ($string$ and
  115.   $point$) there are no predefined versions of these functions any more.
  116.   In particular, they are not predefined for arbitrary pointer types. 
  117.   You will notice the effect of this change, for instance, when calling 
  118.   the sort operation on a list of pointers $list<T*>$ without a definition 
  119.   of a compare function for $T*$.  Previous LEDA 
  120.   releases sorted the list by increasing addresses of the pointers in 
  121.   this case. In version~3.1 the program will exit with the exception
  122.   ``no compare function defined for $T*$". Operations based on functions
  123.   $Hash$, $Read$, or $Print$ show a similar behavior.
  124. bigskip
  125. {bf Nested Forall Loops }
  126.    The limitation of previous versions that {bf forall}-loops (e.g.
  127.    on lists) could not be nested is no longer valid.
  128. bigskip
  129. {bf Graphs}
  130. The distinction in directed and undirected graphs is not as strict as
  131. in previous versions. Data type $graph$ represents both directed and
  132. undirected graphs. Directed and undirected graphs only differ in the
  133. definition of adjacent edges or nodes. Now, two lists of edges are 
  134. associated with every node $v$: the list
  135. $out_edges(v) = { e in E | source(e) = v }$ of edges starting in $v$,
  136. and the list $in_edges(v) = { e in E | target(e) = v }$ of
  137. edges ending in $v$. 
  138. A graph is either {em directed} or {em undirected}.
  139. In a directed graph an edge is adjacent to its source and in an undirected
  140. graph it is adjacent to its source and target. In a directed graph a node $w$
  141. is adjacent to a node $v$ if there is an edge $(v,w) in E$; in an undirected
  142. graph $w$ is adjacent to $v$ if there is an edge $(v,w)$ or $(w,v)$ in the
  143. graph.  There are iteration macros allowing to iterate over the list of
  144. starting, ending or adjacent edges (cf. ref{Graphs} for details).
  145. bigskip
  146. {bf New Data Types}
  147. The old priority queue type $priority_queue<K,I>$ caused
  148. a lot of confusion because of the non-standard semantics of the type 
  149. parameters $K$ and $I$ (the meaning of {em key} and {em information} 
  150. was exchanged compared to most text book presentations of priority queues).
  151. To eliminate this confusion we introduced a new priority queue type
  152. $p_queue<P,I>$. Now $P$ is called the priority type of the queue.
  153. The basic library has been extended by several numerical data types
  154. including an arbitrary length integer type ($integer$), a type of
  155. rational numbers ($rational$), and two filter types $floatf$ and
  156. $real$. Together with the new types $rat_point$ (points with rational 
  157. coordinates) and $rat_segments$ (segments with rational coordinates) 
  158. they are especially useful in geometric computations. Note, that the
  159. geometric part of LEDA will be extended by more basic objects and
  160. algorithms based on exact arithmetic in the near future.
  161. The temporarily (in LEDA-3.1c) introduced data types $node_data$,
  162. $node_stack$, $node_queue$ are no longer available. Please use $node_map$, 
  163. $edge_map$, $stack<node>$ and $queue<node>$ instead.
  164. A list of the new data types:\
  165. begin{itemize}
  166. item
  167. priority queues     ($p_queue<P,I>$) (cf. ref{Priority Queues})
  168. item
  169. singly linked lists ($slist<T>$)     (cf. ref{Singly Linked Lists})
  170. item
  171. big integers        ($integer$)        (cf. ref{Integers of Arbitrary Length})
  172. item
  173. rational numbers    ($rational$)       (cf. ref{Rational Numbers})
  174. item
  175. rational points     ($rat_point$)     (cf. ref{Rational Points})
  176. item
  177. rational segments   ($rat_segment$)   (cf. ref{Rational Segments})
  178. item
  179. floating point filter ($floatf$)       (cf. ref{A Floating Point Filter})
  180. item
  181. random sources      ($random_source$) (cf. ref{Random Sources})
  182. item
  183. real numbers        ($real$)           (cf. ref{Real Numbers})
  184. item
  185. maps                ($map<I,E>$)     (cf. ref{Maps})
  186. item
  187. node  maps          ($node_map<T>$) (cf. ref{Node Maps})
  188. item
  189. edge maps           ($edge_map<T>$) (cf. ref{Edge Maps})
  190. item
  191. node lists          ($node_list$)     (cf. ref{Lists of Nodes})
  192. item
  193. bounded node priority queues $b_node_pq<n>$ (cf. ref{Bounded Node Priority Queues}).
  194. end{itemize}
  195. bigskip
  196. {bf Graph Generators and Algorithms}
  197. LEDA now offers more generators for different types of graphs (see 
  198. ref{Graph Generators} for a complete list).
  199. The planarity test $PLANAR$ has been re-implemented and
  200. now has a boolean flag parameter $embed$. An embedding of the graph
  201. is computed only if $embed = true$ (the default value is $false$). A second variant of $PLANAR$
  202. computes a Kuratowsky-subgraph in the case of non-planarity.
  203. A new graph algorithm is $MIN_COST_MAX_FLOW$ computing
  204. a maximal flow with minimal cost. 
  205. bigskip
  206. {bf Windows and Panels}
  207. The window and panel data types  now are based on a plain X11 implementation.
  208. New features include\
  209. -- opening more than one window or panel\
  210. -- positioning, displaying, and closing of panels and windows\
  211. -- changing the label of windows and panels\
  212. -- 16 predefined colors\
  213. -- accessing colors from the X11 data base by name\
  214. -- drawing arcs, arc edges, and arc arrows\
  215. -- changing the default fonts, \
  216. -- reading and handling X11 events\
  217. -- a simple graph editor (cf. <LEDA/graph_edit.h>)\