Preprint
Article

This version is not peer-reviewed.

The 2-Maxian Problem on Block Graphs with Distance Constraint

Submitted:

28 June 2026

Posted:

30 June 2026

You are already at the latest version

Abstract
This paper investigates the constrained 2-maxian problem defined on block graphs, a special class of composite graphs containing trees and cacti as subclasses. The problem requires placing two facilities on a block graph such that the Euclidean/topological distance between the two facilities is bounded by a given upper limit, while maximizing the total weighted maximum distance from all client vertices to the nearest facility. We first analyze the structural properties of block graphs and the vertex optimality of the constrained 2-maxian solution, proving that at least one facility in any optimal solution must be located at a vertex of the block graph. Based on this key property, we design an efficient polynomial-time algorithm for the constrained 2-maxian problem on block graphs. We further discuss the differences and connections between constrained and unconstrained 2-maxian problems, and compare the proposed method with existing algorithms for trees, cycles and cactus graphs. Numerical analysis verifies the correctness and efficiency of the algorithm.
Keywords: 
;  ;  ;  ;  

1. Introduction

Facility location theory is a core branch of operations research and combinatorial optimization, widely applied in logistics planning, public service layout, and undesirable facility deployment. Classical location models mainly include median problems and center problems: the median model minimizes the total weighted distance from clients to facilities, while the center model minimizes the maximum weighted distance from clients to facilities. However, in practical scenarios such as the layout of garbage landfills, chemical plants and noisy equipment, decision-makers need to place facilities as far as possible from client nodes. This type of problem is collectively called the obnoxious facility location problem, among which the p-maxian problem is the most representative one.
The p-maxian problem aims to select p facilities in a graph to maximize the sum of weighted maximum distances from all vertices to the nearest facility. Early research on maxian problems focused on classic graph structures. Burkard et al. [2] first studied the p-maxian problem on trees and proposed a linear-time algorithm. Kang and Cheng [4] extended the research to block graphs and designed a linear-time algorithm for the unconstrained p-maxian problem on block graphs. Cheng and Kang [3] solved the p-maxian problem on interval graphs with linear complexity, and Kang et al. [5] proposed a quadratic-time algorithm for the 2-maxian problem on cactus graphs.
In real engineering applications, the placement of obnoxious facilities is often subject to distance constraints between facilities: for example, monitoring equipment and auxiliary facilities need to be kept within a certain distance for interconnection and collaborative work; scattered waste disposal points also require a limited spacing to facilitate centralized management. Nguyen et al. [6] pioneered the constrained p-maxian problem with facility distance constraints and gave a linear-time algorithm for the constrained 2-maxian problem on trees. Bai and Du [1] studied the constrained 2-maxian problem on cycles, proved the vertex-related optimality property of optimal solutions, and constructed a linear-time algorithm for cyclic graphs.
Block graphs are a superclass of trees and cactus graphs, where every biconnected component (block) is a clique. Due to its flexible structure, block graphs can describe more complex network systems than trees and cycles. Nevertheless, the constrained 2-maxian problem on block graphs has not been systematically studied so far. Motivated by the above research background, this paper takes block graphs as the research object, explores the theoretical properties and solving algorithms of the constrained 2-maxian problem, and fills the research gap of constrained maxian problems on block graphs.
The rest of this paper is organized as follows: Section 2 gives the basic definitions of block graphs, formalizes the constrained 2-maxian problem, and deduces fundamental structural properties. Section 3 proves the vertex optimality theorem for optimal solutions. Section 4 designs a polynomial-time algorithm and analyzes its time complexity. Section 5 discusses the correlation between constrained and unconstrained problems. Section 6 summarizes the full work and prospects future research directions.

2. Problem Definition and Basic Properties

2.1. Basic Concepts of Block Graphs

Let G = ( V , E ) be a connected undirected graph, where V is the vertex set and E is the edge set. A block (biconnected component) of G refers to a maximal subgraph without cut vertices. A graph G is defined as a block graph if every block of G is a complete graph (clique). Trees are special block graphs where each block is a two-vertex clique (single edge); cactus graphs are not block graphs in general, but block graphs share many structural characteristics with trees and cycles.
For any two points x, y on graph G, let d ( x , y ) denote the shortest path distance between x and y. Each vertex v i V is assigned a non-negative weight w i , representing the client demand or weight of the vertex. Let X ( G ) be the set of all points on G (including vertices and interior points on edges).

2.2. Definition of Constrained 2-Maxian Problem

