TW201349119A - Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result - Google Patents

Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result Download PDF

Info

Publication number
TW201349119A
TW201349119A TW101119003A TW101119003A TW201349119A TW 201349119 A TW201349119 A TW 201349119A TW 101119003 A TW101119003 A TW 101119003A TW 101119003 A TW101119003 A TW 101119003A TW 201349119 A TW201349119 A TW 201349119A
Authority
TW
Taiwan
Prior art keywords
thread
sub
ant
computer
cluster
Prior art date
Application number
TW101119003A
Other languages
Chinese (zh)
Other versions
TWI452519B (en
Inventor
chun-zhi Zhang
Original Assignee
chun-zhi Zhang
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by chun-zhi Zhang filed Critical chun-zhi Zhang
Priority to TW101119003A priority Critical patent/TW201349119A/en
Publication of TW201349119A publication Critical patent/TW201349119A/en
Application granted granted Critical
Publication of TWI452519B publication Critical patent/TWI452519B/zh

Links

Abstract

A parallel processing system for combining genetic algorithms with the ant colony optimization (ACO) algorithm to obtain the optimal result, comprising: a host computer and a plurality of sub-cluster computers connected to one another via a network; the host computer has a first main program as well as a main thread, the first main program is used for executing the main thread, a resource control thread and a plurality of connection communication threads; each of the sub-cluster computers has a second main program, a listening thread and an ant server thread, where the second main program is used for executing the listening thread and the ant server thread. Through the preceding threads, the host computer is enabled to deliver computation tasks to the sub-cluster computers for computation, and the host computer is responsible for the gene decoding, acquiring parameters for ACO, and deciding the best fit parameters.

Description

可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統 Parallel processing system that can be combined with genetic algorithm and ant colony algorithm to obtain optimal results

本發明係與透過電腦系統來求解最佳化的求解技術有關,特別是指一種可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統。 The invention relates to a solution technique for solving an optimization through a computer system, in particular to a parallel processing system which can combine genetic algorithm and ant colony algorithm to obtain an optimized result.

目前而言,遺傳演算法與蟻群演算法是目前廣被使用的最佳化方法,也有人將之應用在車輛途程問題(Vehicle Routing Problem,VRP)等組合最佳化問題之求解,而獲得了不錯的效果。 At present, genetic algorithm and ant colony algorithm are widely used optimization methods, and some people apply it to the solution of combination optimization problems such as Vehicle Routing Problem (VRP). A good result.

然而,遺傳演算法雖然具有結構的簡易與通用性,容易產生模組、擴展及應用於各個最佳化問題,但其需耗用的計算能量較高,亦即,其耗用的CPU時間較多,因此求解效率較低。 However, although the genetic algorithm has the simplicity and versatility of the structure, it is easy to generate modules, expand and apply to various optimization problems, but the computational energy it consumes is higher, that is, the CPU time consumed by it is higher. More, so the solution is less efficient.

至於蟻群演算法,雖然其理論架構是植基於最短路徑的搜尋,故其對車輛途程問題等與網路尋優有關的組合最佳化問題之求解所耗用的CPU時間而言,會較遺傳演算法來得佔優勢。但是由於蟻群演算法本身待設定的參數非常多,而且參數之間往往與問題類型、規模以及路線交換改善程序間存在著交互作用,很容易導致之前文獻或實驗所建議的參數設定值失效。因此,要得到較佳的結果,研究者往往必須投入大量的時間與精力去測試各種可能的參數組合。 As for the ant colony algorithm, although the theoretical framework is based on the shortest path search, it will be more CPU time spent on solving the combination optimization problem related to network optimization, such as the vehicle route problem. Genetic algorithms come prevailing. However, because the ant colony algorithm itself has a lot of parameters to be set, and the parameters often interact with the problem type, scale and route exchange improvement program, it is easy to cause the parameter set value suggested by the previous literature or experiment to be invalid. Therefore, to get better results, researchers often have to invest a lot of time and effort to test various possible combinations of parameters.

對於遺傳演算法或蟻群演算法的平行處理技術,目前已有概念性的架構(如Ghiani,Guerriero,Laporte,& Musmanno,2003;Berger,Barkaoui,& Braysy,2004)或利用叢集式電腦(Cluster PCs/Workstations)來實作(如Drummond,Ochi,& Vianna,1999;Doerner,Hartl,Kieshle,Lucka,& Reimann,2004)。但前者並未考慮到實際多電腦環境間如何溝通的問題,後者則必須安裝支援叢集電腦的作業系統(如Linux Cluster,Microsoft Windows Computer Cluster Sever 2003)。由於我國目前以使用Windows的用戶居多,因此要在Unix/Linux的環境下架構叢集電腦,在應用上會面臨不少的限制。 For parallel processing techniques of genetic algorithms or ant colony algorithms, there are currently conceptual architectures (eg Ghiani, Guerriero, Laporte, & Musmanno, 2003; Berger, Barkaoui, & Braysy, 2004) or clustered computers (Cluster) PCs/Worksations) (eg Drummond, Ochi, & Vianna, 1999; Doerner, Hartl, Kieshle, Lucka, & Reimann, 2004). However, the former does not consider how to communicate in the actual multi-computer environment, while the latter must install an operating system that supports cluster computers (such as Linux Cluster, Microsoft Windows Computer Cluster Sever 2003). Since China currently uses Windows users mostly, it is necessary to construct a cluster computer in the Unix/Linux environment, and there are many restrictions on the application.

