GPU Implementation Method of Asymmetric Auction Algorithm

By adopting GPU parallel computing technology in the asymmetric problem auction algorithm, the problem of inefficient linear allocation solution of asymmetric problems in the prior art is solved, and the rapid solution of large-scale problems is achieved.

CN114996521BActive Publication Date: 2025-04-08DALIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210485454.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-06
Publication Date
2025-04-08
Estimated Expiration
2042-05-06

AI Technical Summary

Technical Problem

Existing auction algorithms are difficult to effectively solve the linear allocation problem in asymmetric problems (inconsistent numbers of people and objects), resulting in inefficient solution.

Method used

GPU parallel computing technology is adopted to realize accelerated computing of asymmetric problem auction algorithm. The specific steps include establishing a bidding matrix and allocation table, updating the bidding matrix and allocation table through GPU calculations until the maximum profit match is achieved.

Benefits of technology

Through GPU accelerated computing, the solution time of the asymmetric problem auction algorithm in large-scale linear allocation problems is significantly shortened, and the computing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0003629687100000051
    Figure BDA0003629687100000051
  • Figure BDA0003629687100000052
    Figure BDA0003629687100000052
Patent Text Reader

Abstract

The present invention belongs to the field of computer technology, and provides a GPU implementation method of an asymmetric problem auction algorithm. The auction algorithm is a classic algorithm for solving linear allocation problems, and the present invention provides a method for implementing an asymmetric problem auction algorithm on a GPU. The present invention divides the auction algorithm into two steps: bidding and allocation. In the bidding step, the GPU is used to perform parallel processing on different rows at the same time to solve the maximum value, the second largest value, and the index of the maximum value of each row; in the allocation step, the GPU is used to perform parallel processing on different columns at the same time to solve the maximum value and the index of the maximum value of each column. The present invention first determines whether the input cost matrix needs to be transposed, and then implements the asymmetric problem auction algorithm on the GPU by looping through iterative bidding and allocation steps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer technology and relates to a GPU implementation method of an asymmetric problem auction algorithm. Background Art

[0002] Auction Algorithm (DP Bertsekas, "Auction algorithms for network flow problems: A tutorial introduction," Computational optimization and applications, vol. 1, no. 1, pp. 7–66, 1992) is a classic algorithm for solving linear assignment problems. The original auction algorithm is modeled on the basis of an auction, that is, there are N people and N auction items, which must be matched one-to-one. The input of the algorithm is an N×N cost matrix, in which all elements are non-negative; any element a in the matrix ij represents the bid of the i-th person for the j-th object. The purpose of the algorithm is to pair people with objects and maximize the total revenue (the sum of the corresponding values ​​in the N×N cost matrix). The present invention provides a GPU implementation method for an auction algorithm for an asymmetric problem (i.e., the number of people and objects does not have to be the same). Summary of the invention

[0003] The purpose of the present invention is to provide a GPU implementation method of an asymmetric problem auction algorithm to meet the demand for fast solution of linear assignment problems.

[0004] The technical solution adopted by the present invention is as follows:

[0005] A GPU implementation method of an asymmetric auction algorithm includes the following steps:

[0006] 1) Establish a GPU implementation method for the asymmetric auction algorithm; specifically, input an N×M cost matrix C1. If N is greater than M, transpose the matrix, swap the values ​​of N and M, and C1 will remain an N×M matrix. Otherwise, maintain the original state; initialize a (N+1)×M bidding matrix B1; a person / item allocation table person2item1, containing N elements, each element is initialized to -1; an item / person allocation table item2person1, containing M elements, each element is initialized to -1; a price table prices1, containing M elements, each element is initialized to 0; then perform the following loop operations:

[0007] All elements in the bidding matrix B1 are set to 0;

[0008] After executing the bidding step, the bidding matrix B1 is updated;

[0009] After executing the assignment step, person2item1, prices1, and item2person1 are updated;

[0010] Before each loop starts, the number of -1 elements in person2item1 is determined. If the number is not 0, the loop starts, otherwise the loop ends. If the cost matrix C1 has been transposed, the final result is item2person1, otherwise it is person2item1.

