home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ledar34.zip / LEDAFAQ.TXT < prev    next >
Text File  |  2002-01-27  |  20KB  |  578 lines

  1. [Go to Google Groups Home]    Advanced Groups Search    Groups Help
  2.                     Groups
  3.  
  4. Groups search result 23 for os/2 group:comp.lang.c++.leda group:comp.lang.c++.leda
  5.  
  6. From: Christian Uhrig (uhrig@mpi-sb.mpg.de)                Search Result 23
  7. Subject: FAQ, corrected version
  8. Newsgroups: comp.lang.c++.leda
  9. Date:     View: (This is the only article in this thread) | Original Format
  10. 1996/07/02
  11.  
  12.                         The  Leda FAQ File
  13.                         ------------------
  14.                         ------------------
  15.  
  16. This is the posting of the Frequently Asked Questions about
  17. LEDA and the `comp.lang.c++.leda' newsgroup. It is posted twice a
  18. month.
  19.  
  20. Newsgroup: comp.lang.c++.leda
  21.  
  22. Date: 02.07.96
  23.  
  24. Number: 14
  25.  
  26. Contents
  27. --------
  28.  
  29.    I) Introduction
  30.  
  31.     1. What is LEDA?
  32.     2. From where can i get information about LEDA?
  33.     3. How can i get LEDA?
  34.     4. What is the current version of LEDA?
  35.     5. From where can i get information about the commercial version
  36.        and the license terms?
  37.  
  38.   II) Bugs
  39.  
  40.     1. What can i do if i find a bug?
  41.     2. Are bug fix releases available?
  42.  
  43.  III) Platforms
  44.  
  45.  ?  1. On what platforms and with which compilers can LEDA be used?
  46.     2. Can LEDA be used with other programming languages?
  47.     3. Will LEDA take care of name conflicts with other packages?
  48.     4. Is there still a non-template version of LEDA available?
  49.     5. Why does LEDA not use standard templates to realize parameterized
  50.        data types?
  51.     6. Is an on-line user manual available?
  52.     7. The manual seems to be typeset for european paper size (A4)
  53.        how can I print it on the standard us paper?
  54.     8. Where can I read more about the internals (e.g. realization of
  55.        parameterized data types)?
  56.     9. Is LEDA multithread safe?
  57.  
  58.  
  59.   IV) Basics
  60.  
  61.     1. How do I delete entries in a d_array?
  62.     2. Why are modifications in forall-loops not allowed ?
  63.     3. Are preconditions checked or not (is there a way to control this)
  64.     4. What is the LEDA item concept?
  65.     5. Does LEDA support persistent data structures
  66.  
  67.    V) Graphs
  68.  
  69.     1. Why does LEDA complain when i try to insert an edge between two
  70.        nodes of a graph G into a copy of graph G?
  71.     2. There seems to be a subgraph type, however, it is not mentioned
  72.        in the manual?
  73.     3. Node and edge arrays work only for static graphs, what do I
  74.        do if the node/edge set changes dynamically?
  75.     4. What graph/network algorithms are available in LEDA?
  76.     5. Can I derive my own node/edge type from the LEDA type "node"
  77.        ("edge")?
  78.     6. How can I search for a particular edge (v,w) in a Graph?
  79.  
  80.   VI) GRAPHICS
  81.  
  82.     1. Does the LEDA graphics work on platforms other than X11?
  83.  
  84.  VII) Problems
  85.  
  86.     1. What does it mean if i get a runtime error : "compare undefined"
  87.        or"Hash undefined"?
  88.     2. Why does the compiler instantiate the predefined function
  89.        template compare (Hash) although i have defined my own?
  90.     3. Why do i get the runtime error "compare undefined" when calling
  91.        the list::search function.
  92.     4. What does it mean if the compiler complains about the functions
  93.        Clear, Convert and Copy?
  94.     5. Why does the g++ 2.7.0 compiler complain about undefined integer
  95.        variables in old programs that did work with the previous
  96.        compiler version (or when compiling an old LEDA version)?
  97.  
  98. VIII) General questions
  99.  
  100.     1. What is the run time/space overhead compared to programs written
  101.        in C?
  102.  
  103.     2. Which user projects are using LEDA?
  104.  
  105.   +: new item
  106.   !: changed
  107.   ?: additional information would be appreciated
  108.  
  109. -----------------------------------------------------------------------
  110. -----------------------------------------------------------------------
  111.  
  112. I) Introduction
  113. ---------------
  114.  
  115. 1. What is LEDA?
  116.  
  117.                                   LEDA
  118.  
  119.              A Library of Efficient Data Types and Algorithms
  120.  
  121.                    Max-Planck-Institut fuer Informatik
  122.                Im Stadtwald, D-66123 Saarbruecken, Germany
  123.  
  124.                         (leda@mpi-sb.mpg.de)
  125.  
  126.  
  127. LEDA is a library of the data types and algorithms of combinatorial
  128. computing.
  129.  
  130. The main features are:
  131. 1)  LEDA provides a sizable collection of data types and algorithms in a
  132.     form which allows them to be used by non-experts. In the current
  133.     version, this collection includes most of the data types and
  134.     algorithms described in the text books of the area.
  135.  
  136.  
  137. 2)  LEDA gives a precise and readable specification for each of the data
  138.     types and algorithms mentioned above.  The specifications are short
  139.     (typically not more than a page), general (so as to allow several
  140.     implementations), and abstract (so as to hide all details of the
  141.     implementation).
  142.  
  143. 3)  For many efficient data structures access by position is important.
  144.     In LEDA, we use an item concept to cast positions into an abstract
  145.     form. We mention that most of the specifications given in the LEDA
  146.     manual use this concept, i.e., the concept is adequate for the
  147.     description of many data types.
  148.  
  149.  
  150. 4)  LEDA contains efficient implementations for each of the data types,
  151.     e.g., Fibonacci heaps for priority queues, red-black trees and
  152.     dynamic perfect hashing for dictionaries, ...
  153.  
  154. 5)  LEDA contains a comfortable data type graph. It offers the standard
  155.     iterations such as ``for all nodes v of a graph G do'' or ``for all
  156.     neighbors w of v do'', it allows to add and delete vertices and
  157.     edges and it offers arrays and matrices indexed by nodes and edges,
  158.     ... The data type graph allows to write programs for graph problems
  159.     in a form close to the typical text book presentation.
  160.  
  161. 6)  LEDA is implemented by a C++ class library. It can be used with
  162.     many C++ compilers (cfront2.1, cfront3.0, g++, SunPro ...).
  163.  
  164. 7)  LEDA is not in the public domain, but can be used freely for
  165.     academic research and teaching (this does not include research
  166.     within a company or state/government departement).
  167.     For information concerning a commercial license please contact
  168.     leda@mpi-sb.mpg.de.
  169.  
  170. 2. From where can i get information about LEDA?
  171.  
  172. World Wide Web:
  173.  
  174.             http://www.mpi-sb.mpg.de/LEDA/leda.html
  175.  
  176. anonymous ftp:
  177.  
  178.             ftp.mpi-sb.mpg.de    in   pub/LEDA
  179.  
  180. email:      leda@mpi-sb.mpg.de
  181.  
  182. Fax:        +49 681 / 9325 123
  183.  
  184. Phone:      +49 681 / 9325 199
  185.  
  186. Address:
  187.             Dr. Christian Uhrig
  188.             Max-Planck-Institut fuer Informatik
  189.             Im Stadtwald
  190.  
  191.             66123 Saarbruecken
  192.             Germany
  193.  
  194. Commercial version:
  195.  
  196.             LEDA Software GmbH
  197.             Postfach 15 11 01
  198.             66041 Saarbruecken
  199.             Germany
  200.  
  201.             email: leda@mpi-sb.mpg.de
  202.             Phone/Fax: +49 681 / 84 25 02
  203.  
  204. 3. How can i get LEDA?
  205.  
  206. The LEDA version for academic research is available
  207. by anonymous ftp from
  208.  
  209.     ftp.mpi-sb.mpg.de        pub/LEDA
  210.  
  211. or via WWW from
  212.  
  213.     http://www.mpi-sb.mpg.de/LEDA/leda.html
  214.  
  215. 4. What is the current version of LEDA?
  216.  
  217. The current research version of LEDA is LEDA-R 3.3.1
  218. The current commercial version is LEDA 3.3.
  219.  
  220. 5. From where can i get information about the commercial version
  221.    and the license terms?
  222.  
  223. Via World Wide Web homepage
  224.  
  225.     http://www.mpi-sb.mpg.de/LEDA/leda.html
  226.  
  227. or from
  228.             email: leda@mpi-sb.mpg.de
  229.  
  230.             LEDA Software GmbH
  231.             Postfach 15 11 01
  232.             66041 Saarbruecken
  233.             Germany
  234.  
  235.             Phone/Fax: +49 681 / 84 25 02
  236.  
  237. -----------------------------------------------------------------------
  238. -----------------------------------------------------------------------
  239.  
  240. II) Bugs
  241. --------
  242.  
  243. 1. What can i do if i find a bug.
  244.  
  245. Send an email to leda@mpi-sb.mpg.de. This email should contain
  246. a) the platform you`re using (machine, operating system + version,
  247. compiler + version)
  248. b) a description of the problem (for instance compiler messages)
  249. c) a short example program (with description what it is supposed to do,
  250. please).
  251.  
  252. 2. Are bug fix releases available?
  253.  
  254. Yes. From time to time a bug fix release and a diff file from the
  255. current release is made available on our server.
  256.  
  257. -----------------------------------------------------------------------
  258. -----------------------------------------------------------------------
  259.  
  260. III) Platforms (Operating Systems, Compilers, ...)
  261. --------------------------------------------------
  262.  
  263. 1. On what platforms and with which compilers can LEDA be used?
  264.  
  265. We tested it with
  266.  
  267. SunOs 4.1.3                     g++, AT&T cfront, SunPro 4.0.1, lcc 3.1
  268. Solaris                         g++, SunPro 4.0.1, lcc 3.1
  269. IBM                             xlC (CSet++, Aix)
  270. HP-UX                           g++, HP C++
  271. Linux                           g++
  272. SGI                             SGI CC, g++
  273. Dos                             Watcom 10.0, Borland 4.5, Zortech 3.1, emx
  274. Windows 3.1                     Borland 4.5 (not very stable), Watcom 10.5
  275. OS/2                            Watcom 10.5, CSet++, g++
  276. Windows NT, Windows 95          MSVC++ 4.0, Watcom 10.5
  277.  
  278. Other people use it with
  279.  
  280. Dec Alpha                       Dec C++, gcc, cxx
  281. AmigaOS 3.1                     g++
  282.  
  283. We would like to know
  284.  
  285. - whether there are more platforms where LEDA is in use
  286. - which problems did arise there
  287. - which modification had to be made
  288.  
  289. Thank you very much.
  290.  
  291. 2. Can LEDA be used with other programming languages?
  292.  
  293. No. LEDA only works with C++.
  294.  
  295. 3. Will LEDA take care of name conflicts with other packages?
  296.  
  297. As soon as name spaces are supported by all compilers, it is planned
  298. to use them.
  299. From the version 3.3 the user can choose whether he/she gives the
  300. LEDA types the prefix leda_ or not.
  301. See the installation guidelines for more information.
  302.  
  303. 4. Is there still a non-template version of LEDA available?
  304.  
  305. No.
  306.  
  307. 5. Why does LEDA not use standard templates to realize parameterized
  308.    data types?
  309.  
  310. LEDA uses templates only on the top most level to derive a parameterized
  311. data type from the implementation class. Thus the convenience of
  312. templates is saved. Using C++ templates on each level has the effect
  313. that a large amount of code has to be (re)compiled when
  314. instantiating a parameterized data type, e.g., dictionary<K,I> D
  315. would cause a re-compilation of the underlying data structure
  316. (e.g. skiplist) with actual key parameter K and information parameter I.
  317. When using several instances of the same data types with different
  318. actual type parameters this leads also to code duplication. LEDA
  319. tries to encapsulate those parts of the code that depend on the
  320. type parameters in small (inlined) virtual functions (e.g. the
  321. cmp_key function for dictionaries). Then only these small parts
  322. have to be recompiled. Most of the code is type-independent and
  323. is never looked at by the compiler when compiling an application
  324. program. This is achieved by internally using (generic) pointers to
  325. the data to be stored in container types. Details of the implementation
  326. will be described in the LEDA book that will appear at the end of 1995.
  327.  
  328. 6. Is an on-line user manual available?
  329.  
  330. Yes. There is a command "tman" which gives you the contents of the
  331. manual pages for the type "typename" which is given as argument.
  332. Example:   tman array
  333.  
  334. 7. The manual seems to be typeset for european paper size (A4)
  335.    how can I print it on the standard us paper?
  336.  
  337. You have to change the parameters in the beginning of the
  338. MANUAL.mac file.
  339.  
  340. 8. Where can I read more about the internals (e.g. realization of
  341.    parameterized data types)?
  342.  
  343. Kurt Mehlhorn and Stefan N"aher are writing a book that will appear
  344. in the second half of the year and contains many details about
  345. the realization of LEDA.
  346.  
  347. 9. Is LEDA mulitthread safe?
  348.  
  349. Not yet. But currently, we're changing the code in order to support
  350. multithread safety.
  351.  
  352. -----------------------------------------------------------------------
  353. -----------------------------------------------------------------------
  354.  
  355. IV) Basics
  356. ---------
  357.  
  358. 1. How do I delete entries in a d_array?
  359.  
  360. In the current version deletion of entries in d_arrays is not supported
  361. but will be the next version.
  362.  
  363. 2. Why are modifications in forall-loops not allowed ?
  364.  
  365. A forall-statement should iterate over all elements contained in a
  366. collection at the time of the beginning of the iteration.  This, however
  367. is hard to implement or very costly if the contents of the collection is
  368. allowed to be changed inside the body of the loop. Therefore, we decided
  369. not to allow it. This condition is not checked (would be too expensive)
  370. and  this causes some problems. A typical problem occurs if you want to
  371. make a graph bidirected by inserting a reverse edge for every edge of
  372. the graph. The following piece
  373. of code will cause an endless loop
  374.  
  375. forall_edges(e,G) G.new_edge(target(e),source(e));
  376.  
  377. Two possible ways of doing it right
  378.  
  379.  i) make a copy (expensive)
  380.     list<edge> L = G.all_edges();
  381.     forall(e,L) G.new_edge(target(e),source(e));
  382.  
  383. ii) implement iteration with G.first_edge(),G.last_edge(), and  G.succ_edge()
  384.     edge last_e = G.last_edge();
  385.     for(e=G.first_edge(); e!=last_e; e = G.succ_edge(e) ) G.new_edge ...
  386.     if (last_e) G.new_edge(target(last_e),source(last_e));
  387.  
  388. A similar proble can arise if you delete the current element in an
  389. iteration loop from its collection.
  390.  
  391. 3. Are preconditions checked or not (is there a way to control this)
  392.  
  393. Currently only a few preconditions are checked. In the future it there
  394. will be two classes of preconditions. Class 1 will be always checked.
  395. The checking of class 2 will be controlled by a compiler option.
  396.  
  397. 4. What is the LEDA item concept?
  398.  
  399. The item concept in LEDA allows access by position in a clean and controlled
  400. way. All container data types are defined as collection of certain items.
  401. These items are created by insert operations and can be returned by access
  402. operations (e.g. lookup). This enables the application program to access
  403. the information associated the the item directly and in constant time without
  404. any search operation beeing involved. This access, however, is restricted.
  405. For instance, you can change the information of a dictionary item by a
  406. change_inf operation, but there is no way to change its key - because
  407. this would corrupt the underlying data structure. See the LEDA manual,
  408. for a detailed description and for examples.
  409.  
  410. 5. Does LEDA support persistent data structures
  411.  
  412. In the current version LEDA does not support persistency. However,
  413. it is possible, to save and restore the contents of many data types
  414. (e.g. graphs) by special read/write functions.
  415.  
  416. -----------------------------------------------------------------------
  417. -----------------------------------------------------------------------
  418.  
  419. V) Graphs
  420. ---------
  421.  
  422. 1. Why does LEDA complain when i try to insert an edge between two
  423.    nodes of a graph G into a copy of graph G?
  424.  
  425. Each copy of a graph has its own set ofnodes and each node does belong
  426. to at most one graph. Thus one has to insert the edge between the copies
  427. of the nodes.
  428.  
  429. 2. There seems to be a subgraph type, however, it is not mentioned in the manual?
  430.  
  431. Subgraphs are experimental at the moment, they will be fully implemented
  432. in the future.
  433.  
  434. 3. Node and edge arrays work only for static graphs, what do I do if the node/edge
  435. set changes dynamically.
  436.  
  437. Use node_map/edge_map instead.
  438.  
  439. 4. What graph/network algorithms are available in LEDA
  440.  
  441. The following is the list of the algorithms. See the manual for the
  442. names of the procedures.
  443.  
  444. All pairs shortest paths.
  445. Bellman Ford algorithm.
  446. Breadth first search.
  447. Connected Components.
  448. Depth first search.
  449. Dijkstra's algorithm.
  450. Maximal cardinality matching.
  451. Maximal cardinality bipartite matching.
  452. ! Minimum cut.
  453. Maximum flow algorithm.
  454. Maximum weighted bibartite matching.
  455. ! Maximum weighted matching.
  456. Minimum spanning tree.
  457. Planarity test.
  458. Spanning tree.
  459. Straight line embedding of planar graphs.
  460. Strongly connected components.
  461. Topological sorting.
  462. Transitive closure of graphs.
  463. Triangulating planar maps.
  464.  
  465. 5. Can I derive my own node/edge type from the LEDA type "node" ("edge")?
  466.  
  467. No, node and edge are item types (implemented by pointers).
  468.  
  469. 6. How can I search for a particular edge (v,w) in a Graph?
  470.  
  471. This operation is not supported efficiently at the moment, you can use
  472. a node_matrix with n^2 space; it will be implemented by two-dimensionl
  473. maps in the future.
  474.  
  475. -----------------------------------------------------------------------
  476. -----------------------------------------------------------------------
  477.  
  478. VI) GRAPHICS
  479. ------------
  480.  
  481. 1. Does the LEDA graphics work on platforms other than X11?
  482.  
  483. There are versions that work on MS-DOS, OS2, Windows 3.1, Windows NT and
  484. Windows 95.
  485.  
  486. -----------------------------------------------------------------------
  487. -----------------------------------------------------------------------
  488.  
  489. VII) Problems
  490. -------------
  491.  
  492. 1. What does it mean if i get a runtime error: "compare undefined" or
  493.    "Hash undefined"?
  494.  
  495. If you use a class as type parameter than several parameterized types
  496. require a linearly ordered subtype
  497. (i.e. dictionary, sorted sequence, priority queue)
  498. or a hashed type (i.e. dictionary with hashing implementation, hashing
  499. arrays). These functions are predefined for simple data types (char,
  500. short, int, long, float, double, string, point) and pointer types.
  501. For all other types
  502. in case that compare is called, a function template compare (hash) is
  503. instantiated that stops the program with the error message above,
  504. telling you that you have to define a function
  505.  
  506.             int compare(const T&, const T&)
  507.  
  508. resp.
  509.  
  510.             int Hash(const T&)
  511.  
  512. for the parameter type T.
  513.  
  514. 2. Why does the compiler instantiate the predefined function template
  515.    compare (Hash) although i have defined my own.
  516.  
  517. With high probability you're using g++ 2.6.3. This version cannot
  518. handle specialications of function templates correctly. It usually
  519. helps to declare the compare (hash) function inline.
  520.  
  521. 3. Why do i get the runtime error "compare undefined" when calling
  522.    the list::search function.
  523.  
  524. The search function for lists
  525. is realized using of the compare function if the parameter type
  526. (which has to be defined
  527. for list parameters since the list::sort() function is available).
  528.  
  529. 4. What does it mean if the compiler complains about the functions
  530.    Clear, Convert and Copy?
  531.  
  532. These functions are necessary when using a data type as parameter
  533. of some class type.
  534. Maybe you're using g++ versions older than 2.5.8. For later compiler
  535. versions the functions mentioned above are generated automatically.
  536. If not, you should call a macro
  537.  
  538.               LEDA_TYPE_PARAMETER(typename)
  539.  
  540. immediately after the definition of class typename. We suggest of course
  541. to upgrade the compiler version.
  542.  
  543. 5. Why does the g++ 2.7.0 compiler complain about undefined integer
  544.    variables in old programs that did work with the previous
  545.    compiler version (or when compiling an old LEDA version)?
  546.  
  547. The scope of a variable defined in a for statement
  548.  
  549. for (int i = 0; i < 10; i++);
  550.  
  551. from now on is restricted to the loop body. g++ 2.7.0 follows that
  552. rule.
  553.  
  554. -----------------------------------------------------------------------
  555. -----------------------------------------------------------------------
  556.  
  557. VIII) General questions
  558. ---------------------
  559.  
  560. 1. What is the run time/space overhead compared to programs written in
  561.    C?
  562.  
  563. Dr. Ulrich Lauther from the Siemens AG made a couple of experiemts and
  564. compared LEDA graph algorithms with his own hand-coded and well-tuned
  565. C-programs. The running time of LEDA programs are typically slower by a
  566. factor between 2 and 5. The space requirement of the LEDA graph data s
  567. structures is larger by a factor of about 2.
  568.  
  569. 2. Which user projects are using LEDA?
  570.  
  571. See the World Wide Web pages (http://www.mpi-sb.mpg.de/LEDA/leda.html).
  572.  
  573.   ------------------------------------------------------------------------
  574.     Google Home - Advertise with Us - Add Google to Your Site - News and
  575.           Resources - Language Tools - Jobs, Press, Cool Stuff...
  576.  
  577.                                 ⌐2002 Google
  578.