Abstract
This paper deals with p-maxian problem on cycles with an upper bound on the distances of all facilities. We consider the case of and show that, in the worst case, the optimal solution contains at least one vertex of the underlying cycle, which helps to develop an efficient algorithm to solve the constrained 2-maxian problem. Based on this property, we develop a linear time algorithm for the constrained 2-maxian problem on a cycle. We also discuss the relations between the constrained and unconstrained 2-maxian problems on which the underlying graphs are cycles.
MSC:
90B10; 90B80; 90C27
1. Introduction
Facility location theory deals with the problems of planning new optimal facilities in a network of existing customers, playing an important role in operation research due to its theoretical and practical contributions. The median and center location problems are the two most important models in classical facility location theory. The aim of a median problem is to find one or several facilities to minimize the total weighted distance from customers to the facilities. Furthermore, the goal of the center problem is to locate new facilities such that the maximum weighted distance from customers to the facilities is minimized.
Since the median and center problems on general graphs are -hard, there is significant interest in cases where such a problem can be solved in polynomial time. Goldman [1] showed that the 1-median problem on trees can be solved in linear time. For the 2-median problem on trees, Gavish and Sridhar presented [2] an time algorithm. Tamir [3] studied the p-median problem on trees and showed that the problem can be solved in time. Burkard and Krarup [4] designed a linear time algorithm for the pos/neg-weighted 1-median problem on a cactus, and showed that the 2-median problem on cactus graphs can be solved in time. For the model of center problems, Handler [5] presented a linear time algorithm for the 1-center problem on trees. For the p-center problem on trees, Wang and Zhang [6] presented an time algorithm. Lan [7] showed that the 1-center problem on a cactus graph can be solved in linear time. For the weighted 2-center problem on cactus graphs, Moshe et al. [8] devised an time algorithm for the continuous version and showed that the discrete version is solvable in time.
In recent years, the obnoxious facility location problem has been studied extensively, where some facilities are to be placed as far away as possible from the customers. These models are applied when locating undesirable facilities, for example, garbage dumps, airports, and chemical plants, to mention a few. For a survey of obnoxious location problems, we refer to Krarup et al. [9] and Tamir [10]. If the aim is to maximize the total maximum weighted distances from all customers to p new facilities, the corresponding problem is the so-called p-maxian problem. The p-maxian problem was first considered by Burkard et al. [11], who showed that the problem could be solved in linear time. Kang and Cheng [12] presented a linear time algorithm for the p-maxian problem on block graphs, where each block graph is a super class of tree graphs. Furthermore, the p-maxian problem on interval graphs was solved in linear time by Cheng and Kang [13]. For the 2-maxian problem on cactus graphs, Kang et al. [14] devised a quadratic time algorithm, where any two cycles in the graph have at most one vertex in common.
In real-life situations, the maximum distances between new facilities are often limited within a given bound. For instance, surveillance cameras of a residential district must be located in such a way that they are close enough for full coverage and nucleic acid collecting sites are located close enough for convenience. Considering such a limitation, the aim of the p-maxian problem is to locate p facilities such that they are close enough for inter-connection or cooperation. Nguyen et al. [15] were the first to consider the p-maxian problem with a distance constraint, and they showed that the 2-maxian problem on trees is solvable in linear time. Motivated by this paper, we consider the p-maxian problem on cycles with bounds on the maximum distances between facilities. We organize the paper in the following sections. Section 2 defines the p-maxian problem with distance constraints and gives the important properties of the 2-maxian problem as well. In Section 3, we develop a linear time algorithm for the constrained 2-maxian problem on cycles. Section 4 presents a brief conclusion to this paper.
2. Problem Definition and Properties
Let be a cycle of sequence of n distinct vertices supplemented by , such that is an edge of C, , where all vertices are numbered in a clockwise way. Each vertex has a non-negative weight and each edge has a non-negative length . The length of C is denoted by . A point x on C may either be a vertex or may lie on an edge of C; the set of all points of C is denoted by . For any two points of , the length of the shortest path from x to y is denoted by , and denotes the length of the path from x to y in a clockwise direction. It is easy to see that or holds for any two points of .
In a p-maxian problem on the cycle graph C, the aim is to find p points of , say , such that the following objective function is maximized:
where the point set that maximizes (1) is called the p-maxian of C.
In this paper, we assume that the maximum distance between facilities does not exceed a given bound . Then, the p-maxian problem on C with a distance constraint of (constrained p-maxian problem) can be formulated as the following optimization model:
where the set that fulfills (2) and (3) is called the constrained p-maxian of C.
For the case of , the corresponding constrained 2-maxian problem on a cycle C is to find two points , which maximizes the following equation:
with the distance constraint .
For an unconstrained 2-maxian problem on a modified cycle, the so-called vertex optimality property asserts that the problem has an optimal solution at the vertices [14]. However, this property does not apply in our problem. For example, for the graph in Figure 1, we find
where is a vertex, is not a vertex but is the inner point of the edge with , and is the unique solution to the constrained 2-maxian problem. In the following, we will give an important result for the constrained 2-maxian problem on a cycle C, which characterizes the point that may appear in an optimal solution of the problem.
Figure 1.
Vertex optimality does not hold any more.
Theorem 1.
There exists an optimal solution of the constrained 2-maxian problem on C, such that one of the following statements holds for and :
- and .
- and lies on the interior of an edge with the property of .
Proof.
Let be an optimal solution of the constrained 2-maxian problem on C. Suppose that is contradicting both statements 1 and 2. Obviously, there exists at least one interior point of some edge. Assume that is not a vertex and lies on the edge , and that lies on the edge or coincides with s. Moreover, we assume that and . For the point , we define the following sets:
For the point , we define the sets , and similarly. Note that all facilities of and are served by and , respectively, which is denoted by . Note that if is nonempty, then all vertices of could be served by as well as by . Without a loss of generality, we assume that and .
For the edge , we consider a function depending on t, where corresponds to vertex and corresponds to vertex . Moreover, the interior point x on the edge with corresponds to and x is written as . Then, the function f is defined by the following:
and we define . Note that is a linear function in the closed interval with the following slope:
Supposing that slope (4) is non-negative, we then move towards vertex and move towards vertex until coincides with by (and towards (and by . Thus, we obtain or and the following inequality:
which implies that there exists an optimal solution with at least one vertex. Without a loss of generality, we assume that is a constrained 2-maxian with as a vertex r.
Suppose that is a interior point of the edge and of . For the edge , we define a function depending on , similar to the definition of the function f. Let the function g be given by the following:
If we define , then is a linear function in the closed intervals and with slopes as follows:
and
respectively. If the value , we move toward the vertex s until coincides with . Then, we set and the following equation
can be concluded, where fulfills the statement 1. Otherwise, if the value , we move towards the vertex . Note that may either coincide with or may be an interior point , which lies on with . Either case fulfills statement 1 or statement 2. This completes the proof. □
By Theorem 1, we define by ex the point in C whose distance to is , and by op() the point in C that is opposite to , . Then, we add all points ex and op() with a weight of zero to C and update the edges that are incident to those new vertices to create a cycle. It is easy to see that there are vertices in the modified cycle. Moreover, if , the upper bound has no constraint on the facilities of the constrained 2-maxian problem; i.e., the constrained 2-maxian problem is equivalent to the corresponding unconstrained problem and, thus, can be solved in linear time [16].
3. A Linear Time Algorithm
Based on previous results, we develop a combinatorial algorithm that solves the constrained 2-maxian problem on a modified cycle . Let be the set of all points on the cycle C. In order to keep the notation simple, the cycle C is parameterized; i.e., the point that lies on the edge for some is identified with the real number t, which is given by . For any two points , denoted by , the set of all points is traversed by moving from a towards b in a clockwise direction. Let be an ordered 2-partition of V, such that and are disjoint and , and let be the set of all ordered 2-partitions of V. It is easy to see that, for any 2-partition and for any points , we have the following:
and thus the following
holds.
Using the observation above, the constrained 2-maxian problem on a cycle can be formulated in the following way:
where and are the vertex sets that are served by x and y, respectively.
Suppose that is the optimal solution to the constrained 2-maxian problem; then, the sets and can be constructed as follows:
and
Note that the sets and have the properties of and , if and only if . It is easy to see that is an optimal assignment of the vertices to and . Then, we define the set of all subsets of vertices that induce a path as follows:
where is the graph that is induced by W. It is easy to see that and that, if , is also in . Moreover, the set of all points of for a given set is denoted by . We define two functions and as follows:
and
Using the function f, the problem reduces to
Equation (8) implies the following algorithmic approach. We solve the problem and for all independently to obtain the optimal solution . If , then is the optimal solution to the constrained 2-maxian problem; otherwise, we consider and , and obtain one with a larger objective value as the optimal solution to the constrained 2-maxian problem. Next, we begin to consider the functions and .
Lemma 1.
For the given , the functions and are concave and piecewise linear.
Proof.
It is only proven that is concave because the concavity of can be obtained similarly. For simplicity, it is assumed that . Note that is piecewise linear and concave for . Since , is concave and piecewise linear. □
Note that a piecewise linear function f attains its maximum in a breakpoint i. Let the breakpoints of f be and the corresponding slopes in the interval be . Then, is the maximum point of f if and only if the product of the slopes in and is non-positive, i.e., .
It is easy to see that the set of breakpoints s of the function is given by the following equation:
Note that the slope of in can be computed as follows:
According to the discussion above, the breakpoints and the slopes can be computed in linear time. However, in order to compute and efficiently for all , an even better method can be introduced.
Note that if we have already solved for , then the solution for with has the following property, where denotes the symmetric difference of two sets.
Lemma 2.
Let and be two sets of . Suppose that for some and for some , then and .
Proof.
The length of the path induced by W is denoted by , i.e., . Note that and are defined on and , respectively. Both functions are piecewise linear in , and they have the same set of breakpoints . For the interval , the slopes of and can be computed as follows:
and
respectively.
Subtracting (9) from (10), we have . Using the fact that and that a breakpoint i is a maximum of if and only if , it follows that, if , then . For the function , we can use the same argument to obtain the statement. □
It is easy to apply the above result to any two sets and . Finally, we give Algorithm 1 to compute and for . Based on Lemma 2, we can easily compute in . This result guarantees that we only have to deal with the right-sided derivative in . The right-sided derivative in , with respect to , is denoted by .
Theorem 2.
Algorithm 1 computes and for in linear time.
| Algorithm 1: Algorithm for computing and for |
|
Input: A cycle with . Output: and for
|
In the preprocessing step (lines 1–3), the problem is solved, and the right-sided derivative in is obtained. In the for-loop, the problem is solved, where we assume that , and are already computed. Lines 5–12 consider two different cases: and . Lines 14–15 compute the values and for the problem on . Lines 16–20 judge whether is optimal; if it is not, will be updated until we obtain an optimal solution. Thus, Algorithm 1 is correct.
Note that the preprocessing step can be completed in linear time. Moreover, since the computation in each for-loop can be completed in constant time, the total computation can be completed in time. Therefore, Algorithm 1 runs in linear time. Once and for are obtained, we test . If it does not hold, could be replaced with or according to the statements in the previous section. Note that these computations can be completed in constant time. Summarizing, we accomplish the main result of this paper.
Theorem 3.
The constrained 2-maxian problem on a cycle can be solved in linear time.
4. Conclusions
This paper addressed the p-maxian problem on cycle graphs with constraints, where the distance between facilities is not greater than a given bound . We considered the case of and showed that any optimal solution contains at least one vertex of the cycle graph. Based on this property, we developed a combinatorial algorithm that solves the problem in linear time. It should be emphasized that the underlying graph of our model is a cycle, which is different from the graph of [15]. It is interesting to study whether there exist polynomial time algorithms for the case of on cycle graphs and the constrained p-maxian problem on cactus graphs, block graphs, etc.
Author Contributions
Conceptualization, C.B.; Writing of original draft, C.B.; Writing of review and editing, J.D. All authors have read and agreed to the published version of the manuscript.
Funding
This work was partially supported by the Natural Science Research Foundation of Colleges and Universities of Anhui Province (KJ2021A0968, KJ2021A0967, 2022AH051585).
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Goldman, A.J. Optimal center location in simple networks. Transp. Sci. 1971, 5, 539–560. [Google Scholar] [CrossRef]
- Gavish, B.; Sridhar, S. Computing the 2-median on tree networks in O(n log n) time. Networks 1995, 26, 305. [Google Scholar] [CrossRef]
- Tamir, A. An O(pn2) algorithm for the p-median and related problems on tree graphs. Oper. Res. Lett. 1996, 19, 59–64. [Google Scholar] [CrossRef]
- Burkard, R.E.; Krarup, J. A linear algorithm for the pos/neg-weighted 1-median problem on a cactus. Computing 1998, 60, 193–215. [Google Scholar] [CrossRef][Green Version]
- Handler, G.Y. Minimax location of a facility in an undirected tree networks. Transp. Sci. 1973, 7, 287–293. [Google Scholar] [CrossRef]
- Wang, H.T.; Zhang, J.R. An O(n log n)-time algorithm for k-center problem in trees. SIAM J. Comput. 2021, 50, 602–635. [Google Scholar] [CrossRef]
- Lan, Y.F.; Wang, Y.L.; Suzuki, H.A. A linear-time algorithm for solving the center problem on weighted cactus graphs. Inf. Process. Lett. 1999, 71, 205–212. [Google Scholar] [CrossRef]
- Ben-Moshe, B.; Bhattacharya, B.; Shi, Q.; Tamir, A. Efficient algorithms for center problems in cactus networks. Theor. Comput. Sci. 2007, 378, 237–252. [Google Scholar] [CrossRef]
- Krarup, J.; Pisinger, D.; Plastria, F. Discrete location problems with push-pull objectives. Discret. Appl. Math. 2002, 123, 363–378. [Google Scholar]
- Tamir, A. Obnoxious facility location on graphs. SIAM J. Discret. Math. 1991, 4, 550–567. [Google Scholar] [CrossRef]
- Burkard, R.E.; Fathali, J.; Kakhki, H.T. The p-maxian problem on a tree. Oper. Res. Lett. 2007, 35, 331–335. [Google Scholar] [CrossRef]
- Kang, L.Y.; Cheng, Y.K. The p-maxian problem on block graphs. J. Comb. Optim. 2010, 20, 131–141. [Google Scholar] [CrossRef]
- Cheng, Y.K.; Kang, L.Y. The p-maxian problem on interval graphs. Discret. Appl. Math. 2010, 158, 1986–1993. [Google Scholar] [CrossRef]
- Kang, L.Y.; Bai, C.S.; Shan, E.F.; Nguyen, T.K. The 2-maxian problem on cactus graphs. Discret. Optim. 2014, 13, 16–22. [Google Scholar] [CrossRef]
- Nguyen, T.K.; Hung, N.T.; Nguyen-Thu, H. A linear time algorithm for the p-maxian problem on trees with distance constraint. J. Comb. Optim. 2020, 40, 1030–1043. [Google Scholar] [CrossRef]
- Burkard, R.E.; Hatzl, J. Median problems with positive and negative weights on cycles and cacti. J. Comb. Optim. 2010, 20, 27–46. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).