本發明之主要目的在於提供一種可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,其可使用一般Windows作業系統的個人電腦來架構平行處理之叢集系統,並以此系統結合遺傳演算法與蟻群演算法來求得最佳化結果。 The main object of the present invention is to provide a parallel processing system capable of obtaining an optimization result by combining a genetic algorithm and an ant colony algorithm, which can use a personal computer of a general Windows operating system to construct a parallel processing cluster system, and This system combines genetic algorithms with ant colony algorithms to find optimal results.

為了達成前述目的,依據本發明所提供之一種可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,包含有:複數安裝有微軟視窗系統(Windows)的個人電腦,定義其中一個人電腦為一主控電腦,以及定義其餘的個人電腦為子叢集電腦,該些個人電腦係透過網路彼此連接;該主控電腦具有一第一主程式以及一主執行緒,該第 一主程式用以執行該主執行緒、一資源控制執行緒以及複數連線溝通執行緒;各該子叢集電腦,具有一第二主程式、一聽執行緒以及一螞蟻伺服器執行緒,該第二主程式用以執行該聽執行緒以及該螞蟻伺服器執行緒;其中,在執行該主執行緒時,係建立及啟動一該資源控制執行緒,以及建立初始族群及個體,接著尋找各該子叢集電腦所對應的一用戶端訊息來判斷哪個子叢集電腦是目前沒有計算工作而可使用的,且計算效率高者係優先被選取,並對各該個體的基因予以解碼而求得蟻群演算法的參數,找到可使用的子叢集電腦後即對其交付一該個體的適應值計算工作,如此不斷分配計算工作給可使用的各該子叢集電腦直到所有個體的適應值均已求出,最後記錄具有最佳適應值的個體,之後再進行遺傳演算法的交配及突變直到達到最大演化代數,最後將具有最佳適應值的個體輸出;在執行該資源控制執行緒時,係先設定連線參數並建立連線架構,藉以找出目前與該主控電腦連線的各該子叢集電腦,接著對各該子叢集電腦建立一該連線溝通執行緒,再對各該子叢集電腦建立一該用戶端訊息,再以該連線溝通執行緒來更新對應的該用戶端訊息;在執行各該連線溝通執行緒時,係先等待其對應的子叢集電腦的螞蟻伺服器執行緒所傳來之執行結果,透過同步機制等待主執行緒記錄適應值與子叢集電腦運算效能後,再更新該用戶端訊息,並且將下一組蟻群演算法的參數傳送至該聽執行緒;在各該子叢集電腦執行該聽執行緒時,係先建立與該主控電腦之間的連 線,再啟動該螞蟻伺服器執行緒,接著通知該主控電腦準備完畢,然後進入等後命令狀態,在接獲主控電腦連線溝通執行緒傳來的蟻群演算法的參數後,透過同步機制,讓該螞蟻伺服器執行緒進行計算;在執行該螞蟻伺服器執行緒時,係先更新其對應的用戶端訊息表示目前已接到計算工作,接著設定蟻群演算法參數,進行蟻群演算法來取得最佳結果,再進行費洛蒙的更新,接著更新其對應的用戶端訊息表示目前沒有計算工作,並將最佳結果轉換為適應值,再將該適應值做為執行結果傳送至與主控電腦對應之該連線溝通執行緒。 In order to achieve the foregoing object, a parallel processing system according to the present invention which can be combined with a genetic algorithm and an ant colony algorithm to obtain an optimized result includes: a plurality of personal computers equipped with Microsoft Windows system (Windows). Defining one of the personal computers as a master computer, and defining the remaining personal computers as sub-cluster computers, the personal computers are connected to each other through a network; the main control computer has a first main program and a main thread, the first a main program is used to execute the main thread, a resource control thread, and a plurality of connection communication threads; each of the sub-cluster computers has a second main program, a listening thread, and an ant server thread. The second main program is configured to execute the listening thread and the ant server thread; wherein, when executing the main thread, establishing and starting a resource control thread, establishing an initial group and an individual, and then searching for each The sub-cluster computer corresponds to a user-side message to determine which sub-cluster computer is currently available without calculation work, and those with high computational efficiency are preferentially selected, and each individual's gene is decoded to obtain an ant. The parameters of the group algorithm, after finding the available sub-cluster computer, deliver the individual's fitness value calculation work, so that the computing work is continuously assigned to each sub-cluster computer that can be used until all the individual's fitness values have been sought Finally, the individuals with the best fitness values are recorded, and then the mating and mutation of the genetic algorithm are performed until the maximum evolution algebra is reached, and finally The individual output with the best fitness value; when executing the resource control thread, the connection parameters are first set and the connection structure is established, so as to find out the sub-cluster computers currently connected with the main control computer, and then Each of the sub-cluster computers establishes a connection communication thread, and then establishes a user-side message for each of the sub-cluster computers, and then updates the corresponding user-side message with the connection communication thread; When the thread communicates with the thread, it waits for the execution result of the ant server thread of the corresponding sub-cluster computer, and waits for the main thread to record the adaptive value and the sub-cluster computer computing performance through the synchronization mechanism, and then updates the user. Ending the message, and transmitting the parameters of the next group of ant colony algorithms to the listening thread; when each of the sub-cluster computers executes the listening thread, first establishing a connection with the host computer Line, then start the ant server thread, then notify the master computer to prepare, and then enter the after-command state, after receiving the parameters of the ant colony algorithm transmitted by the master computer connection thread, The synchronization mechanism allows the ant server thread to perform calculations; when executing the ant server thread, the system first updates its corresponding client message to indicate that it has received the calculation work, and then sets the ant colony algorithm parameters to perform the ant. The group algorithm is used to obtain the best result, and then the pheromones are updated, and then the corresponding client message is updated to indicate that there is no calculation work at present, and the best result is converted into the fitness value, and the fitness value is used as the execution result. Transfer to the connection communication thread corresponding to the host computer.

較佳地,該網路係為乙太網路。 Preferably, the network is an Ethernet network.

較佳地,在執行該主執行緒時,係取得子叢集電腦回傳的適應值,並將子叢集電腦的運算時間予以記錄並排序,以取得各該子叢集電腦的運算效率,其後在指派新的計算任務給沒有計算工作的子叢集電腦時,即優先指派給運算效率較高的子叢集電腦。 Preferably, when the main thread is executed, the adaptive value of the sub-cluster computer backhaul is obtained, and the operation time of the sub-cluster computer is recorded and sorted to obtain the operation efficiency of each sub-cluster computer, and then When assigning a new computing task to a sub-cluster computer without computational work, it is preferentially assigned to a sub-cluster computer with higher computational efficiency.

較佳地,在執行該主執行緒時,在每一演化世代記錄具有最佳適應值的個體後,即檢查目前所有連線的子叢集電腦中具有計算工作者,變更其對應之用戶端訊息為中斷運算,並傳送至各該子叢集電腦的聽執行緒,之後才進行後續的基因解碼及其後續動作;該聽執行緒在接收到中斷運算的用戶端訊息後,即強制結束該螞蟻伺服器執行緒,再重新啟動新的螞蟻伺服器執行緒。 Preferably, when the main thread is executed, after each evolution generation records the individual with the best fitness value, it is checked that all the connected sub-cluster computers have computing workers and change the corresponding client information. In order to interrupt the operation, and transmit to the listening thread of each sub-cluster computer, subsequent gene decoding and subsequent actions are performed; after receiving the user information of the interrupt operation, the listening thread forcibly ends the ant servo The thread is executed and the new ant server thread is restarted.

較佳地,該蟻群演算法的參數係包含初始費洛蒙濃 度、費洛蒙濃度的偏好程度α、啟發函數的偏好程度β、隨機選擇門檻值Q 0 、費洛蒙區域更新蒸發率、及費洛蒙全域更新蒸發率。 Preferably, the parameters of the ant colony algorithm include initial pheromone concentration, preference degree of pheromone concentration α, degree of preference β of the heuristic function, random selection threshold Q 0 , pheromone region renewal evaporation rate, And the pheromones globally update the evaporation rate.

為了詳細說明本發明之構造及特點所在,茲舉以下之較佳實施例並配合圖式說明如後,其中:如第一圖至第四圖所示,本發明一較佳實施例所提供之一種可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統10,主要由複數個人電腦11所組成,其中:該等個人電腦11中安裝有微軟視窗系統(Windows),定義其中一個人電腦11為一主控電腦12,以及定義其餘的個人電腦11為子叢集電腦22,該些個人電腦11係透過網路99彼此連接。於本實施例中,該網路99係為乙太網路。 In order to explain the structure and features of the present invention in detail, the following description of the preferred embodiments and the accompanying drawings, wherein: FIG. A parallel processing system 10 capable of obtaining an optimized result by combining a genetic algorithm and an ant colony algorithm is mainly composed of a plurality of personal computers 11 in which: the personal computer 11 is equipped with a Microsoft Windows system (Windows). One of the personal computers 11 is defined as a master computer 12, and the remaining personal computers 11 are defined as sub-cluster computers 22, which are connected to each other via the network 99. In this embodiment, the network 99 is an Ethernet network.

該主控電腦12具有一第一主程式121以及一主執行緒123,該第一主程式121用以執行該主執行緒123、一資源控制執行緒125以及複數連線溝通執行緒127。 The main control computer 12 has a first main program 121 and a main thread 123. The first main program 121 is configured to execute the main thread 123, a resource control thread 125, and a plurality of connection communication threads 127.

各該子叢集電腦22,具有一第二主程式221、一聽執行緒223以及一螞蟻伺服器執行緒225,該第二主程式221用以執行該聽執行緒223以及該螞蟻伺服器執行緒225。 Each of the sub-cluster computers 22 has a second main program 221, an listening thread 223, and an ant server thread 225. The second main program 221 is configured to execute the listening thread 223 and the ant server thread. 225.

其中,在執行該主執行緒123時,係建立及啟動一該資源控制執行緒125,以及建立初始族群及個體,接著尋 找各該子叢集電腦22所對應的一用戶端訊息來判斷哪個子叢集電腦22是目前沒有計算工作而可使用的,且計算效率高者係優先被選取,並對各該個體的基因予以解碼而求得蟻群演算法的參數,找到可使用的子叢集電腦22後即對其交付一該個體的適應值計算工作,如此不斷分配計算工作給可使用的各該子叢集電腦22直到所有個體的適應值均已求出,最後記錄具有最佳適應值的個體,之後再進行遺傳演算法的交配及突變直到達到最大演化代數,最後將具有最佳適應值的個體輸出。於本實施例中,在執行該主執行緒123時,係取得子叢集電腦22回傳的適應值,並將子叢集電腦22的運算時間予以記錄並排序,以取得各該子叢集電腦22的運算效率,其後在指派新的計算任務給沒有計算工作的子叢集電腦22時,即依據前述之排序來優先指派給運算效率較高的子叢集電腦22。 Wherein, when the main thread 123 is executed, a resource control thread 125 is established and started, and an initial group and an individual are established, and then the search is performed. Looking up a user-end message corresponding to each sub-cluster computer 22 to determine which sub-cluster computer 22 is currently usable without calculation work, and those with high computational efficiency are preferentially selected, and the genes of each individual are decoded. And obtaining the parameters of the ant colony algorithm, finding the usable sub-cluster computer 22, then delivering an individual's fitness value calculation work, so that the computing work is continuously assigned to each sub-cluster computer 22 that can be used until all the individuals The fitness values have been obtained, and finally the individuals with the best fitness values are recorded, and then the mating and mutation of the genetic algorithm are performed until the maximum evolution algebra is reached, and finally the individual with the best fitness value is output. In this embodiment, when the main thread 123 is executed, the adaptive values returned by the sub-cluster computer 22 are obtained, and the operation time of the sub-cluster computer 22 is recorded and sorted to obtain the sub-cluster computer 22 The computational efficiency is then preferentially assigned to the sub-cluster computer 22, which is more computationally efficient, when assigning a new computational task to the sub-cluster computer 22 without computational work, i.e., in accordance with the foregoing ordering.

在執行該資源控制執行緒125時,係先設定連線參數並建立連線架構,藉以找出目前與該主控電腦12連線的各該子叢集電腦22,接著對各該子叢集電腦22建立一該連線溝通執行緒127,再對各該子叢集電腦22建立一該用戶端訊息,再以該連線溝通執行緒127來更新對應的該用戶端訊息。 When the resource control thread 125 is executed, the connection parameters are first set and the connection architecture is established, so as to find out the sub-cluster computers 22 currently connected to the main control computer 12, and then to the sub-cluster computers 22 A connection communication thread 127 is established, and the user terminal information is established for each of the sub-cluster computers 22, and the corresponding communication terminal 127 is used to update the corresponding client information.

在執行各該連線溝通執行緒127時,如第四圖所示之連接關係,係先等待其對應的子叢集電腦22的螞蟻伺服器執行緒225所傳來之執行結果,透過同步機制等待主執行緒123記錄適應值與子叢集電腦22的運算效能後,再更新 該用戶端訊息,並且將下一組蟻群演算法的參數傳送至該聽執行緒223。 When the connection communication thread 127 is executed, the connection relationship shown in the fourth figure waits for the execution result transmitted by the ant server thread 225 of the corresponding sub-cluster computer 22, and waits through the synchronization mechanism. The main thread 123 records the fitness value and the performance of the sub-cluster computer 22, and then updates The client message and the parameters of the next set of ant colony algorithms are transmitted to the listening thread 223.

在各該子叢集電腦22執行該聽執行緒223時,係先建立與該主控電腦12之間的連線,再啟動該螞蟻伺服器執行緒225,接著通知該主控電腦12準備完畢,然後進入等後命令狀態,在接獲主控電腦12對應之連線溝通執行緒127傳來的蟻群演算法的參數後,透過同步機制,讓該螞蟻伺服器執行緒225進行計算。 When the sub-cluster computer 22 executes the listening thread 223, the connection with the main control computer 12 is first established, the ant server thread 225 is restarted, and then the main control computer 12 is notified that the preparation is completed. Then, after entering the post-command state, after receiving the parameters of the ant colony algorithm transmitted from the thread communication thread 127 corresponding to the main control computer 12, the ant server thread 225 performs the calculation through the synchronization mechanism.

在執行該螞蟻伺服器執行緒225時,係先更新其對應的用戶端訊息表示目前已接到計算工作,接著設定蟻群演算法的參數,進行蟻群演算法來取得最佳結果,再進行費洛蒙的更新,接著更新其對應的用戶端訊息表示目前沒有計算工作,並將最佳結果轉換為適應值,再將該適應值做為執行結果傳送至與主控電腦12對應之該連線溝通執行緒127。其中,該蟻群演算法的參數係包含初始費洛蒙濃度、費洛蒙濃度的偏好程度α、啟發函數的偏好程度β、隨機選擇門檻值Q 0 、費洛蒙區域更新蒸發率、及費洛蒙全域更新蒸發率。 When the ant server thread 225 is executed, the corresponding client message is updated to indicate that the computing work has been received, and then the parameters of the ant colony algorithm are set, and the ant colony algorithm is performed to obtain the best result, and then The pheromone update, and then update its corresponding client message indicates that there is currently no calculation work, and the best result is converted into an adaptation value, and the adaptation value is transmitted as an execution result to the connection corresponding to the main control computer 12. Line communication thread 127. The parameters of the ant colony algorithm include initial pheromone concentration, preference degree of pheromone concentration α, preference degree of heuristic function β, random selection threshold Q 0 , pheromones region renewal evaporation rate, and fee Lomon's global update evaporation rate.