For a block graph G = ( V , E ) with | V | = n , the unconstrained 2-maxian problem is to select two points X = { x 1 , x 2 } X ( G ) to maximize the objective function:
F ( X ) : = i = 1 n w i · max { d ( v i , x 1 ) , d ( v i , x 2 ) }
In practical scenarios, we add a distance constraint between the two facilities: given an upper bound U > 0 , require d ( x 1 , x 2 ) U . The constrained 2-maxian problem on block graphs is formulated as the following optimization model:
max F ( x 1 , x 2 ) = i = 1 n w i · max { d ( v i , x 1 ) , d ( v i , x 2 ) }
s . t . d ( x 1 , x 2 ) U , x 1 , x 2 X ( G )
A set of points { x 1 * , x 1 * } satisfying the constraints and maximizing the objective function is called an optimal solution of the constrained 2-maxian problem.

2.3. Auxiliary Set Division

For any feasible solution { x 1 , x 2 } , divide the vertex set V into three disjoint subsets:
V 1 = { v i V d ( v i , x 1 ) > d ( v i , x 2 ) } ,
V 2 = { v i V d ( v i , x 1 ) < d ( v i , x 2 ) } ,
and
V 3 = { v i V d ( v i , x 1 ) = d ( v i , x 2 ) } .
Vertices in V 1 take x 1 as the reference facility, vertices in V 2 take x 2 as the reference facility, and vertices in V 3 are equidistant to both facilities. The objective function can be rewritten as:
F ( x 1 , x 2 ) = v i V 1 w i d ( v i , x 1 ) + v i V 2 w i d ( v i , x 2 ) + v i V 3 w i d ( v i , x 1 ) .
This decomposition lays a foundation for subsequent property proof and algorithm design.

2.4. Optimality Property of Optimal Solutions

For the unconstrained 2-maxian problems on cactus graphs and block graphs, existing studies have proved that the optimal solution can be located entirely at vertices [4,5]. However, after adding the distance constraint d ( x 1 , x 2 ) U , this full vertex optimality no longer holds, which is similar to the conclusion on cycle graphs. We hereby prove the core property of the constrained 2-maxian problem on block graphs:
Theorem 1. 
For the constrained 2-maxian problem on a block graph G, there exists an optimal solution X * = { x 1 * , x 2 * } satisfying one of the following two cases:
1. Both x 1 * and x 2 * are vertices of G;
2. One of x 1 * and x 2 * is a vertex of G, and the other is an interior point on some edge of G, and satisfies d ( x 1 * , x 2 * ) = U .
Proof. 
Suppose X * = { x 1 , x 2 } is an arbitrary optimal feasible solution of the problem. We discuss two cases:
Case 1: Both x 1 and x 2 are interior points on edges of G. Assume x 1 lies on edge e a = ( u a , u a ) and x 2 lies on edge e b = ( u b , u b ) , with d ( x 1 , x 2 ) U . Construct a single-variable function by moving x 1 along edge e a and x 2 along edge e b :
f ( t ) = v i V 1 w i d ( v i , x 1 ( t ) ) + v i V 2 w i d ( v i , x 2 ( t ) )
+ v i V 3 w i max { d ( v i , x 1 ( t ) ) , d ( v i , x 2 ( t ) ) } ,
where t represents the moving offset of the two points on the edges. Since the distance function on a graph edge is piecewise linear, f ( t ) is a piecewise linear function on the interval of edge lengths. If the slope of f ( t ) is non-negative, move x 1 towards vertex u a and x 2 towards vertex u b until one of them reaches a vertex of the graph. The objective function value will not decrease, and we obtain a new feasible solution with at least one vertex point. If the slope is negative, move the two points in the opposite direction until one point coincides with a vertex. The objective function value is still non-decreasing.
Case 2: One point is a vertex, and the other is an interior point on an edge, with d ( x 1 , x 2 ) < U . Let x 1 = u (vertex), x 2 be an interior point on edge e = ( v , v ) . Since the distance constraint has remaining margin, we move x 2 along the edge to increase d ( u , x 2 ) until d ( u , x 2 ) = U . Combined with the piecewise linearity of the objective function, after moving, the objective function value is greater than or equal to the original value, and the new solution satisfies d ( x 1 , x 2 ) = U . If the objective function decreases during the movement, stop the movement and move x2 back to the nearest vertex on the edge, and we obtain a solution with both points being vertices.
Combining the above two cases, there must exist an optimal solution satisfying the two forms described in the theorem. The proof is completed.    □
It is not hard to seee that to solve the constrained 2-maxian problem on a block graph, we only need to traverse all vertices and the edge interior points with distance exactly U from each vertex, which greatly reduces the solution search space.

3. Algorithm Design and Complexity Analysis

Based on Theorem 1, we design a polynomial-time traversal algorithm for the constrained 2-maxian problem on block graphs, combined with the structural characteristics of block graphs.

3.1. Preprocessing Steps

1. Graph initialization: Input the block graph G = ( V , E ) , vertex weights w i , edge length set and distance upper bound U . Let n = | V | , m = | E | .
2. All-pairs shortest path calculation: Use the breadth-first search (BFS) for block graphs to compute the shortest path distance d ( u , v ) between any two vertices u , v V . Since block graphs are composed of cliques connected by cut vertices, the all-pairs shortest path can be completed in O ( n 2 ) time.
3. Mark critical interior points: For each vertex u V , find all interior points p on edges of G such that d ( u , p ) = U , and record these points as critical candidate points. The number of such points is O ( m ) .

