Compounding Procedures for a Weighted Item Collecting Problem with a Cost Penalty Term in Directed Bipartite Structures

A weighted item collecting problem in directed bipartite graphs is considered, where a set of items with profits and a set of players with costs are contained. The problem is viewed as a generalization of a constrained via minimization in integrated circuit design. With respect to the costs paid by the players in an arc reversing strategy, a budget constraint version and a penalty term version have been modeled. In this paper, a procedure of compounding semi-solutions is proposed for the latter version, and it is utilized in an application of the simulated annealing. Numerical experiments are conducted to demonstrate the heuristic performance, and the results are reported.


Introduction
The weighted item collecting problem to be discussed in this paper is a combinatorial optimization problem which asks to find a 0-1 vector of n variables that optimizes a prescribed objective function.The problem is viewed as a generalization of a constrained via minimization in integrated circuit design (1) , and also as a variant of 0-1 knapsack problems in graph structures (2,3,4) .There have existed two models, a budget constraint version (5) and a cost penalty term version (6) , and in this paper we consider the latter version.A review of the problem description is provided as follows.
Let I = {i | i = 1, . . ., m} and J = {j | j = 1, . . ., n} denote a finite set of items and a finite set of players, respectively.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, and a non-negative cost c j is associated with each player j ∈ J.We regard each of the two weights as a profit of the item.
For each player j ∈ J, let B j ⊆ I (resp., R j ⊆ I) denote the set of items to each of which the player initially sends a blue (resp., a red) signal, where B j ∩R j = ∅ must be satisfied.Without loss of generality, it is assumed that each player j ∈ J meets B j ∪ R j ̸ = ∅, which implies that each player sends at least one item either blue or red signal.It is also assumed that A player j ∈ J is said to be reversed when changing every color of the initial connection signals associated with B j ∪ R j to the opposite one (i.e., either from blue to red, or from red to blue).That is, a reversed player j ∈ J sends a red (resp., a blue) signal to each item in the set B j (resp., in the set R j ).A reversing vector x = (x 1 , x 2 , . . ., x n ) is introduced as a solution of the problem, where for each j = 1, 2, . . ., n, The n players pay the reversing cost in a reversing vector x as their arc reversing strategy.Let b denote a given non-negative bound for the reversing cost.Then the excess of the cost from the bound is represented by The zero reversing vector x = 0 with x j = 0 for all players j ∈ J meets c(0) = 0, and hence we have g(0) = 0.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 cooperative team can get the profit w i (resp., w m+i ) when i ∈ I B (x) (resp., when i ∈ I R (x)) holds.The total profit obtained by a solution x is defined to be In this paper, we treat the following objective function to be maximized: where µ ≥ 0 is a prescribed penalty coefficient and the term of µ × g(x) is the cost penalty.Let x = x * denote a solution which attains the objective function value such that it satisfies F (x * ) ≥ F (x) for any solution x.Note that for an instance of the problem, any 0-1 vector x is feasible, while for an instance of the budget constraint version, a 0-1 vector x with c(x) ≤ b (and hence g(x) = 0) is only feasible (5) .We refer to the x * as an optimal solution, and let F * = F (x * ) denote the optimal value.We also define a solution x = x for the maximum total profit such that it satisfies f (x) ≥ f (x) for any solution x (even if it may meet g(x) > 0).Generally, x * ̸ = x.We call the problem of asking to find an optimal solution x = x * WIC (Weighted Item Collecting) for short.
A greedy heuristic algorithm has been presented for problem WIC by the authors (6) , and for some test instances with m = 20 and n = 20, the good numerical performance has been observed.However, for such randomly generated instances, it may be possible to attain some improvement of the heuristic quality.Recently, based on the simulated annealing (7,8) , an iterative improvement heuristic algorithm has been designed for the budget constraint version (9) .In this paper, we also attempt to apply a similar framework of the simulated annealing to the cost penalty version.On the other hand, since we use a sequence of fundamental n-bit strings, called basic semi-solutions, as an incumbent, instead of the direct expression of a reversing vector, we newly designed a procedure of compounding semi-solutions in order to address the cost penalty term in the objective function.We further conduct numerical experiments to examine the heuristic performance, comparing with existing procedures of compounding, and report the results.