須補充說明的是,於本實施例中,上述在執行該主執行緒123時,在每個演化世代記錄具有最佳適應值的個體後,可先行檢查目前所有連線的子叢集電腦22中具有計算工作者,變更其對應之用戶端訊息為中斷運算,並傳送至各該子叢集電腦22的聽執行緒223,之後才進行後續的遺傳演算法及其後續動作;該聽執行緒223在接收到中斷運 算的用戶端訊息後,即強制結束該螞蟻伺服器執行緒225,再重新啟動新的螞蟻伺服器執行緒225。藉此,可在每個演化世代找到最佳適應值後,即強制結束所有螞蟻伺服器執行緒225,進而使所有的子叢集電腦22均停止運算,以避免計算資源不必要的浪費。而,這個強制結束各個子叢集電腦22的運算工作的動作,並非本案的必要技術特徵,亦即,即使未設置這個強制結束技術而其他技術特徵與本案相同者,亦應為本案之專利範圍所涵蓋。 It should be noted that, in the embodiment, when the main thread 123 is executed, after each evolution generation records the individual with the best fitness value, the current sub-cluster computer 22 of all connections may be checked first. The computing worker changes the corresponding client message to the interrupt operation and transmits it to the listening thread 223 of each of the sub-cluster computers 22, after which the subsequent genetic algorithm and its subsequent actions are performed; the listening thread 223 is Received interrupted shipment After the client message is calculated, the ant server thread 225 is forcibly terminated, and the new ant server thread 225 is restarted. In this way, after finding the best fitness value for each evolution generation, all ant server threads 225 are forcibly terminated, so that all the sub-cluster computers 22 stop computing to avoid unnecessary waste of computing resources. However, this action of forcibly ending the calculation work of each sub-cluster computer 22 is not a necessary technical feature of the present case, that is, even if the compulsory termination technique is not provided and other technical features are the same as the case, the patent scope of the case should be Covered.

接下來說明本發明之操作狀態。 Next, the operational state of the present invention will be described.

請參閱第一圖至第四圖,假設使用者想要找出某個車輛途程問題的最佳結果,係先開啟該主控電腦12以及該等子叢集電腦22,該主控電腦12執行該第一主程式121,以及該等子叢集電腦22執行該第二主程式。 Referring to the first to fourth figures, assuming that the user wants to find the best result of a certain vehicle routing problem, the main control computer 12 and the sub-cluster computers 22 are first turned on, and the main control computer 12 executes the The first main program 121, and the sub-clusters computer 22 execute the second main program.

在該主控電腦12執行該第一主程式121後,即進而執行該主執行緒123,藉此即建立及啟動一該資源控制執行緒125,並且對該車輛途程問題的相關資料建立初始群組以及個體,接著就藉由資源鎖定與網路連線的關係來判斷有哪個子叢集電腦22是目前沒有計算工作的,並對各該個體的基因予以解碼而求得蟻群演算法的參數,找到某個子叢集電腦22沒有計算工作時,就把某個個體的適應值計算工作連同蟻群演算法的參數予以交付,如此不斷的分配各個個體的適應值計算工作至各該子叢集電腦22,而由各該子叢集電腦22來完成計算的工作,直到所有個體的適應值均已求出。 After the main control computer 12 executes the first main program 121, the main thread 123 is further executed, thereby establishing and starting a resource control thread 125, and establishing an initial group of related data of the vehicle path problem. The group and the individual, then by the relationship between the resource lock and the network connection, determine which sub-cluster computer 22 is currently not computing, and decode the genes of the individual to obtain the parameters of the ant colony algorithm. When a certain sub-cluster computer 22 is found to have no calculation work, the calculation of the fitness value of an individual is performed together with the parameters of the ant colony algorithm, so that the adaptive value calculation work of each individual is continuously assigned to each sub-cluster computer 22 The calculation work is completed by each of the sub-cluster computers 22 until the fitness values of all the individuals have been found.

之後,再進行遺傳演算法的交配及突變直到達到最大演化代數,最後即將具有最佳適應值的個體輸出,而得到使用者所欲求得之車輛途程問題的最佳結果。 After that, the mating and mutation of the genetic algorithm is performed until the maximum evolution algebra is reached, and finally the individual with the best fitness value is output, and the best result of the vehicle's desired problem is obtained.

至於執行該資源控制執行緒125、該等連線溝通執行緒127、該聽執行緒223以及該螞蟻伺服器執行緒225之動作,由於與前述之說明相類同,不再於此重覆。 The operation of the resource control thread 125, the connection communication thread 127, the listening thread 223, and the ant server thread 225 are similar to the above description, and are not repeated here.