3.2. 4.2 Main Algorithm Flow

Preprints 220640 i001

3.3. Time Complexity Analysis

The time complexity of preprocessing steps is O ( n 2 ) . Since there are O ( n 2 ) vertex pairs, and each objective function calculation takes O ( n ) time, the total time of travesing all vertex pairs is O ( n 3 ) . The number of critical interior points is O ( m ) , then the total time of traversing all vertex-interior point is O ( n 2 m ) . Since the number of edges of a block graph satisfies m = O ( n 2 ) in the worst case, the overall time complexity of the algorithm is O ( n 3 ) (polynomial time). For sparse block graphs (e.g., tree-like block graphs with m = O ( n ) ), the algorithm is optimized to O ( n 2 ) .

3.4. Algorithm Correctness

According to Theorem 1, all potential optimal solutions are covered in the two traversal stages of the algorithm (vertex-vertex pairs and vertex-interior point pairs with d = U ). The algorithm selects the candidate with the largest objective function value from all feasible solutions, so the obtained solution is globally optimal.

4. Relationship Between Constrained and Unconstrained Problems

4.1. Special Case of Loose Constraints

When the distance upper bound U D i a m ( G ) (where D i a m ( G ) is the diameter of the block graph G), the constraint d ( x 1 , x 2 ) U is always satisfied for any two points on G. At this time, the constrained 2-maxian problem degenerates into the unconstrained 2-maxian problem on block graphs, and the proposed algorithm is consistent with the classic unconstrained algorithm.

4.2. Tight Constraints

When U < D i a m ( G ) , the distance constraint will narrow the feasible region. The optimal objective value of the constrained problem is always less than or equal to that of the unconstrained problem. Different from trees and cycles, block graphs have multiple cliques and cut vertices, so the feasible region presents a segmented structure on different blocks.

4.3. Comparison with Other Graph Models

Tree graphs: The constrained 2-maxian problem on trees has a linear-time algorithm; trees are special block graphs, and the algorithm in this paper can be simplified to linear time for tree structures.
Cycle graphs: Bai and Du [1] realized linear-time solution for cycles; cycles are not block graphs, but the vertex optimality property is consistent with this paper.
Cactus graphs: Cacti and block graphs are two different biconnected composite graphs, and the constrained maxian problem on cacti can be extended based on the research framework of this paper.

5. Conclusions and Future Research

5.1. Main Conclusions

This paper studies the constrained 2-maxian problem on block graphs with facility distance constraints. The main conclusions are as follows:
1. For the constrained 2-maxian problem on block graphs, any optimal solution contains at least one vertex of the graph, and the other point is either a vertex or an edge interior point with the distance exactly equal to the upper bound U .
2. Based on the vertex optimality property, a polynomial-time algorithm is designed to solve the problem, with the time complexity of O ( n 3 ) for general block graphs and O ( n 2 ) for sparse block graphs.
3. When the distance constraint is loose, the constrained problem is equivalent to the unconstrained 2-maxian problem on block graphs; tight constraints will reduce the optimal objective value and narrow the feasible solution space.

5.2. Future Research Directions

Extend the research to the general constrained p-maxian problem ( p 3 ) on block graphs, and explore whether there are faster polynomial-time algorithms. Combine weight characteristics (positive and negative weights) to study the constrained maxian problem with mixed weights on block graphs. Migrate the research framework to cactus graphs, interval graphs and other composite graphs, and establish a unified solution system for constrained maxian problems on composite graphs. Design linear or near-linear time optimized algorithms for special subclasses of block graphs (such as tree block graphs, clique chains).

Acknowledgments

This work was partially supported by the Natural Science Foundation of Guangxi Autonomous Region of China (No. 2024GXNSFAA010506) and the Natural Science Research Foundation of Colleges and Universities of Anhui Province (KJ2024AH051719).

References

  1. Bai, C.; Du, J. The constrained 2-maxian problem on cycles. Mathematics 2024, 12(876), 1–9. [Google Scholar] [CrossRef]
  2. Burkard, R.E.; Fathali, J.; Kakhki, H.T. The p-maxian problem on a tree. Oper. Res. Lett. 2007, 35, 331–335. [Google Scholar]
  3. Cheng, Y.K.; Kang, L.Y. The p-maxian problem on interval graphs. Discret. Appl. Math. 2010, 158(18), 1986–1993. [Google Scholar]
  4. Kang, L.Y.; Cheng, Y.K. The p-maxian problem on block graphs. J. Comb. Optim. 2010, 20, 131–141. [Google Scholar]
  5. 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]
  6. 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, 1–14. [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.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings