1 Introduction
1.1 Background and Motivation
We consider minmax gather clustering problem and minmax gathering problem. In the minmax gather clustering problem, we are given a metric space and users located on . The goal of the problem is to find a partition of the users such that each cluster contains at least users, and the maximum diameter of the clusters is minimized^{1}^{1}1Several variations of gather clustering problem are known. At first appearance, it is the special case of gathering problem, where the set of locations of the users are the subset of the set of locations of the facilities [1]. In recent researches on the restricted metrics, the same definition as this paper is often used. If the metric is a subclass of the tree, that corresponds to the situation, where we can open facilities at any points on the metric. As the clustering problem, this is a more natural way to define the cost, since we do not need the set of facilities as an input. Thus we use this definition. [3, 7, 2]. In the minmax gathering problem, we are additionally given facilities on . The goal of the problem is to open a subset of facilities and assign each user to an opened facility so that all opened facilities have at least users and the maximum distance from users to the assigned facilities is minimized [5].
Both problems have plenty of practical applications. One typical application is a privacy protection [9]: Consider a company that publishes clustered data about their customers. If there is a too small cluster, one can easily identify the individuals in a such cluster. To guarantee the anonymity, we require the clusters to have at least individuals, which is obtained via gather clustering problem. Another example is the formation of sportteams. Suppose that we want to divide people into several teams for a football game. Then, each team must contain at least eleven people. Such grouping can be obtained via gather clustering problem.
Several tractability and intractability results are known for both problems. If is a general metric space, there is a approximation algorithm for gathering problem, and no algorithm can achieve a better approximation ratio unless P=NP [5]. If the set of locations of the users is a subset of that of the facilities^{2}^{2}2This version problem is originally called gather clustering problem [1]., there is a approximation algorithm [1], and no algorithm can achieve a better approximation ratio unless P=NP [5]. If is a line, there are polynomial time exact algorithms by dynamic programming for gathering problem [3, 6, 7, 4], where the fastest one runs in linear time [4]. This technique can also be applied to the gather clustering problem. If is a spider, which is a metric space constructed by joining halflineshaped metrics together at endpoints, these are polynomialtime algorithms if is a constant [2] (i.e., these are XP algorithms).
Thus far, the best tractability result is the XP algorithms on a spider, and the best intractability is NPhardness on a general metric space. The purpose of this study is to close this gap.
1.2 Our Contribution
In this study, we close the gap between the tractability and intractability of the problems on a spider. We first propose fixedparameter tractable algorithms for both gather clustering problem and gathering problem parameterized by . There is an algorithm to solve the gather clustering problem on a spider in time, where is the degree of the center of the spider. Similarly, there is an algorithm to solve the gathering problem on a spider in time. The proof is given in Section 3.
We then show that the problem is NPhard; this is our main theoretical contribution. The minmax gather clustering problem and minmax gathering problem are NPhard even if the input is a spider. The proof is given in Section 4. Note that, on a spider, gather clustering problem is the special case of gathering problem because we can reduce the former into latter by putting facilities for all midpoints of two users. Thus we only prove the NPhardness only for gather clustering problem.
2 Preliminaries
A spider is a set of halflines that share the endpoint (see Figure (a)). Each halfline is called a leg and is called the center. We denote by the point on leg whose distance from the center is . Note that is the center for all . The metric on is defined by if and if .
Let be a set of users on . A cluster is a subset of users and the diameter of a cluster is the distance between two farthest users in the cluster.
The minmax gather clustering on spider is a problem to find a partition of users into disjoint clusters so that each cluster contains at least users (Figure (b)). The goal is to minimize the maximum diameter of the clusters (Figure (c)). When the meaning is clear, we simply call it gather clustering problem. The minmax gathering on spider additionally specifies a set of facilities on . The goal of this problem is to open a subset of facilities and assign each user to an opened facility so that each cluster that corresponds to a facility contains at least users (Figure (d)). The goal is to minimize the maximum distance from users to the assigned facilities (Figure (e)). When the meaning is clear, we simply call it gathering.
\begin{picture}(20.0,20.0)(0.0,20.0)\special{pn 13}\special{pa 0 1000}% \special{pa 1000 1000}\special{fp}\special{pa 1000 0}\special{pa 1000 1000}% \special{fp}\special{pa 1000 1000}\special{pa 2000 400}\special{fp}\special{pa% 1000 1000}\special{pa 2000 1600}\special{fp}\special{pa 1000 1000}\special{pa% 1000 2000}\special{fp}\end{picture} (a) Spider \begin{picture}(20.0,20.0)(0.0,20.0)\special{pn 13}\special{pa 0 1000}% \special{pa 1000 1000}\special{fp}\special{pa 1000 0}\special{pa 1000 1000}% \special{fp}\special{pa 1000 1000}\special{pa 2000 400}\special{fp}\special{pa% 1000 1000}\special{pa 2000 1600}\special{fp}\special{pa 1000 1000}\special{pa% 1000 2000}\special{fp}\special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.28% 31853}\special{sh 1.000}\special{ia 240 1000 40 40 0.0000000 6.2831853}% \special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.2831853}\special{sh 1.000% }\special{ia 675 1000 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 675 % 1000 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 440 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853% }\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 % 440 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1950 1570 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1950 1570 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1810 1485 40 40 0.0000000 6.2831853}\special{% pn 8}\special{ar 1810 1485 40 40 0.0000000 6.2831853}\special{sh 1.000}% \special{ia 1610 1365 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1610% 1365 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 790 40 40 0% .0000000 6.2831853}\special{pn 8}\special{ar 1000 790 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1000 545 40 40 0.0000000 6.2831853}\special{pn% 8}\special{ar 1000 545 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{% ia 1585 645 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1585 645 40 40% 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1935 440 40 40 0.0000000 6.% 2831853}\special{pn 8}\special{ar 1935 440 40 40 0.0000000 6.2831853}\special{% sh 1.000}\special{ia 1390 1230 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1390 1230 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia % 1000 1455 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 1455 40 40 % 0.0000000 6.2831853}\special{sh 1.000}\special{ia 995 1615 40 40 0.0000000 6.2% 831853}\special{pn 8}\special{ar 995 1615 40 40 0.0000000 6.2831853}\end{picture} (b) An instance of gather clustering problem (Black points represents users) \begin{picture}(22.04,20.0)(0.0,20.0)\special{pn 13}\special{pa 0 1000}% \special{pa 1000 1000}\special{fp}\special{pa 1000 0}\special{pa 1000 1000}% \special{fp}\special{pa 1000 1000}\special{pa 2000 400}\special{fp}\special{pa% 1000 1000}\special{pa 2000 1600}\special{fp}\special{pa 1000 1000}\special{pa% 1000 2000}\special{fp}\special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.28% 31853}\special{sh 1.000}\special{ia 240 1000 40 40 0.0000000 6.2831853}% \special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.2831853}\special{sh 1.000% }\special{ia 675 1000 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 675 % 1000 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 440 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853% }\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 % 440 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1950 1570 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1950 1570 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1810 1485 40 40 0.0000000 6.2831853}\special{% pn 8}\special{ar 1810 1485 40 40 0.0000000 6.2831853}\special{sh 1.000}% \special{ia 1610 1365 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1610% 1365 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 790 40 40 0% .0000000 6.2831853}\special{pn 8}\special{ar 1000 790 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1000 545 40 40 0.0000000 6.2831853}\special{pn% 8}\special{ar 1000 545 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{% ia 1585 645 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1585 645 40 40% 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1935 440 40 40 0.0000000 6.% 2831853}\special{pn 8}\special{ar 1935 440 40 40 0.0000000 6.2831853}\special{% sh 1.000}\special{ia 1390 1230 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1390 1230 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia % 1000 1455 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 1455 40 40 % 0.0000000 6.2831853}\special{sh 1.000}\special{ia 995 1615 40 40 0.0000000 6.2% 831853}\special{pn 8}\special{ar 995 1615 40 40 0.0000000 6.2831853}\special{% pn 13}\special{pa 1800 1700}\special{pa 1759 1691}\special{pa 1719 1683}% \special{pa 1680 1674}\special{pa 1641 1664}\special{pa 1605 1654}\special{pa % 1570 1643}\special{pa 1537 1630}\special{pa 1506 1617}\special{pa 1479 1602}% \special{pa 1455 1585}\special{pa 1435 1567}\special{pa 1419 1547}\special{pa % 1407 1524}\special{pa 1400 1499}\special{pa 1398 1472}\special{pa 1401 1443}% \special{pa 1408 1413}\special{pa 1420 1382}\special{pa 1435 1351}\special{pa % 1454 1321}\special{pa 1477 1293}\special{pa 1502 1266}\special{pa 1530 1242}% \special{pa 1560 1221}\special{pa 1592 1204}\special{pa 1626 1191}\special{pa % 1661 1183}\special{pa 1697 1179}\special{pa 1734 1179}\special{pa 1771 1183}% \special{pa 1807 1190}\special{pa 1843 1201}\special{pa 1879 1215}\special{pa % 1913 1232}\special{pa 1945 1252}\special{pa 1975 1275}\special{pa 2003 1299}% \special{pa 2028 1326}\special{pa 2050 1355}\special{pa 2069 1385}\special{pa % 2083 1417}\special{pa 2093 1450}\special{pa 2099 1484}\special{pa 2100 1519}% \special{pa 2095 1554}\special{pa 2086 1588}\special{pa 2073 1620}\special{pa % 2056 1648}\special{pa 2036 1673}\special{pa 2012 1693}\special{pa 1985 1707}% \special{pa 1956 1714}\special{pa 1925 1717}\special{pa 1893 1715}\special{pa % 1859 1711}\special{pa 1824 1705}\special{pa 1800 1700}\special{fp}\special{pn % 13}\special{pa 2100 600}\special{pa 2074 610}\special{pa 2048 621}\special{pa % 2022 631}\special{pa 1995 642}\special{pa 1969 652}\special{pa 1942 663}% \special{pa 1916 674}\special{pa 1889 684}\special{pa 1861 695}\special{pa 183% 4 706}\special{pa 1806 717}\special{pa 1778 727}\special{pa 1720 749}\special{% pa 1691 761}\special{pa 1661 772}\special{pa 1630 783}\special{pa 1599 795}% \special{pa 1567 806}\special{pa 1535 818}\special{pa 1502 830}\special{pa 143% 4 854}\special{pa 1399 866}\special{pa 1363 879}\special{pa 1326 891}\special{% pa 1289 904}\special{pa 1250 917}\special{pa 1212 929}\special{pa 1173 940}% \special{pa 1135 950}\special{pa 1098 957}\special{pa 1063 962}\special{pa 102% 9 963}\special{pa 997 961}\special{pa 969 955}\special{pa 943 944}\special{pa % 921 927}\special{pa 903 905}\special{pa 889 877}\special{pa 880 844}\special{% pa 876 808}\special{pa 877 773}\special{pa 883 740}\special{pa 893 711}% \special{pa 909 689}\special{pa 931 674}\special{pa 956 666}\special{pa 985 66% 2}\special{pa 1017 663}\special{pa 1051 667}\special{pa 1087 674}\special{pa 1% 124 681}\special{pa 1162 689}\special{pa 1199 695}\special{pa 1235 700}% \special{pa 1269 702}\special{pa 1302 700}\special{pa 1331 693}\special{pa 135% 8 682}\special{pa 1383 666}\special{pa 1406 648}\special{pa 1428 626}\special{% pa 1449 602}\special{pa 1469 576}\special{pa 1488 548}\special{pa 1508 520}% \special{pa 1528 491}\special{pa 1549 462}\special{pa 1571 433}\special{pa 159% 5 406}\special{pa 1620 379}\special{pa 1648 355}\special{pa 1676 333}\special{% pa 1707 312}\special{pa 1738 294}\special{pa 1770 279}\special{pa 1803 266}% \special{pa 1837 255}\special{pa 1871 248}\special{pa 1904 244}\special{pa 193% 8 244}\special{pa 1971 246}\special{pa 2004 253}\special{pa 2036 264}\special{% pa 2066 278}\special{pa 2096 297}\special{pa 2124 320}\special{pa 2149 347}% \special{pa 2171 376}\special{pa 2188 407}\special{pa 2200 438}\special{pa 220% 5 468}\special{pa 2201 496}\special{pa 2189 522}\special{pa 2169 546}\special{% pa 2144 568}\special{pa 2116 589}\special{pa 2100 600}\special{fp}\special{pn % 13}\special{pa 1100 600}\special{pa 1067 594}\special{pa 1033 589}\special{pa % 1001 586}\special{pa 968 585}\special{pa 937 589}\special{pa 907 597}\special{% pa 879 611}\special{pa 852 630}\special{pa 829 654}\special{pa 810 681}% \special{pa 796 710}\special{pa 787 741}\special{pa 783 774}\special{pa 783 80% 8}\special{pa 785 842}\special{pa 789 877}\special{pa 801 945}\special{pa 806 % 979}\special{pa 809 1011}\special{pa 810 1041}\special{pa 808 1070}\special{pa% 802 1096}\special{pa 790 1119}\special{pa 774 1140}\special{pa 754 1158}% \special{pa 730 1173}\special{pa 702 1186}\special{pa 671 1196}\special{pa 638% 1203}\special{pa 602 1208}\special{pa 565 1210}\special{pa 527 1210}\special{% pa 488 1207}\special{pa 448 1202}\special{pa 408 1194}\special{pa 369 1184}% \special{pa 331 1172}\special{pa 295 1157}\special{pa 260 1139}\special{pa 227% 1120}\special{pa 198 1098}\special{pa 171 1074}\special{pa 147 1048}\special{% pa 127 1020}\special{pa 109 991}\special{pa 94 960}\special{pa 82 928}\special% {pa 73 896}\special{pa 66 862}\special{pa 62 828}\special{pa 61 794}\special{% pa 62 760}\special{pa 65 726}\special{pa 71 692}\special{pa 79 659}\special{pa% 90 627}\special{pa 102 596}\special{pa 116 566}\special{pa 133 537}\special{% pa 151 510}\special{pa 171 483}\special{pa 193 458}\special{pa 217 435}% \special{pa 242 413}\special{pa 268 392}\special{pa 296 372}\special{pa 325 35% 3}\special{pa 355 336}\special{pa 386 321}\special{pa 418 306}\special{pa 451 % 293}\special{pa 485 281}\special{pa 520 271}\special{pa 555 262}\special{pa 59% 0 254}\special{pa 626 248}\special{pa 662 243}\special{pa 698 239}\special{pa % 735 237}\special{pa 771 236}\special{pa 808 237}\special{pa 844 239}\special{% pa 880 243}\special{pa 916 248}\special{pa 951 254}\special{pa 985 262}% \special{pa 1019 271}\special{pa 1052 282}\special{pa 1085 294}\special{pa 111% 6 307}\special{pa 1147 322}\special{pa 1175 339}\special{pa 1202 358}\special{% pa 1227 379}\special{pa 1249 403}\special{pa 1268 429}\special{pa 1284 458}% \special{pa 1297 489}\special{pa 1305 524}\special{pa 1308 559}\special{pa 130% 4 589}\special{pa 1292 611}\special{pa 1271 623}\special{pa 1242 627}\special{% pa 1208 625}\special{pa 1170 618}\special{pa 1129 608}\special{pa 1100 600}% \special{fp}\special{pn 13}\special{pa 1500 1200}\special{pa 1478 1220}% \special{pa 1456 1239}\special{pa 1412 1281}\special{pa 1367 1326}\special{pa % 1344 1350}\special{pa 1320 1377}\special{pa 1296 1405}\special{pa 1271 1435}% \special{pa 1246 1466}\special{pa 1221 1499}\special{pa 1195 1532}\special{pa % 1170 1566}\special{pa 1144 1599}\special{pa 1119 1631}\special{pa 1094 1662}% \special{pa 1069 1691}\special{pa 1045 1718}\special{pa 1022 1742}\special{pa % 1000 1763}\special{pa 979 1781}\special{pa 959 1794}\special{pa 940 1802}% \special{pa 923 1806}\special{pa 907 1803}\special{pa 893 1795}\special{pa 881% 1781}\special{pa 871 1762}\special{pa 862 1737}\special{pa 855 1709}\special{% pa 850 1677}\special{pa 846 1642}\special{pa 845 1605}\special{pa 845 1567}% \special{pa 847 1527}\special{pa 851 1487}\special{pa 857 1447}\special{pa 864% 1409}\special{pa 874 1372}\special{pa 885 1337}\special{pa 898 1304}\special{% pa 913 1275}\special{pa 930 1250}\special{pa 949 1227}\special{pa 969 1207}% \special{pa 992 1190}\special{pa 1017 1175}\special{pa 1044 1161}\special{pa 1% 073 1150}\special{pa 1104 1140}\special{pa 1138 1131}\special{pa 1174 1123}% \special{pa 1212 1115}\special{pa 1252 1108}\special{pa 1295 1101}\special{pa % 1340 1094}\special{pa 1386 1087}\special{pa 1431 1081}\special{pa 1474 1076}% \special{pa 1514 1073}\special{pa 1548 1073}\special{pa 1574 1076}\special{pa % 1593 1082}\special{pa 1600 1093}\special{pa 1596 1108}\special{pa 1581 1128}% \special{pa 1558 1151}\special{pa 1529 1176}\special{pa 1500 1200}\special{fp}\end{picture} (c) An example solution of gather clustering problem, where 
\begin{picture}(20.0,20.0)(0.0,20.0)\special{pn 13}\special{pa 0 1000}% \special{pa 1000 1000}\special{fp}\special{pa 1000 0}\special{pa 1000 1000}% \special{fp}\special{pa 1000 1000}\special{pa 2000 400}\special{fp}\special{pa% 1000 1000}\special{pa 2000 1600}\special{fp}\special{pa 1000 1000}\special{pa% 1000 2000}\special{fp}\special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.28% 31853}\special{sh 1.000}\special{ia 240 1000 40 40 0.0000000 6.2831853}% \special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.2831853}\special{sh 1.000% }\special{ia 675 1000 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 675 % 1000 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 440 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853% }\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 % 440 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1950 1570 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1950 1570 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1810 1485 40 40 0.0000000 6.2831853}\special{% pn 8}\special{ar 1810 1485 40 40 0.0000000 6.2831853}\special{sh 1.000}% \special{ia 1610 1365 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1610% 1365 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 790 40 40 0% .0000000 6.2831853}\special{pn 8}\special{ar 1000 790 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1000 545 40 40 0.0000000 6.2831853}\special{pn% 8}\special{ar 1000 545 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{% ia 1585 645 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1585 645 40 40% 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1935 440 40 40 0.0000000 6.% 2831853}\special{pn 8}\special{ar 1935 440 40 40 0.0000000 6.2831853}\special{% sh 1.000}\special{ia 1390 1230 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1390 1230 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia % 1000 1455 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 1455 40 40 % 0.0000000 6.2831853}\special{sh 1.000}\special{ia 995 1615 40 40 0.0000000 6.2% 831853}\special{pn 8}\special{ar 995 1615 40 40 0.0000000 6.2831853}\special{% sh 0}\special{ia 995 175 40 40 0.0000000 6.2831853}\special{pn 4}\special{ar 9% 95 175 40 40 0.0000000 6.2831853}\special{sh 0}\special{ia 1510 1305 40 40 0.0% 000000 6.2831853}\special{pn 4}\special{ar 1510 1305 40 40 0.0000000 6.2831853% }\special{sh 0}\special{ia 1500 705 40 40 0.0000000 6.2831853}\special{pn 4}% \special{ar 1500 705 40 40 0.0000000 6.2831853}\special{sh 0}\special{ia 1715 % 1430 40 40 0.0000000 6.2831853}\special{pn 4}\special{ar 1715 1430 40 40 0.000% 0000 6.2831853}\special{sh 0}\special{ia 350 995 40 40 0.0000000 6.2831853}% \special{pn 4}\special{ar 350 995 40 40 0.0000000 6.2831853}\end{picture} (d) An instance of gathering (black and white points represent users and facilities, respectively) \begin{picture}(20.8,20.0)(0.0,20.0)\special{pn 13}\special{pa 0 1000}% \special{pa 1000 1000}\special{fp}\special{pa 1000 0}\special{pa 1000 1000}% \special{fp}\special{pa 1000 1000}\special{pa 2000 400}\special{fp}\special{pa% 1000 1000}\special{pa 2000 1600}\special{fp}\special{pa 1000 1000}\special{pa% 1000 2000}\special{fp}\special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.28% 31853}\special{sh 1.000}\special{ia 240 1000 40 40 0.0000000 6.2831853}% \special{pn 8}\special{ar 240 1000 40 40 0.0000000 6.2831853}\special{sh 1.000% }\special{ia 675 1000 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 675 % 1000 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 440 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853% }\special{pn 8}\special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1000 440 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 % 440 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1950 1570 40 40 0.% 0000000 6.2831853}\special{pn 8}\special{ar 1950 1570 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1810 1485 40 40 0.0000000 6.2831853}\special{% pn 8}\special{ar 1810 1485 40 40 0.0000000 6.2831853}\special{sh 1.000}% \special{ia 1610 1365 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1610% 1365 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1000 790 40 40 0% .0000000 6.2831853}\special{pn 8}\special{ar 1000 790 40 40 0.0000000 6.283185% 3}\special{sh 1.000}\special{ia 1000 545 40 40 0.0000000 6.2831853}\special{pn% 8}\special{ar 1000 545 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{% ia 1585 645 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1585 645 40 40% 0.0000000 6.2831853}\special{sh 1.000}\special{ia 1935 440 40 40 0.0000000 6.% 2831853}\special{pn 8}\special{ar 1935 440 40 40 0.0000000 6.2831853}\special{% sh 1.000}\special{ia 1390 1230 40 40 0.0000000 6.2831853}\special{pn 8}% \special{ar 1390 1230 40 40 0.0000000 6.2831853}\special{sh 1.000}\special{ia % 1000 1455 40 40 0.0000000 6.2831853}\special{pn 8}\special{ar 1000 1455 40 40 % 0.0000000 6.2831853}\special{sh 1.000}\special{ia 995 1615 40 40 0.0000000 6.2% 831853}\special{pn 8}\special{ar 995 1615 40 40 0.0000000 6.2831853}\special{% sh 0}\special{ia 995 175 40 40 0.0000000 6.2831853}\special{pn 4}\special{ar 9% 95 175 40 40 0.0000000 6.2831853}\special{sh 0}\special{ia 1510 1305 40 40 0.0% 000000 6.2831853}\special{pn 20}\special{ar 1510 1305 40 40 0.0000000 6.283185% 3}\special{sh 0}\special{ia 1500 705 40 40 0.0000000 6.2831853}\special{pn 20}% \special{ar 1500 705 40 40 0.0000000 6.2831853}\special{sh 0}\special{ia 1715 % 1430 40 40 0.0000000 6.2831853}\special{pn 4}\special{ar 1715 1430 40 40 0.000% 0000 6.2831853}\special{sh 0}\special{ia 350 995 40 40 0.0000000 6.2831853}% \special{pn 20}\special{ar 350 995 40 40 0.0000000 6.2831853}\special{pn 13}% \special{pa 115 1095}\special{pa 118 1058}\special{pa 122 1021}\special{pa 128% 986}\special{pa 136 954}\special{pa 147 926}\special{pa 163 902}\special{pa 1% 83 883}\special{pa 208 870}\special{pa 238 863}\special{pa 271 862}\special{pa% 305 865}\special{pa 340 874}\special{pa 375 887}\special{pa 408 904}\special{% pa 439 925}\special{pa 465 950}\special{pa 486 978}\special{pa 504 1009}% \special{pa 517 1041}\special{pa 529 1075}\special{pa 538 1109}\special{pa 554% 1175}\special{pa 563 1205}\special{pa 574 1233}\special{pa 586 1258}\special{% pa 602 1278}\special{pa 622 1294}\special{pa 646 1304}\special{pa 673 1311}% \special{pa 704 1315}\special{pa 736 1316}\special{pa 771 1315}\special{pa 807% 1313}\special{pa 843 1310}\special{pa 880 1308}\special{pa 916 1307}\special{% pa 952 1308}\special{pa 986 1311}\special{pa 1018 1318}\special{pa 1047 1329}% \special{pa 1073 1344}\special{pa 1096 1364}\special{pa 1115 1390}\special{pa % 1131 1419}\special{pa 1142 1451}\special{pa 1151 1485}\special{pa 1156 1521}% \special{pa 1157 1557}\special{pa 1155 1593}\special{pa 1150 1628}\special{pa % 1141 1660}\special{pa 1130 1691}\special{pa 1115 1717}\special{pa 1097 1740}% \special{pa 1076 1760}\special{pa 1053 1776}\special{pa 1027 1790}\special{pa % 1000 1800}\special{pa 970 1807}\special{pa 938 1811}\special{pa 905 1813}% \special{pa 870 1812}\special{pa 834 1809}\special{pa 798 1803}\special{pa 760% 1794}\special{pa 721 1784}\special{pa 683 1771}\special{pa 644 1757}\special{% pa 605 1740}\special{pa 566 1722}\special{pa 527 1702}\special{pa 489 1681}% \special{pa 452 1658}\special{pa 416 1634}\special{pa 380 1608}\special{pa 347% 1582}\special{pa 314 1554}\special{pa 284 1525}\special{pa 255 1496}\special{% pa 228 1466}\special{pa 204 1435}\special{pa 182 1404}\special{pa 163 1373}% \special{pa 147 1341}\special{pa 134 1309}\special{pa 124 1277}\special{pa 118% 1245}\special{pa 114 1213}\special{pa 113 1181}\special{pa 113 1149}\special{% pa 114 1117}\special{pa 115 1095}\special{fp}\special{pn 13}\special{pa 920 87% 0}\special{pa 910 836}\special{pa 899 801}\special{pa 881 733}\special{pa 872 % 700}\special{pa 865 666}\special{pa 860 633}\special{pa 855 601}\special{pa 85% 3 569}\special{pa 852 538}\special{pa 853 507}\special{pa 857 478}\special{pa % 864 449}\special{pa 873 421}\special{pa 885 394}\special{pa 901 368}\special{% pa 919 343}\special{pa 940 319}\special{pa 964 297}\special{pa 990 275}% \special{pa 1018 255}\special{pa 1048 235}\special{pa 1080 217}\special{pa 111% 4 201}\special{pa 1150 185}\special{pa 1186 171}\special{pa 1224 158}\special{% pa 1263 147}\special{pa 1303 136}\special{pa 1343 128}\special{pa 1384 120}% \special{pa 1425 114}\special{pa 1466 110}\special{pa 1508 107}\special{pa 154% 9 106}\special{pa 1589 106}\special{pa 1630 107}\special{pa 1669 111}\special{% pa 1708 116}\special{pa 1745 122}\special{pa 1781 130}\special{pa 1816 140}% \special{pa 1849 152}\special{pa 1881 165}\special{pa 1910 180}\special{pa 193% 8 197}\special{pa 1963 216}\special{pa 1986 237}\special{pa 2006 259}\special{% pa 2023 284}\special{pa 2037 310}\special{pa 2049 338}\special{pa 2057 368}% \special{pa 2062 399}\special{pa 2065 431}\special{pa 2064 464}\special{pa 206% 1 498}\special{pa 2055 531}\special{pa 2047 565}\special{pa 2036 598}\special{% pa 2022 631}\special{pa 2007 663}\special{pa 1989 693}\special{pa 1968 723}% \special{pa 1946 752}\special{pa 1922 780}\special{pa 1896 806}\special{pa 186% 9 832}\special{pa 1840 856}\special{pa 1810 880}\special{pa 1746 922}\special{% pa 1712 941}\special{pa 1678 959}\special{pa 1643 976}\special{pa 1607 991}% \special{pa 1571 1004}\special{pa 1534 1016}\special{pa 1497 1026}\special{pa % 1460 1035}\special{pa 1423 1042}\special{pa 1386 1047}\special{pa 1350 1050}% \special{pa 1314 1052}\special{pa 1278 1052}\special{pa 1243 1050}\special{pa % 1209 1046}\special{pa 1176 1040}\special{pa 1143 1032}\special{pa 1112 1021}% \special{pa 1082 1009}\special{pa 1054 995}\special{pa 1027 978}\special{pa 10% 02 959}\special{pa 978 938}\special{pa 957 915}\special{pa 936 890}\special{pa% 920 870}\special{fp}\special{pn 13}\special{pa 600 1100}\special{pa 578 1064}% \special{pa 556 1029}\special{pa 537 996}\special{pa 521 965}\special{pa 509 9% 38}\special{pa 501 916}\special{pa 500 900}\special{pa 506 890}\special{pa 517% 885}\special{pa 535 886}\special{pa 558 891}\special{pa 585 901}\special{pa 6% 15 913}\special{pa 649 929}\special{pa 686 946}\special{pa 724 965}\special{pa% 844 1022}\special{pa 883 1040}\special{pa 921 1055}\special{pa 957 1069}% \special{pa 991 1080}\special{pa 1024 1089}\special{pa 1056 1096}\special{pa 1% 087 1102}\special{pa 1117 1106}\special{pa 1146 1110}\special{pa 1206 1114}% \special{pa 1236 1115}\special{pa 1267 1117}\special{pa 1299 1118}\special{pa % 1332 1120}\special{pa 1366 1122}\special{pa 1402 1125}\special{pa 1438 1129}% \special{pa 1476 1133}\special{pa 1514 1138}\special{pa 1553 1144}\special{pa % 1591 1151}\special{pa 1630 1158}\special{pa 1669 1167}\special{pa 1707 1176}% \special{pa 1744 1187}\special{pa 1780 1198}\special{pa 1816 1211}\special{pa % 1850 1224}\special{pa 1882 1239}\special{pa 1913 1255}\special{pa 1942 1273}% \special{pa 1969 1291}\special{pa 1993 1311}\special{pa 2015 1333}\special{pa % 2034 1356}\special{pa 2050 1380}\special{pa 2063 1406}\special{pa 2072 1433}% \special{pa 2078 1462}\special{pa 2080 1493}\special{pa 2078 1525}\special{pa % 2072 1558}\special{pa 2063 1591}\special{pa 2052 1623}\special{pa 2038 1651}% \special{pa 2022 1677}\special{pa 2006 1697}\special{pa 1988 1713}\special{pa % 1970 1724}\special{pa 1950 1730}\special{pa 1930 1733}\special{pa 1909 1732}% \special{pa 1887 1728}\special{pa 1864 1720}\special{pa 1840 1709}\special{pa % 1815 1695}\special{pa 1790 1679}\special{pa 1764 1661}\special{pa 1737 1640}% \special{pa 1709 1618}\special{pa 1681 1594}\special{pa 1652 1569}\special{pa % 1623 1543}\special{pa 1593 1516}\special{pa 1562 1489}\special{pa 1531 1461}% \special{pa 1499 1434}\special{pa 1467 1406}\special{pa 1435 1380}\special{pa % 1402 1354}\special{pa 1368 1329}\special{pa 1335 1305}\special{pa 1301 1283}% \special{pa 1266 1262}\special{pa 1231 1244}\special{pa 1196 1227}\special{pa % 1161 1214}\special{pa 1126 1203}\special{pa 1090 1195}\special{pa 1054 1191}% \special{pa 1018 1190}\special{pa 982 1191}\special{pa 947 1195}\special{pa 91% 1 1201}\special{pa 877 1206}\special{pa 843 1212}\special{pa 810 1216}\special% {pa 779 1218}\special{pa 749 1216}\special{pa 721 1211}\special{pa 695 1202}% \special{pa 671 1187}\special{pa 649 1166}\special{pa 629 1141}\special{pa 609% 1114}\special{pa 600 1100}\special{fp}\end{picture} (e) An example solution of gathering, where (Bold borders represent Opened facilities) 
3 FPT Algorithm for Gather Clustering and Gathering on Spider
We give an FPT algorithm to solve minmax gather clustering problem and gathering problem on spider parametrized by the number of legs . First, we exploit the structure of optimal solutions. After that, we give a bruteforce algorithm. Finally, we accelerate it by dynamic programming.
We denote the coordinate of user by . Without loss of generality, we assume that . We refer this order to explain a set of users: for example, “the first/last users on leg ” means the users with smallest/largest index among all users on leg . Users on the center are located on every leg, but we choose an arbitrary leg and consider that all the users are located on this leg. Thus every user is considered to be located on exactly one leg.
We introduce a basic lemma about the structure of a solution. A cluster is singleleg if it contains users from a single leg; otherwise, it is multileg. Ahmed et al. [2] showed that there is an optimal solution that has a specific singleleg/multileg structure as follows.
[[2, Lemma 2]] For both gather clustering problem and gathering problem, there is an optimal solution such that, for all leg , first some users on are contained in multileg clusters and rest of them are contained in singleleg clusters.
For a while, we concentrate on the structure of multileg clusters. Let be a multileg cluster. Let be the last user in and be the last user with in . A ball part of is the set of users whose indices are at most and a segment part of is the set of the remaining users. is special if contains all the users on and the ball part is for some integer . The list of multileg clusters are suffixspecial if for all , is a special when we only consider the users in .
The following lemma is the key to our algorithm. Since it is a reformulation of Lemma 3 and Lemma 8 in Ahmed et al. [2] using Lemma 2 in Nakano [7], we omit the proof.
[Reformulation of [2, Lemmas 3 and 8] by [7, Lemma 2]] Suppose that there exists an optimal solution without any singleleg cluster. Then there is an optimal solution such that all the clusters contain at most users, and there exists a special cluster.
By definition, the segment part of a cluster is nonempty and contains the users from a single leg. By removing a special cluster and applying the lemma repeatedly, we can state that there is an optimal solution consists of a suffixspecial family of multileg clusters.
We first present a bruteforce algorithm that enumerates all the suffixspecial families of multileg clusters in Algorithm 1. The correctness is clear from the definition. Once all such families of clusters are enumerated, the remaining thing is to deal with singleleg clusters. It can be done by solving the linecase problem on the remaining users, independently for each leg, which can be solved by precalculated dynamic programming.
Then, we accelerate Algorithm 1 by dynamic programming. Similar to Algorithm 1, we make a special cluster of remaining users one by one, by looking through the users and decide whether to use them into the current cluster. In Algorithm 1, all information we should remember to construct the current cluster is , , and . We claim that, for the dynamic programming, we only need to remember (1) the size of in order not to make a toosmall cluster and (2) the index of the last user in the ball part of in order to calculate the diameter/cost of the cluster. Assume that we know the last user in the ball part of and last user in the segment part of . Then, the diameter/cost of is spanned by and ; Then, we can compute the diameter/cost of the cluster. Here we denote the diameter/cost of the multileg cluster by for both of the problems.
We should also deal with singleleg clusters. For singleleg clusters, we can apply the results for line case, which are well studied. For all leg and for all integers from to the number of users on leg , we first compute the optimal objective value, only considering the last users on leg . For each user , we denote the optimal objective value for the set of users on leg whose indices are greater than and no less than by and , respectively. All these values can be computed in linear time for both gather clustering problem and gathering problem, by using the technique in the latest method [4].
The algorithm is shown in Algorithm 2. The correctness is clear from the construction. Thus, we analyze the time complexity. A naive implementation of the algorithm requires evaluations of and a preprocessing for and . Each evaluation of requires time for gather clustering problem and time for gathering problem. The preprocessing requires time for gather clustering problem and time for gathering problem [4]. Thus the time complexities are for gather clustering problem and for gathering problem.
We can further improve the complexity. The loop for is reduced to see only first users from each leg since other users cannot be contained in the ball part of multileg clusters. Thus we can replace to in the complexity so as we obtain the complexities for gather clustering problem and for gathering problem. In gather clustering problem, this is a lineartime algorithm when are sufficiently smaller than .
In gathering problem, we can further improve the complexity by improving the algorithm to calculate (see Appendix A). When are sufficiently smaller than , this is also a lineartime algorithm. Therefore, Theorem 1.2 is proved.
4 NPhardness of minmax Gather Clustering on Spider
We prove the minmax gather clustering problem is NPhard even on a spider. We first propose arrears problem (Problem 1) as an intermediate problem. Then, we reduce the arrears problem to the minmax gather clustering problem on a spider. Finally, we prove the strong NPhardness of the arrears problem.
Problem 1 (Arrears Problem).
We are given sets of pairs of integers, i.e., for all . We are also given pairs of integers . The task is to decide whether there is integers such that
holds for for all .
The name of the “arrears problem” comes from the following interpretation. Imagine a person who is in arrears in his payment duties . Each payment duty has multiple options such that he can choose a payment amount of dollar with the payment date for some . Each pair corresponds to his budget constraint such that he can pay at most dollar until th day.
The arrears problem itself may be an interesting problem, but here we use this problem just for a milestone to prove the hardness of minmax gather clustering problem on a spider. The proof follows the following two propositions.
Proposition 1 (Reduction from the arrears problem).
If the arrears problem is strongly NPhard, the minmax gather clustering problem on a spider is NPhard.
Proposition 2 (Hardness of the arrears problem).
The arrears problem is strongly NPhard.
Without loss of generality, we assume that and . Also, we assume that and for all .
4.1 Reduction from Arrears Problem
We first prove Proposition 1. In this subsection, let be the number of payment duties and be the number of budget constraints.
Let be an instance of the arrears problem. We define and . We construct an instance of the decision version of the gather clustering problem on a spider that requires to decide whether there is a way to divide vertices into clusters all of which has size at least and diameter at most .
In construction, we distinguish two types of legs — long and short. Each long leg corresponds to a payment duty and each short leg corresponds to a budget constraint.
For each payment duty , we define a long leg . We first put users on . Then, we put users on for all . Finally, we put users on .
A short leg has only one user. The distance from the center to the user is referred to as the length of the short leg. For each , we define short legs of length , where we set . We also define short legs of length .
This construction can be done in pseudopolynomial time. Now we prove that has a feasible solution if and only if is a yesinstance of the arrears problem. We start by looking some basic structures of clusters in a feasible solution of .
In a feasible solution to , there is no cluster that contains users from two different long legs.
Proof.
By definition, the distance between the center and a user on a long leg is larger than . So, the distance between users from two different long legs exceeds ; hence, they cannot be in the same cluster. ∎
An end cluster of long leg is a cluster that contains the farthest user of . The above lemma implies that, in a feasible solution, end clusters of different long legs are different. Intuitively, the “border” of end cluster of long leg corresponds to the choice from the options of payment duty .
For each long leg , the following three statements hold. (a) An end cluster of only contains the users from . (b) There is exactly one end cluster of , and no other cluster consists of only users from leg . (c) Some users on are not contained in tend cluster.
Proof.
(a) The endpoint of is distant by more than from center. (b) There are less than users on so they cannot form more then one clusters alone. (c) Users on the point are distant from the endpoint of by more than , thus they cannot be in the same cluster. ∎
Lemma 4.1 and the third statement of Lemma 4.1 implies that users who are not contained in end clusters should form a cluster together with users from short legs. Now, we prove Proposition 1.
Proof of Proposition 1.
Suppose that we have a feasible solution to the instance of the minmax gathering problem on a spider that is constructed as the above. For each long leg , let be the last user that is not contained in end clusters, and be the cluster that contains . Then, the location of is represented as by using an integer . We choose payment date for payment duty . We prove that these choices of payment dates are a feasible solution to the arrears problem.
As described above, consists of users from leg and short legs. Since on leg there are only users on the path from the center to the location of , should contain at least users on short legs with length at most . For th budget constraint, by the rule of construction, there are users on short legs whose length is at most . Suppose . We use at least users on short legs whose lengths are at most in the cluster . Thus, the sum of among all with is at most the number of users on short legs whose length is at most , that is, . That means the budget constraint holds.
Conversely, suppose that we are given a feasible solution to the instance of the arrears problem. First, for each payment duty we make a cluster with all users located between and , inclusive. This cluster contains at least users since there are users on point and has diameter at most . We renumber the payment duties (thus so do long legs) in the nondecreasing order of and proceed them through the order of indices: For a payment duty , we make a cluster by all remaining users on leg and all users from remaining shortest short legs. By the construction, these clusters have exactly users. We show that the diameter of is at most . The diameter is spanned by a long leg and the longest short leg. The distance to the long leg in is . The longest short leg in is the th shortest short leg. We take the smallest such that . Then, since given solution is a feasible solution to , holds. Since there are users on short legs with length less than , the length of longest short leg in is at most . This gives the diameter of is at most . Finally, we make a cluster with all remaining users. Since there are short legs of length and all these users are located within the distance from the center, we can just put them into a cluster. Then we obtain a feasible solution to , which completes the proof. ∎
4.2 Strong NPHardness of Arrears Problem
Now we give a proof outline of Proposition 2; the full proof is given in Appendix B. We reduce the 1IN3SAT problem, which is known to be NPcomplete [8].
Problem 2 (1IN3 SAT problem [8]).
We are given a set of clauses, all of them contains exactly three literals. Decide whether there exists a truth assignment such that all clause has exactly one true literal.
Proof Outline of Proposition 2.
Let and be the number of boolean variables and clauses, respectively. For each variable , we prepare items for the positive literal and items for negative literal . Let be the set of all items. Each item corresponds to a payment duty having two options. Then, a solution to the arrears problem is specified by a set of items such that is chosen. We denote by the complement of . We want to construct a solution to the 1IN3SAT problem from a solution to the arrears problem by if for some ; otherwise . To make this construction valid, we define payment dates and payment amounts suitably as follows.
The payment days consist of two periods: the first period is and the second period is . For each item , belongs to the first period and belongs to the second period. Let and . Then, the payment amount is given in the form where is a sufficiently large integer, and is a nonnegative integer, where holds for all . We define for all .
Let . We make two budget constraints and . Then, these constraints hold in equality: Let be the total payment until . Then the total payment until is . These inequalities imply . (see Lemma B on Appendix B).
We use the first period to ensure that the truth assignment produced by is welldefined, i.e., if for some then for all . First, for each , we add a budget constraint . By comparing the coefficients of and , we have
We can prove that for all these inequalities hold in equality, i.e.,
(1) 
holds for all as follows. By using the relation between the coefficients of , we have (see Proposition 3 on Appendix B). Since the budget constraint is fulfilled in equality, and the coefficients of and in are both , this inequality holds in equality, which implies (1). Then, we define values appropriately so that the only or satisfy equation (1) (see Proposition 3 on Appendix B). This ensures the welldefinedness of the truth assignment.
The second period represents the clauses. Let be the set of items with . We put budget constraint for each , where are nonnegative integers determined later. Then, by a similar argument to the first period, we can prove that
for each (see Proposition 4 in Appendix B). This implies that for each . The budget constraint on day corresponds to the th clause. For , we set . Then, we have , i.e., exactly one literal in th clause is . The budget constraints on day and are used for the adjustment. Since forms a partition of items, we have . Moreover, since the constant term of is for all and , we have . By solving these equations, we obtain and . Since all value appears in is at most and we can take in a polynomial of . Thus, The hardness proof is completed. ∎
References
 [1] Gagan Aggarwal, Rina Panigrahy, Tomás Feder, Dilys Thomas, Krishnaram Kenthapadi, Samir Khuller, and An Zhu. Achieving anonymity via clustering. ACM Transactions on Algorithms, 6(3):49:1–49:19, 2010.
 [2] Shareef Ahmed, Shinichi Nakano, and Md Saidur Rahman. rgatherings on a star. In Proceedings of International Workshop on Algorithms and Computation, pages 31–42. Springer, 2019.
 [3] Toshihiro Akagi and Shinichi Nakano. On rgatherings on the line. In Proceedings of International Workshop on Frontiers in Algorithmics, pages 25–32. Springer, 2015.
 [4] Sarker Anik, Sung Wingkin, and Rahman Mohammad Sohel. A linear time algorithm for the rgathering problem on the line (extended abstract). In Proceedings of International Workshop on Algorithms and Computation, pages 56–66. Springer, 2019.
 [5] Amitai Armon. On min–max rgatherings. Theoretical Computer Science, 412(7):573–582, 2011.
 [6] Yijie Han and Shinichi Nakano. On rgatherings on the line. In Proceedings of International Conference on Foundations of Computer Science, pages 99–104, 2016.
 [7] Shinichi Nakano. A simple algorithm for rgatherings on the line. In Proceedings of International Workshop on Algorithms and Computation, pages 1–7. Springer, 2018.

[8]
Thomas J Schaefer.
The complexity of satisfiability problems.
In
Proceedings of the tenth annual ACM symposium on Theory of computing
, pages 216–226. ACM, 1978.  [9] Latanya Sweeney. kanonymity: A model for protecting privacy. International Journal of Uncertainty, Fuzziness and KnowledgeBased Systems, 10(05):557–570, 2002.
Appendix A Calculation of in gathering
In this section, we show how to calculate the in the gathering problem efficiently. The number of candidates of pair is at most , so we calculate the for all candidates in advance and store them. Now, we describe how to calculate these values. We assume that the facilities are given in increasing order of the distances from the center.
There are two cases of the location of the facility which will be assigned to the cluster – whether the facility is located on the leg or not. If it is not located on the leg , we should simply choose the facility which is nearest to the center. This case can be processed in constant time for each pair of .
For the facility located on , we should choose the facility which is nearest to the midpoint of the coordinates of and . We enumerate the midpoints for all pairs and sort them by distance from the center, for each leg. We can apply the twopointer technique to find the optimal facility by seeing the midpoints in sorted order. This case can be processed in time, where came from the sorting operation.
We can refer each precalculated value in time, so the total time complexity of Algorithm 2 is reduced to .
Appendix B Proof of NPHardness of Arrears Problem
In this section, we construct an instance of arrears problem from given instance of 1IN3SAT . In our construction, every payment duty has exactly two payment dates. Let us fix the variable . For all and , we prepare two items and . We also prepare auxiliary items and for each . In this way, We prepare items in total for each .
We name some important sets of items in following way:






.

We prepare a payment duty for all item .
Before defining the value of these values, we take an integer . All integers which appear as is represented in the form by nonnegative integers . Similarly, all integers which appear as is represented in the form by nonnegative integers
. We represent these values as if like a vector
and . In our construction is always equal to , so can be represented in the form .We take to be sufficiently large value (but still in a polynomial of ) so that for all , sum of over all item is still less than . That means that we can compare the sum of payment amount and budget constraint just by comparing sum of (or ) and by lexicographical order of fivedimensional vector. The concrete value of is .
Let us start to set the value of payment duties. Let us fix a variable . For , we set and
is always equal to . Remaining task is define the value . We set by following formula.
For each , let be and be . We set and
is also always equal to . Remaining task is define the value . We set by following formula.
Note that, since by definition,
holds for all . We call this value and set
We now remark that is sufficiently large. We can calculate each values just by expanding the definition formula. It can be calculated that, for all the sum of over all is at most . It is sufficiently small to avoid carry. Then, we set budget constraints. We set a budget constraints for each . Value of is
We represent .
Now we complete our construction. All appearing values are at most , which is bounded in a polynomial of . We prove that is a yesinstance of 1IN3SAT if and only if is a yesinstance of arrears problem.
For feasible solution of , Let be the set of items , such that payment date is chosen for payment duty . We define by complement of . Intuitively, for or , means is true and means is false. Following proposition guarantees that this type of truth assignment is welldefined.
Proposition 3.
In a feasible solution of , for all , one of the following condition holds.

.

.
Before proving this proposition, we prove the following basic property.
In a feasible solution of ,
Proof.
We only needs budget constraints for and to prove this lemma. Note that,
holds. From budget constraint for ,
holds. From budget constraint for ,
holds. It means equality holds for both of the inequality, and thus the lemma holds. ∎
Proof.
Let us start by rephrasing some budget constraints. First, we only concern about the coefficients of and . From budget constraint for ,
holds for all