Experiments

We have experimented fasp on the benchmark domains: Hamiltonian circuit, N-Queens and graph coloring under AMD server with 4xAMD Opteron 844 (1.8GHz) CPU, 8GB RAM running Fedroa Linux Core 3.0 (X86_64 Edition). and compared its performance with several state-of-art ASP systems, including smodels, cmodels using zChaff 2007.3.12 and clasp. The grounder for these ASP solvers is lparse 1.0.7.

Please note that, no grounding system is available for logic programs with functions that can ground logic programs with functions that are written with variables. (Such a general grounder is under consideration). Thus, we wrote special programs to produce the specific ground logic programs with functions for the above domains. These gadgets are available here as well. Many of the ground logic programs for fasp are also availabe.

In these experiments, we measured the CPU time in seconds of each run. The running times exclude grounding cost of lparse. The size of logic programs are the size of grounded logic programs. In particular, the size of logic programs for FASP(0.4) are encoded with normal logic programs with functions as given in our paper, while in the case of FASP(0.6) they are encoded using function domain statements. For Hamiltonian circuit domain, the encoding for FASP(0.6) is implemented with a special program hc-06.cpp.

In the following demonstrating tables, "--" indicates the run didn't return in two hours; "#" indicates the run happened java.lang.OutOfMemoryError that occurs only to our fasp; "%" indicates the run returned with unknown result. "LFs/Runs" indicates the number of loop formulas being added and the number of calls of CSP solvers respectively, it happens only for Hamiltonian circuit domain.

List of experiments:

1 Hamiltonian circuit

2 N-queens

3 Graph coloring

4 Hamiltonian circuit (for the being translated LPs)


Hamiltonian circuit

There are two encodings for Hamiltonian circuit for ASP systems. One is a normal logic program (Own to Niemela 1999) that is also available in the website of ASSAT. The other is in weight constraint which is available from BENCHMARK PROBLEMS FOR ANSWER SET PROGRAMMING SYSTEMS. We only run the ASP solvers for the former encoding instead of the latter. The version of being used fasp for these expreiments is 0.6 instead of 0.4. These randomly generated graphs are obtained from the website of Cmodels, while the complete graphs are obtained from the website of ASSAT.

Table 1: Hamiltonian circuit

Graph HC? smodels cmodels clasp FASP(X)(LFs/Runs) program size
abscon sat4j sugar lparse(n) lparse(w) FASP(0.4) FASP(0.6)
p20 y 0.040  <0.010 <0.010  34.02(3/4) --  14.17(5/6)  32K 9.7K 9.3K 6.0K
p25 y 0.044 0.200 0.020 18.30(2/3) -- 10.47(4/3) 44K 13K 14K  7.9K
p29 y 0.708 0.500 <0.010 11.99(2/3) -- 16.76(4/5) 53K 15K 18K  9.3K
p30 y 1.292 0.110 <0.010 1543.00(3/4) -- 12.24(2/3) 56K 16K 19K 9.7K
p100 y -- 1802.990 53.880 -- -- 887.2(10/5) 221K 57K 167K 35K
p300 ? -- -- -- -- # -- 763K 165K 1.5M 117K
p600 ? -- -- -- -- # # 1.6M 339K 5.9M 240K
p1000 ? -- -- -- -- # # 2.7M 571K 17M 404K
p3000 ? -- -- -- -- # # 8.6M 1.9M 158M 1.3M
p6000 ? -- -- -- -- # # 18M 3.8M 642M 2.7M

 

Table 2: Hamiltonian circuit with complete graphs

vertex

=?

smodels cmodels clasp FASP(X)(LFs/Runs) program size
abscon sat4j sugar lparse(n) lparse(w) FASP(0.4) FASP(0.6)
10 0.040  0.200  <0.01 -- -- 4.1364(1/2)  46K 7.2K 4.6K 5.0K
20 0.668 0.230 0.020 -- -- 10.3292(1/2) 428K 30K 20K 21K
30 5.536 1.130 0.120 -- -- 13.4976(1/2) 1.5M 68K 45K 48K
40 24.589 2.260 0.270 -- -- 17.2581(1/2) 3.7M 120K 80K 85K
100 4901.648 459.450 5.810 -- -- -- 60.0M 757K 503K 533K

 

N-queens

The logic program for N-Queens is obtained from the benchmark suite package of Cmodels.

Table 3: N-Queens

N

=?