藉此,本發明可使用一般的Windows系統的個人電腦,而以其中一台個人電腦執行該第一主程式121,而其餘個人電腦則執行該第二主程式221(這些電腦的使用者仍可多工執行其它程式,並不會受到執行該第二主程式221的影響),即可形成本發明之系統,無須使用Unix/Linux系統的架構,也不需使用叢集式電腦。不僅成本低廉,而且使用方便。 Accordingly, the present invention can use a personal computer of a Windows system, and one of the personal computers executes the first main program 121, and the remaining personal computers execute the second main program 221 (the users of these computers can still Multiplexing execution of other programs without being affected by execution of the second main program 221 can form the system of the present invention without the use of a Unix/Linux system architecture or a cluster computer. Not only is the cost low, but also easy to use.

由上可知,本發明所可達成之功效在於:可使用一般Windows作業系統的個人電腦來架構平行處理之叢集系統,並以此系統結合遺傳演算法與蟻群演算法來求得最佳化結果。 It can be seen from the above that the achievable effect of the present invention is that a parallel system of parallel processing can be constructed by using a personal computer of a general Windows operating system, and the system is combined with a genetic algorithm and an ant colony algorithm to obtain an optimized result. .

10‧‧‧可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統 10‧‧‧Parallel processing system that combines genetic algorithm and ant colony algorithm to obtain optimal results

11‧‧‧個人電腦 11‧‧‧Personal Computer

12‧‧‧主控電腦 12‧‧‧Master computer

121‧‧‧第一主程式 121‧‧‧First main program

123‧‧‧主執行緒 123‧‧‧Master Thread

125‧‧‧資源控制執行緒 125‧‧‧Resource Control Thread

127‧‧‧連線溝通執行緒 127‧‧‧Connected communication thread

22‧‧‧子叢集電腦 22‧‧‧Sub-cluster computer

221‧‧‧第二主程式 221‧‧‧Second main program

223‧‧‧聽執行緒 223‧‧‧ Listening to the thread

225‧‧‧螞蟻伺服器執行緒 225‧‧‧ Ant Server Thread

99‧‧‧網路 99‧‧‧Network

第一圖係本發明一較佳實施例之架構示意圖。 The first figure is a schematic diagram of the architecture of a preferred embodiment of the present invention.

第二圖係本發明一較佳實施例之局部架構示意圖,顯示主控電腦之架構。 The second figure is a partial schematic diagram of a preferred embodiment of the present invention, showing the architecture of the host computer.

第三圖係本發明一較佳實施例之局部架構示意圖,顯示子叢集電腦之架構。 The third figure is a partial schematic diagram of a preferred embodiment of the present invention, showing the architecture of a sub-cluster computer.

第四圖係本發明一較佳實施例之細部架構示意圖,顯示在執行連線溝通執行緒時,主控電腦與子叢集電腦之間的互動狀況。 The fourth figure is a detailed schematic diagram of a preferred embodiment of the present invention, showing the interaction between the host computer and the sub-cluster computer when the connection communication thread is executed.

10‧‧‧可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統 10‧‧‧Parallel processing system that combines genetic algorithm and ant colony algorithm to obtain optimal results

12‧‧‧主控電腦 12‧‧‧Master computer

121‧‧‧第一主程式 121‧‧‧First main program

123‧‧‧主執行緒 123‧‧‧Master Thread

125‧‧‧資源控制執行緒 125‧‧‧Resource Control Thread

127‧‧‧連線溝通執行緒 127‧‧‧Connected communication thread

22‧‧‧子叢集電腦 22‧‧‧Sub-cluster computer

221‧‧‧第二主程式 221‧‧‧Second main program

223‧‧‧聽執行緒 223‧‧‧ Listening to the thread

225‧‧‧螞蟻伺服器執行緒 225‧‧‧ Ant Server Thread

Claims (5)

一種可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,包含有:複數安裝有微軟視窗系統(Windows)的個人電腦,定義其中一個人電腦為一主控電腦,以及定義其餘的個人電腦為子叢集電腦,該些個人電腦係透過網路彼此連接;該主控電腦具有一第一主程式以及一主執行緒,該第一主程式用以執行該主執行緒、一資源控制執行緒以及複數連線溝通執行緒;各該子叢集電腦,具有一第二主程式、一聽執行緒以及一螞蟻伺服器執行緒,該第二主程式用以執行該聽執行緒以及該螞蟻伺服器執行緒;其中,在執行該主執行緒時,係建立及啟動一該資源控制執行緒,以及建立初始族群及個體,接著尋找各該子叢集電腦所對應的一用戶端訊息來判斷哪個子叢集電腦是目前沒有計算工作而可使用的,且計算效率高者係優先被選取,並對各該個體的基因予以解碼而求得蟻群演算法的參數,找到可使用的子叢集電腦後即對其交付一該個體的適應值計算工作,如此不斷分配計算工作給可使用的各該子叢集電腦直到所有個體的適應值均已求出,最後記錄具有最佳適應值的個體,之後再進行遺傳演算法的交配及突變直到達到最大演化代數,最後將具有最佳適應值的個體輸出;在執行該資源控制執行緒時,係先設定連線參數並建 立連線架構,藉以找出目前與該主控電腦連線的各該子叢集電腦,接著對各該子叢集電腦建立一該連線溝通執行緒,再對各該子叢集電腦建立一該用戶端訊息,再以該連線溝通執行緒來更新對應的該用戶端訊息;在執行各該連線溝通執行緒時,係先等待其對應的子叢集電腦的螞蟻伺服器執行緒所傳來之執行結果,透過同步機制等待主執行緒記錄適應值與子叢集電腦運算效能後,再更新該用戶端訊息,並且將下一組蟻群演算法的參數傳送至該聽執行緒;在各該子叢集電腦執行該聽執行緒時,係先建立與該主控電腦之間的連線,再啟動該螞蟻伺服器執行緒,接著通知該主控電腦準備完畢,然後進入等後命令狀態,在接獲主控電腦連線溝通執行緒傳來的蟻群演算法的參數螞蟻參數後,透過同步機制,讓該螞蟻伺服器執行緒進行計算;在執行該螞蟻伺服器執行緒時,係先更新其對應的用戶端訊息表示目前已接到計算工作,接著設定蟻群演算法的參數,進行蟻群演算法來取得最佳結果,再進行費洛蒙的更新,接著更新其對應的用戶端訊息表示目前沒有計算工作,並將最佳結果轉換為適應值,再將該適應值做為執行結果傳送至與主控電腦對應之該連線溝通執行緒。 A parallel processing system capable of combining the genetic algorithm and the ant colony algorithm to obtain an optimized result, comprising: a plurality of personal computers installed with Microsoft Windows system (Windows), defining one of the computers as a master computer, and Defining the remaining personal computers as sub-cluster computers, the personal computers are connected to each other through a network; the main control computer has a first main program and a main thread, and the first main program is used to execute the main thread, a resource control thread and a plurality of connection communication threads; each of the sub-cluster computers has a second main program, a listening thread, and an ant server thread, and the second main program is used to execute the listening thread And the ant server thread; wherein, when executing the main thread, establishing and starting a resource control thread, establishing an initial group and an individual, and then searching for a client message corresponding to each of the child cluster computers To determine which sub-cluster computer is currently available without calculation work, and those with high computational efficiency are selected first, and the base of each individual is Decoding to obtain the parameters of the ant colony algorithm, and after finding the available sub-cluster computer, it delivers an individual's fitness value calculation work, so that the computing work is continuously assigned to each sub-cluster computer that can be used until all the individuals The fitness values have been obtained, and finally the individuals with the best fitness value are recorded, and then the mating and mutation of the genetic algorithm are performed until the maximum evolution algebra is reached, and finally the individual with the best fitness value is output; When the thread is executed, the connection parameters are first set and built. a connection structure to find out the sub-cluster computers currently connected to the main control computer, and then establish a connection communication thread for each sub-cluster computer, and then establish a user for each sub-cluster computer The end message, and then the connection communication thread is used to update the corresponding client message; when executing the connection communication thread, the system first waits for the corresponding ant server computer ant server thread to send it. Execution result, after waiting for the main thread to record the fitness value and the sub-cluster computer computing performance through the synchronization mechanism, update the user terminal message, and transmit the parameters of the next group of ant colony algorithm to the listening thread; When the cluster computer executes the listening thread, it first establishes a connection with the main control computer, then starts the ant server thread, then notifies the main control computer that preparation is completed, and then enters the post-command state, and is connected. After the main control computer connects the ant parameter of the ant colony algorithm transmitted by the thread, the ant server executes the calculation through the synchronization mechanism; the ant server is executed When the thread is online, the corresponding user-side message is updated to indicate that it has received the calculation work, and then the parameters of the ant colony algorithm are set, the ant colony algorithm is performed to obtain the best result, and then the pheromone update is performed, and then the update is performed. The corresponding client message indicates that there is no calculation work at present, and the best result is converted into an adaptation value, and the adaptation value is transmitted as an execution result to the connection communication thread corresponding to the main control computer. 依據申請專利範圍第1項所述之可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,其中:該網路係為乙太網路。 According to the patent application scope, the parallel processing system capable of obtaining the optimization result can be obtained by combining the genetic algorithm and the ant colony algorithm, wherein the network is an Ethernet network. 依據申請專利範圍第1項所述之可結合遺傳演算法 與蟻群演算法來求得最佳化結果之平行處理系統,其中:在執行該主執行緒時,在每一演化世代記錄具有最佳適應值的個體後,即檢查目前所有連線的子叢集電腦中具有計算工作者,變更其對應之用戶端訊息為中斷運算,並傳送至各該子叢集電腦的聽執行緒,之後才進行後續的基因解碼及其後續動作;該聽執行緒在接收到中斷運算的用戶端訊息後,即強制結束該螞蟻伺服器執行緒,再重新啟動新的螞蟻伺服器執行緒。 Combinable genetic algorithm according to item 1 of the patent application scope A parallel processing system with an ant colony algorithm to obtain an optimized result, wherein: when the main thread is executed, after each evolution generation records the individual with the best fitness value, the current connected line is checked. The cluster computer has a computing worker, and changes its corresponding client message to an interrupt operation, and transmits it to the listening thread of each sub-cluster computer, and then performs subsequent gene decoding and subsequent actions; the listening thread is receiving After interrupting the client message of the operation, the ant server thread is forcibly terminated, and the new ant server thread is restarted. 依據申請專利範圍第1項所述之可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,其中:在執行該主執行緒時,係取得子叢集電腦回傳的適應值,並將子叢集電腦的運算時間予以記錄並排序,以取得各該子叢集電腦的運算效率,其後在指派新的計算任務給沒有計算工作的子叢集電腦時,即優先指派給運算效率較高的子叢集電腦。 According to the patent application scope, the parallel processing system capable of obtaining the optimization result can be obtained by combining the genetic algorithm and the ant colony algorithm, wherein: when the main thread is executed, the sub-cluster computer is returned. Adapting the values, and recording and sorting the operation time of the sub-cluster computer to obtain the computational efficiency of each sub-cluster computer, and then assigning a new computing task to the sub-cluster computer without calculation work, that is, assigning the operation preferentially A more efficient sub-cluster computer. 依據申請專利範圍第1項所述之可結合遺傳演算法與蟻群演算法來求得最佳化結果之平行處理系統,其中:該蟻群演算法的參數係包含初始費洛蒙濃度、費洛蒙濃度的偏好程度α、啟發函數的偏好程度β、隨機選擇門檻值Q 0 、費洛蒙區域更新蒸發率、及費洛蒙全域更新蒸發率。 A parallel processing system capable of obtaining an optimized result according to the genetic algorithm and the ant colony algorithm according to claim 1 of the patent application scope, wherein: the parameter of the ant colony algorithm includes an initial pheromone concentration and a fee The degree of preference of Lomon concentration, the degree of preference β of the heuristic function, the threshold of random selection Q 0 , the rate of renewal of the pheromone region, and the rate of pheromones renewal.
TW101119003A 2012-05-28 2012-05-28 Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result TW201349119A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101119003A TW201349119A (en) 2012-05-28 2012-05-28 Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101119003A TW201349119A (en) 2012-05-28 2012-05-28 Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result

Publications (2)

Publication Number Publication Date
TW201349119A true TW201349119A (en) 2013-12-01
TWI452519B TWI452519B (en) 2014-09-11

Family

ID=50157444

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101119003A TW201349119A (en) 2012-05-28 2012-05-28 Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result

Country Status (1)

Country Link
TW (1) TW201349119A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113029037A (en) * 2019-12-09 2021-06-25 大族激光科技产业集团股份有限公司 Method and device for measuring contour of object, computer equipment and readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6014214A (en) * 1997-08-21 2000-01-11 Li; Ming-Chiang High speed inspection of a sample using coherence processing of scattered superbroad radiation
US8001338B2 (en) * 2007-08-21 2011-08-16 Microsoft Corporation Multi-level DRAM controller to manage access to DRAM
TWI468015B (en) * 2007-10-26 2015-01-01 Ind Tech Res Inst Apparatus and method for parallely processing video decoding

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113029037A (en) * 2019-12-09 2021-06-25 大族激光科技产业集团股份有限公司 Method and device for measuring contour of object, computer equipment and readable storage medium

Also Published As

Publication number Publication date
TWI452519B (en) 2014-09-11

Similar Documents

Publication Publication Date Title
Tan et al. Coupling task progress for mapreduce resource-aware scheduling
Kliazovich et al. CA-DAG: Modeling communication-aware applications for scheduling in cloud computing
Wang et al. Optimizing load balancing and data-locality with data-aware scheduling
CN110209494B (en) Big data-oriented distributed task scheduling method and Hadoop cluster
CN106557363A (en) A kind of system and method for big data task scheduling
CN109284184A (en) A kind of building method of the distributed machines learning platform based on containerization technique
Wang et al. Towards green service composition approach in the cloud
Kailasam et al. Extending mapreduce across clouds with bstream
CN115840631B (en) RAFT-based high-availability distributed task scheduling method and equipment
WO2021143590A1 (en) Distributed container image construction scheduling system and method
KR20210083222A (en) Method, apparatus, device and storage medium for processing voice data
CN102999317A (en) Multi-tenant oriented elastic multi-process service processing method
Fattah et al. Mixed-criticality run-time task mapping for noc-based many-core systems
Malik et al. Optimistic synchronization of parallel simulations in cloud computing environments
CN112527471B (en) Task processing method and device and storage medium
Binder et al. Green computing: Energy consumption optimized service hosting
CN114201294A (en) Task processing method, device and system, electronic equipment and storage medium
Kanwal et al. Head node selection algorithm in cloud computing data center
TW201349119A (en) Parallel processing system for combining genetic algorithms with the ant colony optimization algorithm to obtain the optimal result
Wu et al. Rosella: A self-driving distributed scheduler for heterogeneous clusters
Silberstein Building an online domain-specific computing service over non-dedicated grid and cloud resources: The superlink-online experience
CN112948088A (en) Cloud workflow intelligent management and scheduling system in cloud computing platform
CN110750362A (en) Method and apparatus for analyzing biological information, and storage medium
CN115277692B (en) Automatic operation and maintenance method, device and system for edge network computing terminal equipment
Xiao et al. FPGA-based edge computing: Task modeling for cloud-edge collaboration