Bipartite Relation between Items and Players
An instance of problem WIC with the unit profits (i.e., w i = w m+i = 1) for each item i ∈ I and with the zero cost (i.e., c j = 0) for each player j ∈ J is viewed as an instance of the Minimal Switching Graph (MSG) problem (1) .Problem MSG represents a constrained via minimization (10) .In the context, an item is a via candidate in a double-sided circuit, and a player is a wiring cluster.A reversed player corresponds to a wiring cluster to be moved from the initial side of the circuit board to the opposite side.The total profit (see Eq. ( 4)) illustrates the number of eliminative via candidates.Problem WIC contains the cost penalty term, and it may tend to a circuit design with a smaller change from the initial design (6) .
A directed bipartite representation between the items and the players has been introduced firstly when modeling problem MSG (11) .Let G(x) = (I ∪ J, A B (x) ∪ A R (x)) denote a reversing graph with respect to a solution x as the directed bipartite structure, where A B (x) and A R (x) are disjoint arc sets such that A B (x) ⊆ I × J and A R (x) ⊆ J × I.More precisely, an arc (i, j) ∈ A B (x) (resp., (j, i) ∈ A R (x)) indicates that to the item i ∈ I, the player j ∈ J sends a blue (resp., a red) signal.We here refer Fig. 1 provided in our past report (6) as an example of the initial bipartite graph G(0) and of another reversing graph G(x) with x = (1, 0, 0, 1, 0, 0), where m = 7 and n = 6.In (a) of the figure, I B (0 ) may be called a completely bluesignaled (resp., a completely red-signaled) item in the solution x.

Semi-solutions and Basic Ones
For a reversing vector x = (x 1 , x 2 , . . ., x n ), the counterpart of the x is defined by x = (x 1 , x 2 , . . ., x n ), where for each player j = 1, 2, . . ., n, it holds For an instance of problem WIC, a reversing vector x and the counterpart x satisfy I B (x) = I R (x) and I R (x) = I B (x) (5) .A reversing vector x can obviously be regarded as a string of n binary bits.Introducing the ordinary symbol * for representing "no care" in a bit (1) , a semi-solution is defined by s = [s 1 , s 2 , . . ., s n ], where for each j = 1, 2, . . ., n, The semi-solutions are basically the same as atomic building blocks defined by Tang (2005) (1) .The counterpart semisolution s = [s 1 , s 2 , . . ., s n ] of the s has been explicitly named by the authors (5) , where for each j = 1, 2, . . ., n, For each item i ∈ I, the blue basic (resp., red basic) semisolution s (i) (resp., s (i) ) summarizes all the solutions taking the profit w i (resp., w m+i ) of a completely blue-signaled item (resp., a completely red-signaled item).Conversely, if a certain item i ∈ I can be a completely blue-signaled item (resp., a completely red-signaled item) in a solution x = (x 1 , x 2 , . . ., x n ), the x contains the blue basic semisolution  (6) : The initial reversing graph G(0) in (a), and another reversing graph G(x) by x = (1, 0, 0, 1, 0, 0) in (b), where an asterisk indicates a reversed player.
holds for any player j ∈ J with s j ∈ {0, 1}, and it is expressed by x ⊒ s.
From a given semi-solution s and a reversing vector x with x ⊒ s, if s j = * implies x j = 0, then the x is the minimal solution of the s.From a semi-solution, the minimal solution for it can obviously be obtained in O(n) time (5) .Let denote the minimal cost of a semi-solution s.