smodels cmodels clasp FASP(X) program size
abscon sat4j sugar lparse FASP(0.4)
8 0.016 <0.01 <0.01 2.2722 3.0643 4.0965 21K 2.9K
15 0.216 0.180 0.020 3.2324 6.4167 8.7610 137K 11K
20 14.792 0.180 0.060 4.2245 10.4332 14.1777  329K 20K
25 2227.367 0.380 0.160 5.3366 16.1859 18.5702 649K 32K
50 -- 3.860 2.140 9.0090 144.6419 133.4165 5.2M 130K
100 -- 32.690 23.290 16.0819 # # 42.0M 528K
200 -- % 276.020 262.3127 # # 355M 2.2M
300 -- -- -- 465.8901 # # >1.0G 5.0M

 

Graph coloring

The logic program for graph-coloring is obtained from the benchmark suite package of Cmodels. While the randomly generated graphs are obtained from the website of ASSAT, where pmvn indicates the graph has m vertices and n edges.

  • with four colors

Table 4: Graph coloring with four colors

Graph colorable

?

smodels cmodels clasp FASP(X)(LFs/Runs) program size
abscon sat4j sugar lparse FASP(0.4)
p100e570 y 0.148 0.300 0.010 2.8883 6.6088 4.9845 101K 22K
p300e1760 y 1.012 0.150 0.050 6.2007 12.8255 7.7289 322K 71K
p600e3554 y 3.888 0.350 0.200 8.8971 20.6825 14.3936 655K 145K
p1000e5950 y 12.792 0.800 0.570 17.5381 29.8756 13.4575 1.1M 244K
p3000e13525 y 152.741 191.700 215.460 130.2962 # 86.7627 3.4M 789K
p6000e35946 y 693.495 1651.180 -- 1531.4232 # 546.9962 6.9M 1.6M
p10000e10000 y 876.474 3.270 81.590 85.8427 56.8471 19.3543 4.3M 551K
p10000e11000 y 914.969 3.660 78.330 100.8925 64.1679 30.9318 4.4M 592K
p10000e21000 n 6.952 1.950 1.820 18.4261 # 27.3713 5.8M 1007K
p10000e22000 y 1170.997 4.440 48.380 131.6482 # 30.2036 6.0M 1.1M

 

  • with three colors

Table 5: Graph coloring with three colors

Graph colorable

?

smodels cmodels clasp FASP(X)(LFs/Runs) program size
abscon sat4j sugar lparse FASP(0.4)
p100e570 n 0.080 0.200  <0.01 3.5844 6.9847 4.3685 78K 22K
p300e1760 n 0.328 0.120 0.050 6.2806 15.3138 8.1369 249K 71K
p600e3554 n 0.648 0.280 0.090 8.7050 20.8025 8.1289 506K 145K
p1000e5950 n 1.040 0.530 0.180 6.3257 30.0196 18.2661 849K 244K
p3000e13525 n 3.584 1.670 0.700 11.4414 # 16.2339 2.7M 789K
p6000e35946 n 6.972 3.550 1.600 23.1548 # 33.1880 5.3M 1.6M
p10000e10000 y 380.999 2.650 33.030 74.5373 57.9511 16.9781 3.5M 551K
p10000e11000 y 345.577 3.210 31.260 88.7149 60.7035 25.9871 3.6M 592K
p10000e21000 n 5.572 1.900 1.570 19.2262 # 30.9637 4.6M 1007K
p10000e22000 ? -- -- -- -- # -- 4.7M 1.1M

Hamiltonian circuit (for the being translated LPs)

Table 6: Hamiltonian circuit for being translated functions

Graph HC? smodels cmodels clasp
hc.lp thc.lp hc.lp thc.lp hc.lp thc.lp
p20 y 0.040 0.080  <0.010 0.300 <0.010 0.020
p25 y 0.044 4.232 0.200 4.530 0.020 0.020
p29 y 0.708 0.196 0.500 2.350 <0.010 0.040
p30 y 1.292 0.256 0.110 9.930 <0.010 0.130
p100 y -- -- 1802.990 -- 53.880 168.380
p300 ? -- -- -- -- -- --
p600 ? -- -- -- -- -- --
p1000 ? -- -- -- -- -- --
p3000 ? -- -- -- -- -- --
p6000 ? -- -- -- -- -- --

Table 7: Hamiltonian circuit for being translated functions with complete graph

vertex

=?

smodels cmodels clasp
hc.lp thc.lp hc.lp thc.lp hc.lp thc.lp
10 0.040 0.048  0.200 0.100  <0.01 0.020
20 0.668 -- 0.230 0.240 0.020 0.110
30 5.536 -- 1.130 1.130 0.120 3.650
40 24.589 -- 2.260 3.260 0.270 10.320
100 4901.648 -- 459.450 107.260 5.810 --

 


Yisong Wang
Last modified: Thursday June 15 2008