IDEAS home Printed from https://ideas.repec.org/p/gro/rugsom/97a46.html
   My bibliography  Save this paper

An exercise in the structured design of complex algorithms in (extensions of) SQL

Author

Listed:
  • Brock, E.O. de

    (Groningen University)

Abstract

From time to time developers of (database) applications will encounter, explicitly or implicitly, structures such as trees, graphs, and networks. Such applications can for instance relate to bills of material, organisation charts, networks of (rail)roads, networks of conduit pipes, telecom -networks, and data dictionaries. Algorithms on such data structures often ask for recursion or iteration of which the number of repetitions is unknown beforehand. Such algorithms are usually programmed in a third generation language (3GL) and are therefore typically "record-at- a-time". Extensions of SQL with procedures and "control of flow" constructions such as if-then-else and while make it possible to solve such graph problems completely (and compactly) on 4GL-level. Actually, such SQL-extensions already exist for some time in several commercially available database management systems. In this paper we will work out the idea of graph algorithms on 4GL-level starting with the "standard" recursive graph problem of the computation of the set of all paths in a graph. It will also be shown that the computation of the paths themselves can easily be extended with the computation of additional path properties. Such algorithms operate essentially different from the algorithms on 3GL-level. One of the advantages of our approach is that it makes the development of ad hoc queries in such (recursive) application areas considerably easier (i.e., both simpler and faster), which in turn facilitates the development of the MIS-part of information systems in those application areas. Even on 4GL-level we are able to influence the efficiency of our graph algorithms. We will therefore present some improvements on our algorithms, all leading to successively better results. It turns out that our intuition regarding the correctness (and the termination) of these (subtle) "set-at-a-time" algorithms sometimes lags behind. Therefore we also pay special attention to the correctness and termination of the algorithms (using invariants). All programs turn out to be rather compact: they consist of only a few SQL-statements. This clearly contributes to the transparency of the structure of the algorithm and the maintainability of the software.

Suggested Citation

  • Brock, E.O. de, 1997. "An exercise in the structured design of complex algorithms in (extensions of) SQL," Research Report 97A46, University of Groningen, Research Institute SOM (Systems, Organisations and Management).
  • Handle: RePEc:gro:rugsom:97a46
    as

    Download full text from publisher

    File URL: http://irs.ub.rug.nl/ppn/163866880
    Download Restriction: no
    ---><---

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gro:rugsom:97a46. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Hanneke Tamling (email available below). General contact details of provider: https://edirc.repec.org/data/ferugnl.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.