Constraint Logic Programming on Finite Domains (CLP(FD))

CLP(FD) program for the Optimal Placement of Valves in a Water Distribution Network

Marco Gavanelli and Massimiliano Cattafi

This software is the valve placement problem solver proposed in [1]. The software is implemented in ECLiPSe

The valve placement problem and the instance was proposed in [2].

In this web page you can download:

  • valve_placement.pl : the code of the solver
  • apulian.pl : the instance of the Apulian distribution network. Note that, in order to have integer weights, all weights were multiplied by 10 with respect to the instance shown in [2].

Note also that the solver computes twice the value of the objective function; the value comparable with [2] is that printed as actual_cost(X).

To run the program, load both files, then execute goal q(NV), where NV is the number of valves:

ECLiPSe Constraint Logic Programming System [kernel]
Kernel and basic libraries copyright Cisco Systems, Inc.
and subject to the Cisco-style Mozilla Public Licence 1.1
(see legal/cmpl.txt or http://eclipseclp.org/licence)
Source available at www.sourceforge.org/projects/eclipse-clp
GMP library copyright Free Software Foundation, see legal/lgpl.txt
For other libraries see their individual copyright notices
Version 6.0 #169 (x86_64_linux), Sat Mar  5 00:38 2011
[eclipse 1]: [valve_placement].

Yes (0.39s cpu)
[eclipse 2]: [apulian].
apulian.pl compiled 6432 bytes in 0.01 seconds

Yes (0.01s cpu)
[eclipse 3]: q(6).
lists.eco  loaded in 0.01 seconds
5642	0.0199999999999999
5114	0.0299999999999999
4958	0.0299999999999999
3668	0.0399999999999999
3512	0.0499999999999999
3254	0.0499999999999999
3098	0.07
2980	0.08
2824	0.21
actual_cost(141.2)
explored_nodes(55)

Yes (0.26s cpu, solution 1, maybe more) ? 
[eclipse 4]: 

We also provide the same code adapted for the input format of the ASP Competition 2013: vpasp.pl

To use this code, you can invoke, from the command-line:

eclipse -b vpasp -b inst -e aspcomp

where inst is the name of the file containing the instance.

References

1
Massimiliano Cattafi, Marco Gavanelli, Maddalena Nonato, Stefano Alvisi, and Marco Franchini. Optimal Placement of Valves in a Water Distribution Network with CLP(FD). Theory and Practice of Logic Programming, 11(4-5):731-747, 2011. Best paper award at the 27th International Conference on Logic Programming (ICLP 2011).
2
Orazio Giustolisi and Dragan A. Savic. Identification of segments and optimal isolation valve system design in water distribution networks. Urban Water Journal, 7(1):1-15, 2010.