Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
Fast and reliable Prolog implementations of several essential graph algorithms will be an indispensable basis for the entire lab.
This talk will start with an introduction of the basic graph theory concepts that we want to implement:
It will then discuss techniques to implement these concepts efficiently in Prolog focusing on the relation of connectivity to linear programming and the “Constraint Logic Programming for Finite Domains” library of SWI-Prolog.
Ideally, the you will have already turned the existing “max_flow” predicate of the clpfd library into a min_flow predicate. In that case this part of the talk will focus on the USE of the library and predicate, explaining only the very basics of CLPFD (not the entire implementation of min_flow).
If there is time, the presentation will also explain the USE of the available Prolog implementation of Tarski's linear-time algorithm for finding strongly connected components. Here it will focus in particular on the object-oriented structure of the implementation, as a template for how we want to write reusable / extensible Prolog code during the lab.
What remains to be done in the lab phase could be discussed in a concluding slide: Making suggestions for which (not just how many) edges to remove to break a cycle.
A good entry point to the graph theory basics is the wikipedia article on
The relation of the connectivity problem to linear programming is described in the article on the
An introduction to linear programming and the original simplex algorithm is given here:
An implementation of the Simplex algorithm (and others) in Prolog is provided as part of the “Constraint Logic Programming for Finite Domains” (CLPFD) library of SWI-Prolog (contribution of Markus Triska), which is contained in the file “/libraries/clp/clpfd.pl” of your SWI-Prolog installation. This file also contains, the predicate maximum_flow/2, which may be useful to you with small modifications to compute the min_flow value. Among all saturated arcs, you could then search for the cuts themselves. See also the implementation of maximum_matching/2. Markus Triska markus.triska@gmx.at (the author of the CLPD library) offered to help if you have any questions about the code.
The basics of using CLPFD are described in the SWI-Prolog manual:
The first complete version of the presentation will be presented to GK on Thursday, Sept 30, 2010 at 9:00.