Compound Semi-solutions
3.1.Consistency between Two Semi-solutions (5) if there exists some player j ∈ J who meets all the following three conditions : Otherwise, they are consistent.Note that for any item i ∈ I, the blue and red basic semi-solutions s (i) and s (i) are always inconsistent.For example, in the problem instance of Fig. 1, any two semi-solutions among s (1) , s (4) , s (5) , s (6) and s (7) are consistent.For two distinct semi-solutions, their consistency can obviously be checked in O(n) time by Eq. (10) (5) , and in this paper, we are going to use the following O(n) time function: Function CONSISTENCY(s, s ′ ) Input: Two distinct semi-solutions s and s ′ .Output: If the two semi-solutions s and s ′ are consistent, then return true; otherwise, return false.

Compounding Procedures
For two distinct semi-solutions s and s ′ , there is 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 (5) .Suppose that the s and s ′ are consistent.Then, we obtain a semi-solution ŝ from the two semi-solutions s and s ′ such that for each player j = 1, 2, . . ., n, it holds The minimal solution x for the ŝ meets x ⊒ s and x ⊒ s ′ .We refer to the ŝ as the compound semi-solution of the two consistent semi-solutions s and s ′ .
In this paper, we propose the following O(n) time procedure of compounding semi-solutions, where for convenience, we assign the capital A to the proposed procedure, the capital B to an existing procedure for the budget constraint version (9) and the capital C to another existing procedure for a sufficiently large budget version.
Procedure 1 COMPOUND (s, k, X ∈ {A, B, C}; ŝ) Input: A semi-solution s = [s 1 , s 2 , . . ., s n ], an integer k ∈ {1, 2, . . ., 2m} as an index of the basic semi-solution compounded with the s, and a letter X for specifying the procedure type.Output: A semi-solution ŝ = [ŝ 1 , ŝ2 , . . ., ŝn ] such that it is either the compound semi-solution of the s and the s (k) , or the unchanged ŝ = s.ŝ := (the compound semi-solution of the s and s (k) ); 5: end if We expect that Lines 7 and 12 of the proposed procedure in this paper, i.e., the case of X=A, avoid a compound semisolution with a larger minimal cost, while they accept a compound semi-solution with a relatively small excess from the cost bound b (see Eqs. ( 3) and ( 5)).On the other hand, the existing procedure with X=B cannot accept any solution x with c(x) > b even if it is advantageous in the objective function of Eq. ( 5).Further, the other existing procedure with X=C does not care the reversing cost at all, and any basic semi-solution s (k) consistent with the current s is compounded by Line 4.
With respect to the above procedure, we are going to express the semi-solution s = [s 1 , s 2 , . . ., s n ] with s j = * for all players j ∈ J by s = s * in the following section.(We remark that the s * is not related to the optimal solution x * .)

A Heuristic with the Proposed Procedure
The local search is a fundamental searching procedure which starting with an initial solution, exploits a neighborhood of an incumbent, and replaces the incumbent by a neighboring solution with an improvement from it, until there is no neighboring solution with an improvement around the current incumbent (12) .The simulated annealing is one of such neighborhood search procedures, and it has a particular function such that it may escape a poor local optimal solution, well known as the acceptance probability for an inferior solution to an incumbent (7,8,12) .
In this paper, we utilize the proposed procedure of compounding semi-solutions in an application of the simulated annealing.The framework of the simulated annealing to be applied in this paper is similar to that for the budget constraint version (9) and it is shown in Algorithm 1.It is assumed that the 2m basic semi-solutions s (i) and s (m+i) = s (i) have been obtained by an O(mn) time preprocessing (1,5) .The acceptance probability for an inferior solution is described by Line 24 in Algorithm 1. Further, instead of the direct expression of a reversing vector, we use a sequence of the 2m basic semi-solutions as a representation form of a solution in Algorithm 1.More details are explained as follows.
of problem WIC, and a letter X ∈ {A, B, C} for specifying the procedure type of Procedure 1. Parameters of the Simulated Annealing: t max , t min (< t max ), α (< 1), ℓ max , u max and κ B .Output: A heuristic solution x ′ .1: Call Procedure 2 provided in the following, which returns a solution set to be an incumbent x inc , and a sequence σ of the 2m basic semi-solutions ; Obtain the minimal solution x for the semi-solution s constructed from the neighboring sequence σ N ; 16: x inc := x ; F inc := F (x inc ) ; σ := σ N ; / * A superior x to the incumbent x inc is always accepted as the incumbent solution.* / x