[0011] 2) Establish the bidding step; input an N×M cost matrix C2, where all elements in C2 are greater than or equal to 0; a (N+1)×M bidding matrix B2, where all elements in B2 are 0; a person / item allocation table person2item2, containing N elements, each of which is an integer greater than -2 and less than M; a price table prices2, containing M elements, each of which is not negative; the GPU calculates in parallel the maximum value x2, the second largest value y2, and the index [n2, m2] of the maximum value x2 in the cost matrix C2 represented by the index with a value of -1 in person2item2, where n2 is the current row index and m2 is greater than or equal to 0 and less than M; then the GPU updates B2 in parallel as follows:

[0012] B2[n2][m2]=x2–y2+1 / N;

[0013] B2[N][m2]=1;

[0014] When calculating x2, y2, [n2, m2] of a row of M elements with a known row index of n2, the GPU first generates a new array t2 of M×3 elements and initializes it as follows:

[0015] t2[i2×3]=C2[n2][i2]–prices2[i2];

[0016] t2[i2×3+1]=0;

[0017] t2[i2×3+2]=i2;

[0018] Among them, i2 is greater than or equal to 0 and less than M; t2[i2×3], t2[i2×3+1] and t2[i2×3+2] constitute a group of basic units, the index value of the basic unit is i2, and the three represent the maximum value in the unit, the second largest value in the unit, and the column index of the maximum value in the unit in the cost matrix C2 respectively; after initialization, calculate the maximum value f2 among the powers of 2 less than M. For units with index values ​​greater than or equal to f2, if t2[i2×3] is greater than or equal to t2[(i2–f2)×3], calculate in sequence:

[0019] t2[(i2–f2)×3+1]=t2[(i2–f2)×3];

[0020] t2[(i2–f2)×3]=t2[i2×3];

[0021] t2[(i2–f2)×3+2]=t2[i2×3+2];

[0022] Otherwise calculate:

[0023] t2[(i2–f2)×3+1]=t2[i2×3];

[0024] Then, a reduction operation is performed on the first f2×3 elements of the sequence t2, that is, j2 is set to f2 / 2. For units with index values ​​less than j2, if t2[i2×3] is less than or equal to t2[(i2+j2)×3], the following are calculated in sequence:

[0025] t2[i2×3+1]=max(t2[i2×3],t2[(i2+j2)×3+1]);

[0026] t2[i2×3]=t2[(i2+j2)×3];

[0027] t2[i2×3+2]=t2[(i2+j2)×3+2];

[0028] Otherwise, when t2[i2×3+1] is less than t2[(i2+j2)×3], calculate:

[0029] t2[i2×3+1]=t2[(i2+j2)×3];

[0030] Then let j2 be j2 / 2 and continue the above operation until j2 is 0. Then t2[0], t2[1], t2[2] are the required x2, y2, m2.

[0031] 3) Establish the allocation step; input a (N+1)×M bidding matrix B3, where all elements in B3 are not negative; a person / item allocation table person2item3, containing N elements, each of which is an integer greater than -2 and less than M; an item / person allocation table item2person3, containing M elements, each of which is an integer greater than -2 and less than N; a price table prices3, containing M elements, each of which is not negative; the GPU calculates in parallel the maximum value x3 of the column index with a value of 1 in the last row of the bidding matrix B3, and the index [n3, m3] of the maximum value x3 in the bidding matrix B3, where n3 is greater than or equal to 0 and less than N, and m3 is the current column index; then the GPU updates person2item3, prices3, and item2person3 in parallel as follows:

[0032] person3 = item2person3[m3];

[0033] if(person3>=0)

[0034] person2item3[person3]=-1;

[0035] prices3[m3]+=x3;

[0036] person2item3[n3]=m3;

[0037] item2person3[m3]=n3;

[0038] When calculating x3, [n3, m3] in a column where the column index is known and the first N elements of m3, the GPU first generates a new N×2 element column t3 and initializes it as follows:

[0039] t3[i3×2]=B3[i3][m3];

[0040] t3[i3×2+1]=i3;

[0041] Among them, i3 is greater than or equal to 0 and less than N; t3[i3×2] and t3[i3×2+1] constitute a group of basic units, and the index value of the basic unit is i3, which respectively represents the maximum value within the unit and the row index of the maximum value within the unit in the matrix B3; after initialization, the maximum value f3 among the powers of 2 less than N is calculated. For units with index values ​​greater than or equal to f3, if t3[i3×2] is greater than t3[(i3–f3)×2], then calculate:

