An Application of Integer Programming Solvers to an Item Collecting Problem in Directed Bipartite Graphs

In this paper, a weighted item collecting problem in directed bipartite graphs is considered, where a finite set of items with non-negative weights and a finite set of players are contained. No budget constraints are imposed on the players, and the problem is viewed as a weighted version of the minimal switching graph problem, which was introduced as a constrained via minimization in integrated circuit design. In this paper, the weighted item collecting problem is interpreted as a special case of the weighted maximum clique problem, and an application of integer programming solvers is investigated in order to obtain an exact solution for an instance of the weighted item collecting problem. Numerical experiments are conducted to demonstrate the exact solutions, and the results are reported.


Introduction
In this paper, we consider a weighted item collecting problem in directed bipartite graphs, where a finite set of items with non-negative weights and a finite set of players are contained. No budget constraints are imposed on the players (i.e., the case with a sufficiently large budget), and the weighted item collecting problem is viewed as a weighted version of the minimal switching graph problem (1) , which was introduced by Tang (2005), for a constrained via minimization in integrated circuit design (2) . Existing algorithms for the minimal switching graph and related problems are heuristic ones (1,3−6) . In this paper, we transform the weighted item collecting problem into a conventional problem of combinatorial optimization, known as the weighted maximum clique problem, and investigate an application of integer programming (IP) solvers in order to obtain an exact solution for an instance of the weighted item collecting problem. The (weighted) maximum clique problem has been known to be NP-hard (7) , while some IP solvers have considerably been improved to find an exact solution for a larger size instance of many integer programming problems.
We review the mathematical description of the weighted item collecting problem (without budget constrains on the players), following our last paper with respect to the problem (6) . Let I = {i | i = 1, 2, ..., m} denote a set of m items, and let J = {j | j = 1, 2, ..., n} denote a set of n players. Two non-negative weights w i and w m+i such that w i + w m+i > 0 are associated with each item i ∈ I as the rewards. There are two kinds of signals, by which the items and the players are connected. For convenience, we assign a color, either blue or red, to each connection signal. For each player j ∈ J, let B j ⊆ I (resp., R j ⊆ I) denote the set of items, each of which is initially connected with the player j ∈ J by a blue signal (resp., by a red signal). It must be satisfied that B j ∩ R j = ∅ for any player j ∈ J. On the other hand, without loss of generality, it is assumed that each player j ∈ J meets B j ∪ R j ̸ = ∅. It is also assumed that B 1 ∪ R 1 ∪ · · · ∪ B n ∪ R n = I.
We say that a player j ∈ J is reversed when changing every color of the initial connection signals associated with the player j ∈ J to the opposite one (i.e., either from blue to red, or from red to blue). As a feasible solution of the weighted item collecting problem, a reversing vector x = (x 1 , x 2 , ..., x n ) is defined, where for each j = 1, 2, ..., n, That is, for a reversed player j ∈ J in a reversing vector x (i.e., for a player j ∈ J with x j = 1), an item i ∈ B j (resp., an item i ∈ R j ) is connected with the player by a red signal (resp., by a blue signal). A signal color (i.e., either blue or red) between an item and an associated player with the item can be represented by a direction of an arc when regarding the set of m items, the set of n players, and the connection between them as a directed bipartite graph. We are going to illustrate an example of such a directed bipartite graph in the following section. For a reversing vector x, let I B (x) ⊆ I (resp., I R (x) ⊆ I) denote the set of items, each of which has only blue connection signals (resp., only red connection signals). We regard an item i ∈ I B (x) ∪ I R (x) with common color connection signals as a successful result of the cooperation of players associated with the item, and the n players as a team can get the weight w i (resp., w m+i ) as the reward when i ∈ I B (x) holds (resp., when i ∈ I R (x) holds). The total weight as the objective function to be maximized is represented by The weighted item collecting problem asks to find a reversing vector x = x * which maximizes the total weight f (x) defined in Eq. (2). We may call the x * an optimal solution.