The Initial Solution
In this section, we explain how we obtain an initial incumbent.Let σ = (σ [1], σ [2], . . ., σ[2m]) denote a permutation on {1, 2, . . ., 2m}, which we call a compounding sequence of the 2m basic semi-solutions.For a compounding sequence σ, by O(m) callings of Procedure 1 which starts with the semisolution s * , we can obtain a reversing vector x such that it meets F (x) ≥ 0, since g(0) = 0. (Recall that the minimal solution for the s * is the zero reversing vector x = 0 with c(0) = 0.) Algorithm 1 sets the initial solution and the corresponding incumbent of a compounding sequence to be the greedy ones (6) .The description is provided in Procedure 2. That is, following the greedy manner, the initial compounding sequence σ = (σ [1], σ [2]

Procedure 2 GREEDY FOR COST PENALTY
of problem WIC, and a letter X ∈ {A, B, C} for specifying the procedure type like Procedure 1. Output: A heuristic solution x ′ and a sequence σ of the 2m basic semi-solutions.

Neighborhood Structures
In this paper, for Line 9 of Algorithm 1, we consider two neighborhood structures, SWAP and F&R, as the N (σ) for an incumbent σ to generate a neighboring sequence σ N .
For a compounding sequence σ = (σ [1], σ [2], . . ., σ[2m]), one of typical neighborhood structures may be the swapping, i.e., for the set S with |S| = (2m)! of all compounding sequences, Another typical neighborhood structure may be the insertion.The neighborhood structure F&R is a particular insertion which regards a mathematical feature of the problem of collecting items in bipartite graphs (9) .Let s = s(σ) denote the semi-solution constructed from a compounding sequence σ by the O(m) callings of Procedure 1, and let x = x(σ) denote the minimal solution for the s(σ).Further, let Then, the insertion neighborhood is represented by That is, a basic semi-solution which is not contained in the current solution is moved to the front, and another basic semisolution which is contained in the current solution is moved to the rear.Notice that the minimal solution x(σ) gets the following total profit :

Parameters of the Simulated Annealing
As shown in Algorithm 1, we need to set the parameters t max , t min , α, ℓ max , u max and κ B of the simulated annealing.We basically follow an algorithm design textbook (8) for setting the initial temperature t max and the number ℓ max of iterations at each temperature.For setting the final temperature t min , and the cooling rate α, the expected execution time of the simulated annealing based heuristic algorithm may be regarded.For the rest, i.e., the upper limit u max and the normalization factor κ B in the acceptance probability, some test runs of the heuristic algorithm may be required (9) .In the next numerical section, we are going to set the parameters as follows: • The initial temperature: t max = 1.0, the final temperature: t min = 0.1, and the cooling rate: α = 0.9.
• The number of iterations at each temperature: ℓ max = 1000.
• The upper limit on the number of iterations with no improvement of the best solution: u max = 10000.
• The normalization factor in the acceptance probability: κ B = 1.0.

Numerical Experiments
The program for numerical experiments in this section is written in C language, and is run on a laptop computer with Windows 10 Pro (64bit), Intel Core i7 6500U CPU (2.50 GHz) and 8GB memory.Most of instances of problem WIC to be tested are randomly generated as follows: • The number of items: m = 20, and the number of players: n = 20.
• 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 By the same manner, we prepare one hundred instances with m = n = 20 for every collection of the above settings.For such a size of an instance, the maximum F * is computed by a complete enumeration of Gray code representation of a reversing vector (8) .Further, we regard such an instance as a composing unit, and we construct a larger instance with m = n = 20 × 4 = 80, in which the profits of items and the costs of players are unchanged, while the bound is changed to be b := 4b.It is easy to obtain the optimal value for the larger instance from the information of composing unit when b = 0.
In all numerical results shown in the following tables, each of the data indicates the mean value in a set of one hundred test instances.Unfortunately, no randomly generated instance was tested for an application of the genetic algorithm to problem MSG (1) , and the heuristic algorithm can address only the sufficiently large budget case, e.g., b = ∑ j∈J c j .Note that for any instance of problem WIC, an optimal solution x * satisfies F (x * ) ≥ F (0) ≥ 0. In our numerical experiments, only test instances with F (x ′ ) > 0 are observed for the heuristic solution x ′ obtained by Algorithm 1, and we see that all the test instances satisfy F (x * ) > 0. Hence, we introduce the relative error of the heuristic objective function value F (x ′ ) from the maximum F (x * ) in order to evaluate the heuristic performance.The relative error is expressed by We also represent the number of instances for which the simulated annealing based heuristic algorithm attains an optimal solution among one hundred test instances by #OPT.The definition implies that the average relative error E R over one hundred test instances is zero when #OPT=100.
Table 1 shows the heuristic performance on test instances with m = n = 20, b = 0 and µ = 1.In this setting, the reversing cost is directly deducted from the total profit.The simulated annealing based heuristic with either SWAP or F&R neighborhood structure and with X=A significantly improves the F (x) value from the greedy one with X=A, and attains the average relative error E R = 1.9 [%].  2 indicates the good performance of the simulated annealing based heuristic algorithm either SWAP or F&R neighborhood structure and with X=A.For the larger test instances, the complete enumeration by Gray code is not practical from the viewpoint of the execution time.
Table 3 illustrates the heuristic performance on test instances with b = ⌊ ∑ j∈J c j /4⌋ and µ = ∑ 2m i=1 w i .This is equivalent to a budget constraint case.The greedy heuristic with X=A and that with X=B show (almost) the same performance.On the other hand, the greedy heuristic with X=C does not address the budget constraint.In this table, the simulated annealing based heuristic with F&R neighborhood structure and with X=A returns #OPT=100.
Table 4 shows the heuristic performance on test instances with b = ⌊ ∑ j∈J c j /4⌋ and µ = 1.This is an intermediate case between Tables 1 and 3. Also in this table, the simulated annealing based heuristic with F&R neighborhood structure and with X=A returns #OPT=100, while that with F&R neighborhood structure and with X=B returns #OPT=51. .

Concluding Remarks
In this paper, we treated a weighted item collecting problem in directed bipartite graphs, where a finite set of items and a finite set of players are contained.The objective function to be maximized involved not only the total profit of collected items, but also a penalty term for the reversing cost paid by the players.We represented a reversing vector as a solution of the problem by a sequence of the basic semi-solutions, which is transformed into a reversing vector by a procedure of compounding semi-solutions.In order to address the cost penalty term of the objective function, we designed a new procedure of compounding semi-solutions, and utilized it in a framework of the simulated annealing.We also conducted numerical experiments to examine the performance of the simulated annealing based heuristic algorithm with the proposed compounding procedure, and observed that the proposed compounding procedure is more suitable for the cost penalty term than two existing compounding procedures for the budget constraint and the sufficient budget versions.
In the numerical experiments, we set the parameters of the simulated annealing to be some typical values.Hence, for future research, it would be interesting to tune them more carefully, and to apply the heuristic algorithm to more larger instances.Also, since we have now obtained three types of compounding procedures, it would be interesting to consider a combined version of the budget constraint and the cost penalty, i.e., a reversing vector meeting the budget constraint is a feasible solution, and the problem asks to find a feasible solution which maximizes a linear combination of the total profit of collected items and the excess of the cost paid by the players from a given bound.