[0042] t3[(i3–f3)×2]=t3[i3×2];

[0043] t3[(i3–f3)×2+1]=t3[i3×2+1];

[0044] Then, a reduction operation is performed on the first f3×2 elements of the sequence t3, that is, j3 is set to f3 / 2. For units with index values ​​less than j3, if t3[i3×2] is less than or equal to t3[(i3+j3)×2], then the calculation is:

[0045] t3[i3×3]=t3[(i3+j3)×3];

[0046] t3[i3×3+1]=t3[(i3+j3)×3+1];

[0047] Then let j3 be j3 / 2 and continue to perform the above operations until j3 is 0, then t3[0] and t3[1] are the required x3 and n3.

[0048] Beneficial effects of the present invention: The present invention can enable the asymmetric problem auction algorithm to use GPU to accelerate calculations, greatly shortening the solution time when solving large-scale linear allocation problems. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present invention more clear, the specific implementation modes of the present invention are further described in detail below.

[0050] There is a 3×4 cost matrix C as follows:

[0051]

[0052] The operation of the present invention is performed on it. First, N and M are 3 and 4 respectively and N is less than M, so there is no need to transpose C; initialize a 4×4 bidding matrix B (all elements in B are initialized to 0), a person / item allocation table person2item (containing 3 elements, each element is initialized to -1), an item / person allocation table item2person (containing 4 elements, each element is initialized to -1), and a price list prices (containing 4 elements, each element is initialized to 0).

[0053] Since the number of -1 elements in person2item is 3 (greater than 0), perform the following operations:

[0054] Set all elements in matrix B to 0;

[0055] After executing the bidding step, the bidding matrix B is updated;

[0056] After the assignment step, person2item, prices, and item2person are updated;

[0057] After the above operations are completed, the value of matrix B is:

[0058]

[0059] prices is [0,2.33,2.33,2.33]; person2item is [3,1,2]; item2person is [-1,1,2,0].

[0060] Since the number of -1 elements in person2item is 0, the loop ends. And since matrix C has not been transposed, the final result is person2item, and the algorithm ends.

[0061] The above description is a specific embodiment of the present invention and the technical principles used. If the changes made according to the concept of the present invention do not exceed the spirit covered by the specification, they should still fall within the scope of protection of the present invention.

Claims