Directed Bipartite Graph Representation
) denote a directed bipartite graph, called a reversing graph, with respect to a feasible solution x, where A B (x) ⊆ I × J and A R (x) ⊆ J × I are disjoint arc sets. More precisely, an arc (i, j) ∈ A B (x) (resp., an arc (j, i) ∈ A R (x)) indicates a blue signal (resp., a red signal) between item i ∈ I and player j ∈ J. In particular, let G(0) = (I ∪ J, A B (0) ∪ A R (0)) denote the initial reversing graph with respect to the zero reversing vector x = 0.
In Fig. 1, we provide an illustration of the initial reversing graph G(0) and another reversing graph G(x) with respect to x = (1, 0, 1, 1), where the number of items and the number of players are m = n = 4. In the initial G(0), each item i ∈ I has connection signals with both colors, and there is no item with common color signals, i.e., I B (0) = I R (0) = ∅. Hence, the total weight of x = 0 is f (0) = 0. On the other hand, in the G(x) with respect to x = (1, 0, 1, 1), we see

The Weighted Maximum Clique Problem
As mentioned in the first section, we are going to transform the weighted item collecting problem into a conventional problem of combinatorial optimization, known as the weighted maximum clique problem, and to apply an IP solver to an integer programming formulation of the weighted maximum clique problem in order to obtain an optimal solution for a given instance of the weighted item collecting problem. Although the (weighted) maximum clique problem is one of famous combinatorial optimization problems, we here provide a formal description of the weighted maximum clique problem for the self-containment of this paper.
Let H = (V, E, p) denote a weighted undirected graph, where V is a finite set of vertices, E is a finite set of edges with E ⊆ V × V, and p : V → Z + ∪ {0} is a vertex-weight function, which we call a profit function for convenience, and we express a profit of each vertex v ∈ V by p[v] ≥ 0. A clique in graph H = (V, E, p) is defined to be a subset Q ⊆ V of vertices such that every pair of vertices in Q is joined by an edge in E. We represent the size of a clique Q by the cardinality |Q|, and the profit sum of the Q by We refer to the Q * as the maximum profit sum clique (in graph H). When each vertex v ∈ V is given the unit profit, i.e., p[v] = 1, the profit sum of a clique Q means the size of it, i.e., p(Q) = |Q| holds. In this paper, we should include the case of E = ∅ in graph H, and we see the following property: Observation 1. For an instance of the weighted maximum clique problem, the maximum profit sum clique Q * satisfies either

Basic Semi-solutions
Basic semi-solutions are essentially the same as atomic building blocks defined in an application of the genetic algorithm by Tang (2005) for the minimal switching graph problem (1) . If a reversing vector x contains a blue basic semisolution (resp., a red basic semi-solution) for an item i ∈ I, then we can know that the solution x gets the weight w i (resp., w m+i ). We already utilized the basic semi-solutions in greedy heuristic algorithms (3) , which found quickly an optimal solution for the test instance of the minimal switching graph problem (1) produced by Tang (2005). In the following section, we are going to interpret each basic semi-solution of an item as a vertex of an undirected graph H = (V, E, p) of the weighted maximum clique problem, and the corresponding weight of the item as a profit of the vertex. We review the definition of the basic semi-solutions below. For a reversing vector x = (x 1 , x 2 , ..., x n ), the counterpart vector (or simply called, counterpart) of the x is defined bȳ where for each player j = 1, 2, ..., n, The definition implies that the counterpart of thex is the original reversing vector x. Further, hold for a reversing vector x and the counterpartx. For example, consider again a reversing vector A reversing vector x = (x 1 , x 2 , ..., x n ) can be regarded as a string of n binary bits. Introducing the ordinary symbol * for representing "no care" (1) , a semi-solution is defined by s = [s 1 , s 2 , ..., s n ], where for each player j = 1, 2, ..., n, The counterpart of the s is defined bys = [s 1 ,s 2 , ...,s n ], where for each j = 1, 2, ..., n, A blue basic (resp., a red basic) semi-solution s (i) (resp., s (m+i) ) for each item i ∈ I is define to summarize all the solutions getting the weight w i (resp., the weight w m+i ) of the item as a completely blue-signaled one (resp., as a completely red-signaled one). Notice that the counterpart of a blue basic semi-solution is the corresponding red basic semisolution, i.e., for each item i ∈ I, holds. For the problem instance provided in Fig. 1, there are the following four (i.e., m = 4) blue basic semi-solutions : and the following four red basic semi-solutions : Observation 2. For an instance of the weighted item collecting problem, an optimal solution x * can get at least one weight, i.e., it satisfies