1. A GPU implementation method for an asymmetric auction algorithm, characterized in that: The method comprises the steps of: 1) Establish a GPU implementation method for the asymmetric auction algorithm; specifically, input an N×M cost matrix C1. If N is greater than M, transpose the matrix, swap the values ​​of N and M, and C1 will remain an N×M matrix. Otherwise, maintain the original state; initialize a (N+1)×M bidding matrix B1; a person / item allocation table person2item1, containing N elements, each element is initialized to -1; an item / person allocation table item2person1, containing M elements, each element is initialized to -1; a price table prices1, containing M elements, each element is initialized to 0; then perform the following loop operations: All elements in the bidding matrix B1 are set to 0; After executing the bidding step, the bidding matrix B1 is updated; After executing the assignment step, person2item1, prices1, and item2person1 are updated; Before each loop starts, the number of -1 elements in person2item1 is determined. If the number is not 0, the loop starts, otherwise the loop ends. If the cost matrix C1 has been transposed, the final result is item2person1, otherwise it is person2item1. 2) Establish the bidding step; input an N×M cost matrix C2, where all elements in C2 are greater than or equal to 0; a (N+1)×M bidding matrix B2, where all elements in B2 are 0; a person / item allocation table person2item2, containing N elements, each of which is an integer greater than -2 and less than M; a price table prices2, containing M elements, each of which is not negative; the GPU calculates in parallel the maximum value x2, the second largest value y2, and the index [n2, m2] of the maximum value x2 in the cost matrix C2 represented by the index with a value of -1 in person2item2, where n2 is the current row index and m2 is greater than or equal to 0 and less than M; then the GPU updates B2 in parallel as follows: B2[n2][m2]=x2–y2+1 / N; B2[N][m2]=1; When calculating x2, y2, [n2, m2] in a row of M elements with a known row index of n2, the GPU first generates a new array t2 of M×3 elements and initializes it as follows: t2[i2×3]=C2[n2][i2]–prices2[i2]; t2[i2×3+1]=0; t2[i2×3+2]=i2; Among them, i2 is greater than or equal to 0 and less than M; t2[i2×3], t2[i2×3+1] and t2[i2×3+2] constitute a group of basic units, the index value of the basic unit is i2, and the three represent the maximum value in the unit, the second largest value in the unit, and the column index of the maximum value in the unit in the cost matrix C2 respectively; after initialization, calculate the maximum value f2 among the powers of 2 less than M. For units with index values ​​greater than or equal to f2, if t2[i2×3] is greater than or equal to t2[(i2–f2)×3], calculate in sequence: t2[(i2–f2)×3+1]=t2[(i2–f2)×3]; t2[(i2–f2)×3]=t2[i2×3]; t2[(i2–f2)×3+2]=t2[i2×3+2]; Otherwise calculate: t2[(i2–f2)×3+1]=t2[i2×3]; Then, a reduction operation is performed on the first f2×3 elements of the sequence t2, that is, j2 is set to f2 / 2. For units with index values ​​less than j2, if t2[i2×3] is less than or equal to t2[(i2+j2)×3], the following are calculated in sequence: t2[i2×3+1]=max(t2[i2×3],t2[(i2+j2)×3+1]); t2[i2×3]=t2[(i2+j2)×3]; t2[i2×3+2]=t2[(i2+j2)×3+2]; Otherwise, when t2[i2×3+1] is less than t2[(i2+j2)×3], calculate: t2[i2×3+1]=t2[(i2+j2)×3]; Then let j2 be j2 / 2 and continue the above operation until j2 is 0. Then t2[0], t2[1], t2[2] are the required x2, y2, m2. 3) Establish the allocation step; input a (N+1)×M bidding matrix B3, where all elements in B3 are not negative; a person / item allocation table person2item3, containing N elements, each of which is an integer greater than -2 and less than M; an item / person allocation table item2person3, containing M elements, each of which is an integer greater than -2 and less than N; a price table prices3, containing M elements, each of which is not negative; the GPU calculates in parallel the maximum value x3 of the column index with a value of 1 in the last row of the bidding matrix B3, and the index [n3, m3] of the maximum value x3 in the bidding matrix B3, where n3 is greater than or equal to 0 and less than N, and m3 is the current column index; then the GPU updates person2item3, prices3, and item2person3 in parallel as follows: person3 = item2person3[m3]; if(person3>=0) person2item3[person3]=-1; prices3[m3]+=x3; person2item3[n3]=m3; item2person3[m3]=n3; When calculating x3, [n3, m3] in a column where the column index is known and the first N elements of m3, the GPU first generates a new N×2 element column t3 and initializes it as follows: t3[i3×2]=B3[i3][m3]; t3[i3×2+1]=i3; Among them, i3 is greater than or equal to 0 and less than N; t3[i3×2] and t3[i3×2+1] constitute a group of basic units, and the index value of the basic unit is i3, which respectively represents the maximum value within the unit and the row index of the maximum value within the unit in the matrix B3; after initialization, the maximum value f3 among the powers of 2 less than N is calculated. For units with index values ​​greater than or equal to f3, if t3[i3×2] is greater than t3[(i3–f3)×2], then calculate: t3[(i3–f3)×2]=t3[i3×2]; t3[(i3–f3)×2+1]=t3[i3×2+1]; Then, a reduction operation is performed on the first f3×2 elements of the sequence t3, that is, j3 is set to f3 / 2. For units with index values ​​less than j3, if t3[i3×2] is less than or equal to t3[(i3+j3)×2], then the calculation is: t3[i3×3]=t3[(i3+j3)×3]; t3[i3×3+1]=t3[(i3+j3)×3+1]; Then let j3 be j3 / 2 and continue to perform the above operations until j3 is 0, then t3[0] and t3[1] are the required x3 and n3.

Citation Information

Patent Citations

  • Shortest path auction algorithm considering intersection turning

    CN101571404A

  • User privacy protection mechanism construction method for small cell spectrum auction

    CN106937279A