Consistency between Two Semi-solutions
In the transformation of the weighted item collecting problem into the weighted maximum clique problem with an undirected graph H = (V, E, p), we are going to interpret a certain consistency between two basic semi-solutions as an edge of the graph H. The consistency has been defined as follows (3) .
We say that two distinct semi-solutions s = [s 1 , s 2 , ..., s n ] and s ′ = [s ′ 1 , s ′ 2 , ..., s ′ n ] are inconsistent if there exists some player j ∈ J who meets all the following three conditions : Otherwise, they are consistent. The definition implies that for any item i ∈ I, the blue basic and red basic semi-solutions s (i) and s (m+i) (=s (i) ) are inconsistent. For example, in the problem instance provided in Fig. 1, two basic semi-solutions s (1) and s (3) are inconsistent (since s (1) and s (7) (=s (3) ) are consistent.
Also, notice that the x = (1, 0, 1, 1) in (b) of Fig. 1 contains the two basic semi-solutions s (1) and s (7) (=s (3) ). Generally, for two distinct semi-solutions s and s ′ , there exists a reversing vector x such that it meets x ⊒ s and x ⊒ s ′ both if and only if the two distinct semi-solutions are consistent (3) . The consistency between two distinct semi-solutions can obviously be checked in O(n) time by Eq. (10).

Transformation Procedure
For an instance of the weighted item collecting problem, we can obtain the m blue basic semi-solutions s (1) , s (2) , . . . , s (m) and the m red basic semi-solutions s (m+1) , s (m+2) , . . . , s (2m) in O(mn) time (1) . From the 2m basic semi-solutions, we construct the following instance of the weighted maximum clique problem: Let V = {v i | i = 1, 2, . . . , 2m} denote the set of 2m vertices, and let The profit of each vertex v i ∈ V is defined to be The graph H = (V, E, p) of the weighted maximum clique problem is obviously constructed in polynomial time from the instance of the weighted item collecting problem. We may call the H a transformed graph from an instance of the weighted item collection problem. In Fig. 2, we show the transformed graph from the instance of the weighted item collecting problem provided in Fig. 1. For example, we see the edge {v 1 , v 7 }, since two basic semi-solutions s (1) and s (7) (=s (3) ) are consistent. We remark that a transformed graph H does not include edge {v i , v m+i } for any i ∈ I, since two basic semisolutions s (i) and s (m+i) are inconsistent by the definition of Eq. (7).

Lemma 1.
For an instance of the weighted item collecting problem, and the transformed instance of the weighted maximum clique problem, let x * denote an optimal solution and let Proof. For an optimal solution x * , let denote the set of basic semi-solutions which are contained in the optimal solution x * . We see that the total weight of the optimal solution is From Observations 1 and 2, without loss of validity, we assume |S(x * )| ≥ 2. Then, any pair of two distinct basic semisolutions s (i) and s (k) in the set S(x * ) is a consistent one, and hence there exists the corresponding edge {v i , v k } in the transformed graph H. Further, let denote a subset of vertices. Notice that the Q(x * ) is a clique in the transformed graph H, and the profit sum is Hence, we have On the other hand, for the maximum profit sum clique Q * , we can also assume |Q * | ≥ 2 from Observations 1 and 2, and let denote the set of basic semi-solutions which correspond to the vertices in the Q * . Then, any pair of two vertices v i and v k in the vertex set Q * has the edge {v i , v k } joining the two vertices in the transformed graph H, and hence any two distinct basic semi-solutions s (i) and s (k) in the set S ′ (Q * ) are consistent, which implies that there is a reversing vector x such that it satisfies x ⊒ s (i) for all basic semi-solutions s (i) ∈ S ′ (Q * ). Then, we see that Therefore, we have f (x * ) = p(Q * ).

Compounding Semi-solutions
Suppose that we have obtained the maximum profit sum clique Q * by a certain way (in the following, we are going to obtain the Q * by utilizing an IP solver). Again, let denote the set of basic semi-solutions which correspond to the vertices in the Q * . Then, we can construct an optimal solution x * from the Q * as follows.
We first explain the compounding procedure for consistent semi-solutions (3) . For two distinct semi-solutions s and s ′ such that they are consistent, we obtain a semi-solutionŝ from the two semi-solutions: For each player j = 1, 2, ..., n, let Recall that no player j ∈ J meets Eq. (10). For the semisolutionŝ, letx temporarily denote the minimal solution.
Then, both ofx ⊒ s andx ⊒ s ′ hold. Theŝ is called a compound semi-solution of the consistent pair of s and s ′ . In Procedure 1, we describe the procedure which derives an optimal solution x * for an given instance of the weighted item collecting problem from the maximum profit sum clique Q * for the transformed instance of the weighted maximum clique problem. The correctness depends on Lemma 1.
Procedure 1 (Input Q * ; Output x * ) Input: The maximum profit sum clique Q * for the transformed instance of the weighted maximum clique problem. Output: An optimal solution x * for the given instance of the weighted item collecting problem.

Integer Programming Formulation
We finally show an integer programming formulation of the transformed instance of the weighted maximum clique problem. For a subset Q ⊆ V = {v 1 , v 2 , . . . , v 2m } of vertices in the transformed graph H = (V, E, p), let y[v] denote a 0-1 variable such that for each vertex v ∈ V , Using the 0-1 variables y[v], the weighted maximum clique problem is represented by the following integer programming (which can be found also in the literature) : subject to Due to the space limitation, we would like to omit the discussion for the equivalency of the integer programming formulation to the weighted maximum clique problem. In the numerical section, we are going to apply an IP solver to the above integer programming formulation of the weighted maximum clique problem, and find an exact solution y * . Then, we obtain the maximum profit sum clique by and further we construct an optimal solution x * of the given instance of the weighted item collecting problem from the Q * by Procedure 1.

Numerical Experiments
We write programs for generating test instances and for a greedy heuristic (5) in C language, and utilize CPLEX (8) as an IP solver to find an exact solution for an instance of the weighted maximum clique problem described by the integer programming formulation. The programs in C and the IP solver are run on a desktop computer with Windows 10 Pro Education (64bit), Intel Core i7 4790 CPU (3.60GHz) and 12GB memory. The instances of the weighted item collecting problem to be tested are randomly generated as follows: • The number of items and the number of players: m = n = 200, and m = n = 300. • Weights of each item i ∈ I: Uniformly random integers w i , w m+i ∈ {1, 2, . . . , 10}, and the unit weights w i = w m+i = 1.
• The number of signaling players of each item i ∈ I: with probabilities 0.35, 0.35 and 0.30, respectively.
• The total number of arcs between the sets I and J: The direction of each arc is chosen between the two alternatives with the same probability. It is checked whether each player is associated with at least one item. Table 1 illustrates the performance of the IP solver on instances with m = n = 200 and w i , w m+i ∈ {1, 2, . . . , 10}.
For the comparison, we show the total weights obtained by the zero reversing vector x = 0 (i.e., the total profit in the initial reversing graph G(0)), and that by a greedy heuristic algorithm presented in our previous paper (5) . It is obvious that the total weight is significantly improved from the initial reversing graph by the optimal solution of the IP solver. Also, we show the clique size |Q * | and the execution time of the IP solver on the desktop PC. In an actual situation, the |Q * | means the number of via holes which can be reduced from the initial design in double-sided printed circuit boards. The IP solver finds an optimal solution at most fourteen seconds for the twenty test instances. The Gray code based enumeration (9) as an exact algorithm treated only test instances with m = n = 20 in our previous study (3) , and the application of the IP solver based on the transformation into a conventional problem of combinatorial optimization may indicate a novel direction to find an optimal solution for a larger size of instances of the weighted item collecting problem.  Table 2 demonstrates the performance of the IP solver on instances with m = n = 200 and w i = w m+i = 1. Also in this table, the total weight is significantly improved from the initial reversing graph by the optimal solution of the IP solver. For the case with the unit weights, we actually observe that the total weight of the optimal solution is equal to the size of the maximum profit sum clique, i.e., f (x * ) = p(Q * ) = |Q * |. On the other hand, we notice that the IP solver requires a larger amount of execution time than that for the case with non-unit weights (i.e., w i , w m+i ∈ {1, 2, . . . , m}) in Table 1. In particular, the IP solver spends over 600 seconds (i.e., over ten minutes) as the execution time for two instances, No. 3 and No. 6. The bounding procedure may be less effective for the unit weight case. We here remark again that we do not any budget constraint on the players. The total weight of an optimal solution with respect to no budget case may be utilized as an upper bound on the total weight of an optimal solution with respect to the case with some budget constraint (3,5) . Table 3 shows the performance of the IP solver on instances with m = n = 300 and w i , w m+i ∈ {1, 2, . . . , 10}. Again, we observe that the total weight is improved from the initial Table 4 illustrates the performance of the IP solver on instances with m = n = 300 and w i = w m+i = 1. In this table, we give 600 seconds as the upper limit of the execution time to the IP solver. Hence, the solution obtained by the IP solver within the upper limit may not be optimal, and |Q 600 | denote the size of a clique obtained by the IP solver within the upper limit, instead of the |Q * |. For the case with the unit weights, the total weight is highly improved from the initial reversing graph by the solution of the IP solver, although the solution may not be the optimal one. As in Table 2, we observe that the total weight of the solution by the IP solver is equal to the size of its clique. Unfortunately, the IP solver uses up the allowable execution time for all the twenty test instances. For the case with the unit weights, it would be interesting to examine a certain combination with an iterative improvement procedure, e.g., the simulated annealing (5,10) . Table 4 Performance of the IP solver on instances with m = n = 300 and w i = w m+i = 1.
Total Weight, f (x) cplex info. No.

Conclusions
In this paper, we considered a weighted item collecting problem in directed bipartite graphs, where a finite set of items with non-negative weights and a finite set of players are contained, and no budget constraints are imposed on the players. We interpreted the weighted item collecting problem as a special case of the weighted maximum clique problem, and examined an application of integer programming (IP) solvers to an integer programming formulation of the weighted maximum clique problem in order to obtain an optimal solution for an instance of the weighted item collecting problem.
We conducted numerical experiments to demonstrate the optimal solutions obtained by utilizing CPLEX as an IP solver. The IP solver found an optimal solution for each randomly generated instance with up to three hundred items with nonunit weights and three hundred players within two minutes of execution time, which implies that the problem transformation and the application of the IP solver significantly improve the performance of the Gray code based enumeration as an exact algorithm, although the weighted maximum clique problem is an NP-hard problem. We would regard the approach treated in this paper as a preliminary investigation of designing an exact algorithm for the weighted item collecting problem in directed bipartite graphs with budget constraints on the players.
However, for some randomly generated instances with two hundred items with the unit weights and two hundred players, the IP solver was not able to ensure the solutions obtained within ten minutes of execution time to be optimal, although the solutions highly improved the total weight in the initial reversing graph. For future research, it would also be interesting to examine a certain combination with an iterative improvement procedure such as the simulated annealing for the case with the unit weights.