CN115150315B - ATM (automatic teller machine) site selection method and device based on ant colony algorithm - Google Patents
ATM (automatic teller machine) site selection method and device based on ant colony algorithm Download PDFInfo
- Publication number
- CN115150315B CN115150315B CN202210767054.5A CN202210767054A CN115150315B CN 115150315 B CN115150315 B CN 115150315B CN 202210767054 A CN202210767054 A CN 202210767054A CN 115150315 B CN115150315 B CN 115150315B
- Authority
- CN
- China
- Prior art keywords
- vertex
- initial
- pheromone
- obtaining
- optimal
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 45
- 238000010187 selection method Methods 0.000 title claims abstract description 11
- 239000003016 pheromone Substances 0.000 claims abstract description 182
- 238000000034 method Methods 0.000 claims abstract description 52
- 241000257303 Hymenoptera Species 0.000 claims abstract description 15
- 238000010586 diagram Methods 0.000 claims description 27
- 230000007704 transition Effects 0.000 claims description 27
- 238000004590 computer program Methods 0.000 claims description 23
- 230000008569 process Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
- H04L45/126—Shortest path evaluation minimising geographical or physical path length
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/14—Routing performance; Theoretical aspects
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/40—Wormhole routing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides an ATM (automatic teller machine) site selection method and device based on an ant colony algorithm, and particularly relates to the field of finance, wherein the method comprises the following steps: obtaining the pheromone value of each vertex of the weighted graph according to the preset ant number and the shortest loop length; repeating the step of solving the middle optimal vertex set until the execution times are equal to the preset iteration times, wherein the step comprises the following steps: repeatedly executing the steps of selecting an initial vertex, and obtaining an initial optimal vertex set according to initial vertex information and a pheromone value until the execution times are equal to the number of ants; selecting a middle optimal vertex set from a plurality of initial optimal vertex sets, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal vertex set and the pheromone value; and obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets, so as to perform ATM addressing according to the final optimal vertex set. The invention can improve the accuracy and speed of the ATM site selection, thereby improving the efficiency of the ATM site selection.
Description
Technical Field
The invention relates to the technical field of facility site selection, in particular to the financial field, and particularly relates to an ATM site selection method and device based on an ant colony algorithm.
Background
ATM machines are commonly used for financial processing such as deposit, withdrawal, and transfer, and thus there is a high demand for ATM machines. The location of the ATM is particularly important, if the location of the ATM is accurate, the ATM can be conveniently reached by as many users as possible, so that the ATM can serve as many users as possible, and the experience of users is improved. In the prior art, a plurality of addresses are often selected from the alternative addresses by a manual mode to serve as the addresses of the ATM, so that the ATM is selected, however, the manual mode is adopted to select the addresses of the ATM, and the selection accuracy of the ATM is lower due to the fact that the selection of the addresses of the ATM is dependent on experience and subjective judgment of staff, and because the selection of the addresses of the ATM is caused by the dependence on manual labor, more time is required, the selection speed is lower, and the selection efficiency of the ATM is required to be improved.
Disclosure of Invention
The invention aims to provide an ATM (automatic teller machine) address selection method based on an ant colony algorithm, which aims to solve the problems that the ATM address selection accuracy is low, the speed is low and the efficiency is to be improved. Another object of the present invention is to provide an ATM addressing device based on the ant colony algorithm. It is a further object of the invention to provide a computer device. It is a further object of the invention to provide a readable medium. It is a further object of the invention to provide a computer program product.
To achieve the above object, an aspect of the present invention discloses an ATM machine location method based on an ant colony algorithm, the method comprising:
obtaining the pheromone value of each vertex of the weighting map according to the preset ant number of an ant colony algorithm and the shortest loop length obtained based on the preset ATM address weighting map;
repeating the step of solving the middle optimal vertex set until the execution times are equal to the preset iteration times of the ant colony algorithm, wherein the step of solving the middle optimal vertex set comprises the following steps:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value;
and obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets, so as to perform ATM site selection according to the final optimal vertex set.
Optionally, the step of obtaining the initial optimal vertex set according to the initial vertex information of the initial vertex and the pheromone value includes:
deleting the edge connected with the initial vertex in the weighted graph;
obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertex in the weighted graph;
obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices;
obtaining a target vertex according to the heuristic information and the pheromone value, and taking the target vertex as the next initial vertex in the weighted graph;
repeatedly deleting the edges connected with the initial vertexes in the weighted graph, and obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertexes and the non-edge vertexes in the weighted graph; obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices; obtaining a next target vertex according to the heuristic information and the pheromone value, and taking the target vertex as a next initial vertex in the weighted graph until no edge exists in the weighted graph;
And obtaining an initial optimal vertex set according to the initial vertex of the weighted graph and all the target vertices.
Optionally, the obtaining the pheromone value of each vertex of the weighting chart according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting chart includes:
dividing the ant number by the shortest loop length to obtain the pheromone value.
Optionally, the method further comprises:
obtaining the side lengths of all sides in the weighting diagram according to the ATM address weighting diagram before obtaining the pheromone value of each vertex of the weighting diagram according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting diagram;
and obtaining the shortest loop length according to the side length and all vertexes in the ATM address weighting graph.
Optionally, the method further comprises:
generating an ATM address weighting map according to a preset alternative ATM address before obtaining the pheromone value of each vertex of the weighting map according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting map.
Optionally, the updating the pheromone value of each vertex of the weighted graph according to the intermediate optimal total weight and the pheromone value includes:
Multiplying a preset pheromone volatilization coefficient by the pheromone value to obtain a first pheromone score;
multiplying the preset pheromone residual coefficient by the middle optimal total weight to obtain a second pheromone score;
and obtaining a new pheromone score according to the first pheromone score and the second pheromone score, and taking the new pheromone score as the pheromone value.
Optionally, the obtaining a new pheromone score according to the first pheromone score and the second pheromone score includes:
and adding the first pheromone score and the second pheromone score to obtain the new pheromone score.
Optionally, the obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices includes:
dividing other vertex degrees of each other vertex by other vertex weights to obtain heuristic information of the other vertices.
Optionally, the obtaining a target vertex according to the heuristic information and the pheromone value includes:
obtaining the state transition probability of each other vertex according to the heuristic information and the pheromone value;
and selecting the target vertex from the other vertices according to the state transition probability.
To achieve the above object, another aspect of the present invention discloses an ATM machine addressing device based on an ant colony algorithm, the device comprising:
the initial pheromone determining module is used for obtaining the pheromone value of each vertex of the weighting chart according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting chart;
the middle optimal vertex set determining module is configured to repeatedly perform the step of solving the middle optimal vertex set until the number of times of execution is equal to a preset number of iterations, where the step of solving the middle optimal vertex set includes:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value;
And the final optimal vertex set determining module is used for obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets so as to perform ATM site selection according to the final optimal vertex set.
The invention also discloses a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, said processor implementing the method as described above when executing said program.
The invention also discloses a computer readable medium having stored thereon a computer program which when executed by a processor implements a method as described above.
The invention also discloses a computer program product comprising a computer program which, when executed by a processor, implements a method as described above.
According to the ATM addressing method and device based on the ant colony algorithm, the pheromone value of each vertex of the weighting map is obtained according to the preset ant number of the ant colony algorithm and the shortest loop length obtained based on the preset ATM address weighting map, and the pheromone value of each vertex in the weighting map can be determined based on the geographic condition of the actual ATM alternative address, so that the accuracy of the pheromone value can be improved, and the accuracy of the ATM addressing based on the pheromone value in the subsequent steps is indirectly improved; the steps of solving the middle optimal vertex set are repeatedly executed until the execution times are equal to the preset iteration times of the ant colony algorithm, a plurality of middle optimal vertex sets obtained by multiple times of calculation can be provided in consideration of the influence caused by errors and other accidental factors, a basis is provided for selecting the most suitable middle optimal vertex set in the subsequent steps, and the accuracy of ATM address selection depending on the middle optimal vertex set in the subsequent steps is indirectly improved; the steps of selecting an initial vertex from the weighted graph are repeatedly executed, and according to initial vertex information of the initial vertex and the pheromone value, the initial optimal vertex set is obtained until the execution times are equal to the number of ants, so that a plurality of vertex sets obtained after a plurality of ants in an ant colony algorithm access the weighted graph respectively, a basis is provided for selecting a middle optimal vertex set from the plurality of initial optimal vertex sets in the subsequent steps, and the accuracy of performing ATM address selection by relying on the initial optimal vertex set in the subsequent steps is indirectly improved; the method comprises the steps of firstly obtaining the most suitable middle vertex set from a plurality of vertex sets obtained by a plurality of ant access weighting graphs, then obtaining the most suitable final vertex set from the plurality of middle vertex sets, and improving the accuracy of the obtained final vertex set with the advantages of two-round circulation and twice screening, so that the ATM addresses corresponding to the vertexes of the obtained final vertex set have extremely high accuracy, and if the ATM addresses are provided with the ATM, the ATM can serve as many users as possible, and further the experience of the users is improved; therefore, a final optimal vertex set is obtained according to the plurality of intermediate optimal vertex sets, so that ATM addressing is performed according to the final optimal vertex set, and the addressing accuracy can be further improved. In addition, the ATM site selection method and device based on the ant colony algorithm can reduce the dependence on manpower, has higher degree of automation, and can further improve the site selection speed and further improve the site selection efficiency of the ATM. In summary, the ATM site selection method and device based on the ant colony algorithm can improve the accuracy and speed of ATM site selection, and further improve the efficiency of ATM site selection.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a schematic flow chart of an ATM addressing method based on an ant colony algorithm according to an embodiment of the present invention;
FIG. 2 shows an alternative schematic step of obtaining the shortest loop length in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram showing an alternative step of updating the pheromone values of the vertices of the weighting graph according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative step of obtaining a target vertex according to an embodiment of the present invention;
fig. 5 to 10 illustrate a change process of the weighting chart in a process that a single ant accesses to the vertex of the weighting chart according to the embodiment of the present invention;
fig. 11 shows a schematic block diagram of an ATM addressing device based on an ant colony algorithm according to an embodiment of the present invention;
fig. 12 shows a schematic structural diagram of a computer device suitable for use in implementing embodiments of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," … …, and the like, as used herein, do not denote a particular order or sequence, nor are they intended to be limiting of the invention, but rather are merely used to distinguish one element or operation from another in the same technical terms.
As used herein, the terms "comprising," "including," "having," "containing," and the like are intended to be inclusive and mean an inclusion, but not limited to.
As used herein, "and/or" includes any or all combinations of such things.
It should be noted that, in the technical scheme of the application, the acquisition, storage, use, processing and the like of the data all conform to the relevant regulations of national laws and regulations.
The embodiment of the invention discloses an ATM (automatic teller machine) site selection method based on an ant colony algorithm, which specifically comprises the following steps as shown in figure 1:
S101: and obtaining the pheromone value of each vertex of the weighting map according to the preset ant number of the ant colony algorithm and the shortest loop length obtained based on the preset ATM address weighting map.
S102: repeatedly executing the step of solving the middle optimal vertex set until the execution times are equal to the preset iteration times of the ant colony algorithm;
wherein, the step of solving the middle optimal vertex set comprises the following steps:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
and selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value.
S103: and obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets, so as to perform ATM site selection according to the final optimal vertex set.
Illustratively, the number of ants may be, but is not limited to, 5, 10, 15, 20, etc. It should be noted that the number of ants can be determined by those skilled in the art according to practical situations, and the above description is only for example, and the present invention is not limited thereto.
Illustratively, the number of iterations may be, but is not limited to, 1000, 900, 1100, 1500, 1200, etc. It should be noted that the number of iterations may be determined by those skilled in the art according to practical situations, and the above description is only for example, and not limiting.
The selecting the intermediate optimal vertex set from the plurality of initial optimal vertex sets may be, but not limited to, calculating the sum of weights of all vertices in the plurality of initial optimal vertex sets, and selecting an initial optimal vertex set corresponding to the sum of minimum weights as the intermediate optimal vertex set. The points in the weighted graph are provided with weights, and the vertexes in the initial optimal vertex sets are vertexes of the weighted graph, so that the weights of all vertexes in the initial optimal vertex sets are known, and the sum of the weights of all vertexes of the initial optimal vertex set can be directly calculated.
For example, the obtaining the intermediate optimal total weight of the intermediate optimal vertex set according to the intermediate optimal vertex set is a conventional technical means in the art, and will not be described herein.
The obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets may be, but not limited to, calculating the sum of weights of all vertices in the plurality of intermediate optimal vertex sets, and selecting an intermediate optimal vertex set corresponding to the sum of the minimum weights as the final optimal vertex set. The points in the weighted graph are provided with weights, and the vertexes in the plurality of middle optimal vertex sets are vertexes of the weighted graph, so that the weights of all vertexes in the plurality of middle optimal vertex sets are known, and the sum of the weights of all vertexes of one middle optimal vertex set can be directly calculated.
For example, since each weighted graph vertex in the final optimal vertex set corresponds to one of the most suitable ATM addresses in the plurality of ATM alternative addresses, ATM addressing according to the final optimal vertex set can be directly implemented by the correspondence between each weighted graph vertex in the final optimal vertex set and the actual ATM address.
According to the ATM addressing method and device based on the ant colony algorithm, the pheromone value of each vertex of the weighting map is obtained according to the preset ant number of the ant colony algorithm and the shortest loop length obtained based on the preset ATM address weighting map, and the pheromone value of each vertex in the weighting map can be determined based on the geographic condition of the actual ATM alternative address, so that the accuracy of the pheromone value can be improved, and the accuracy of the ATM addressing based on the pheromone value in the subsequent steps is indirectly improved; the steps of solving the middle optimal vertex set are repeatedly executed until the execution times are equal to the preset iteration times of the ant colony algorithm, a plurality of middle optimal vertex sets obtained by multiple times of calculation can be provided in consideration of the influence caused by errors and other accidental factors, a basis is provided for selecting the most suitable middle optimal vertex set in the subsequent steps, and the accuracy of ATM address selection depending on the middle optimal vertex set in the subsequent steps is indirectly improved; the steps of selecting an initial vertex from the weighted graph are repeatedly executed, and according to initial vertex information of the initial vertex and the pheromone value, the initial optimal vertex set is obtained until the execution times are equal to the number of ants, so that a plurality of vertex sets obtained after a plurality of ants in an ant colony algorithm access the weighted graph respectively, a basis is provided for selecting a middle optimal vertex set from the plurality of initial optimal vertex sets in the subsequent steps, and the accuracy of performing ATM address selection by relying on the initial optimal vertex set in the subsequent steps is indirectly improved; the method comprises the steps of firstly obtaining the most suitable middle vertex set from a plurality of vertex sets obtained by a plurality of ant access weighting graphs, then obtaining the most suitable final vertex set from the plurality of middle vertex sets, and improving the accuracy of the obtained final vertex set with the advantages of two-round circulation and twice screening, so that the ATM addresses corresponding to the vertexes of the obtained final vertex set have extremely high accuracy, and if the ATM addresses are provided with the ATM, the ATM can serve as many users as possible, and further the experience of the users is improved; therefore, a final optimal vertex set is obtained according to the plurality of intermediate optimal vertex sets, so that ATM addressing is performed according to the final optimal vertex set, and the addressing accuracy can be further improved. In addition, the ATM site selection method and device based on the ant colony algorithm can reduce the dependence on manpower, has higher degree of automation, and can further improve the site selection speed and further improve the site selection efficiency of the ATM. In summary, the ATM site selection method and device based on the ant colony algorithm can improve the accuracy and speed of ATM site selection, and further improve the efficiency of ATM site selection.
In an alternative embodiment, the step of obtaining the initial optimal vertex set according to the initial vertex information of the initial vertex and the pheromone value includes:
deleting the edge connected with the initial vertex in the weighted graph;
obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertex in the weighted graph;
obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices;
obtaining a target vertex according to the heuristic information and the pheromone value, and taking the target vertex as the next initial vertex in the weighted graph;
repeatedly deleting the edges connected with the initial vertexes in the weighted graph, and obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertexes and the non-edge vertexes in the weighted graph; obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices; obtaining a next target vertex according to the heuristic information and the pheromone value, and taking the target vertex as a next initial vertex in the weighted graph until no edge exists in the weighted graph;
And obtaining an initial optimal vertex set according to the initial vertex of the weighted graph and all the target vertices.
For example, the other vertex information includes the degrees and weights of other vertices, so that other vertex degrees and other vertex weights of other vertices can be obtained directly according to other vertex information of other vertices except the initial vertex in the weighted graph. Where the degree of a vertex refers to the number of edges connected to the vertex.
Illustratively, the initial optimal vertex set is obtained according to the initial vertex of the weighted graph and all the target vertices, which may be, but is not limited to, clustering the initial vertex and all the target vertices involved in the above steps to obtain the initial optimal vertex set.
The method comprises the steps of accessing the weighted graph by a single ant in an ant colony algorithm and selecting the vertex, wherein the selected target vertex is based on the degree of the vertex (corresponding to the number of roads leading to the real ATM alternative address represented by the vertex), the weight (the real ATM alternative address represented by the vertex is easier to be reached by a user if the weight is smaller) and the pheromone value (determined based on the geographic condition of the real ATM alternative address), and the parameters are closely related to the actual condition of the ATM alternative address, so that the accuracy of selecting the target vertex can be improved, the ATM alternative address corresponding to the selected target vertex is convenient for the user to reach as much as possible, the accuracy of an initial optimal vertex set can be improved, and the accuracy of ATM address selection in the subsequent steps is indirectly improved. Moreover, the steps can be automatically executed in a program, software or other modes without manual intervention, thereby indirectly improving the speed of site selection of the ATM.
In an alternative embodiment, the obtaining the pheromone value of each vertex of the weighted graph according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighted graph includes:
dividing the ant number by the shortest loop length to obtain the pheromone value.
When the selection operation of the vertexes of the weighted graph is not started, the pheromone value is the initial pheromone value, and at the moment, the pheromone values of all the vertexes are the same.
The steps are used for determining the pheromone value of the vertex of the weighted graph, and the pheromone value is an input parameter required in the ant colony algorithm. The pheromone value is obtained by dividing the ant number by the shortest loop length, and the actual ant colony movement characteristic and the geographical characteristic of the ATM alternative address according to the ant colony algorithm can be comprehensively considered, so that the accuracy of the pheromone value is improved, and the accuracy of determining the final optimal vertex set by taking the pheromone value as input in the subsequent steps is further improved.
In an alternative embodiment, as shown in fig. 2, further comprising the steps of:
s201: and obtaining the side lengths of all sides in the weighting diagram according to the ATM address weighting diagram before obtaining the pheromone value of each vertex of the weighting diagram according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting diagram.
S202: and obtaining the shortest loop length according to the side length and all vertexes in the ATM address weighting graph.
Illustratively, the information of the weighting map includes the side lengths of all sides, so that the side lengths of all sides in the weighting map can be obtained directly according to the ATM address weighting map.
The shortest loop length is obtained according to the side length and all vertexes in the ATM address weighting graph, which may be, but not limited to, obtaining connection correspondence between all vertexes and all sides in the weighting graph according to information of all vertexes, and obtaining the shortest loop length according to the side length and the connection correspondence, where the obtaining of the shortest loop length according to the side length and the connection correspondence may be implemented by, but not limited to, a traveling algorithm, a dijkstra algorithm, or the like. It should be noted that, the specific implementation manner of obtaining the shortest loop length according to the side length and all the vertices in the ATM address weighting chart may be determined by those skilled in the art according to the actual situation, and the foregoing description is merely exemplary, and the foregoing description is not limiting.
Through step S201 and step S202, the speed and accuracy of obtaining the shortest loop length can be improved, so that the speed and accuracy of obtaining the pheromone value of each vertex of the weighted graph are improved, and further the speed and accuracy of determining the final optimal vertex set by taking the pheromone value as input in the subsequent steps are indirectly improved.
In an alternative embodiment, further comprising:
generating an ATM address weighting map according to a preset alternative ATM address before obtaining the pheromone value of each vertex of the weighting map according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting map.
The method includes generating the ATM address weighting map according to preset alternative ATM addresses, presetting weights for the alternative ATM addresses, and taking the alternative ATM addresses as vertices in the ATM address weighting map, wherein edges of the weighting map can be determined according to actual road connection conditions between the alternative ATM addresses, and lengths of the edges can be determined according to actual road lengths corresponding to the edges. The weight of each vertex can be determined according to the number of residents around the corresponding alternative ATM address, the location area, the number of cells, the number of office buildings, the number of nearby bus stations or the number of subway stations, and the like, for example, the more the number of residents, the more developed the location area, the more the number of cells, the more the number of office buildings, the more the number of nearby bus stations and the more the number of subway stations, the lower the weight of the corresponding vertex is, and vice versa. The vertex weight may be determined by, but not limited to, manual investigation, or the like. The specific implementation manner of generating the ATM address weighting map according to the preset alternative ATM address may be implemented by, but not limited to, a person, a program, or software. It should be noted that, for the specific implementation manner of generating the ATM address weighting map according to the preset alternative ATM address, those skilled in the art may determine the specific implementation manner according to the actual situation, and the foregoing description is merely exemplary, and the foregoing description is not limiting.
Through the steps, the generated ATM address weighting map and the relevant geographic condition of the actual alternative ATM address are more consistent, so that the accuracy of ATM address selection based on the weighting map in the subsequent steps can be improved.
In an alternative embodiment, as shown in fig. 3, the updating the pheromone value of each vertex of the weighted graph according to the intermediate optimal total weight value and the pheromone value includes the following steps:
s301: multiplying the preset pheromone volatilization coefficient by the pheromone value to obtain a first pheromone score.
S302: multiplying the preset pheromone residual coefficient by the middle optimal total weight to obtain a second pheromone score.
S303: and obtaining a new pheromone score according to the first pheromone score and the second pheromone score, and taking the new pheromone score as the pheromone value.
Illustratively, the pheromone volatility coefficient and the pheromone residual coefficient can be determined by those skilled in the art according to practical situations, and the embodiment of the present invention is not limited thereto. However, the sum of the pheromone volatilization coefficient and the pheromone residual coefficient needs to be equal to 1.
Through the steps, the moving characteristics of the actual ant colony, the actual geographic conditions of the candidate ATM addresses and the actual geographic conditions of the selected ATM addresses corresponding to the middle optimal vertex set corresponding to the middle optimal total weight can be better comprehensively considered, and the pheromone values of the vertexes of the weighted graph are more accurately updated based on the principle of an ant colony algorithm, so that the accuracy of the whole ATM address selecting step is facilitated.
After a single ant completes the step of determining the initial optimal vertex set once, the weighting graph is refreshed once to recover the deleted edges in the original weighting graph, but the refreshing operation does not change the pheromone value of each vertex in the weighting graph. The pheromone value of each vertex is updated once only after the step of confirming the middle optimal vertex set once is completed.
In an optional embodiment, the obtaining a new pheromone score according to the first pheromone score and the second pheromone score includes:
and adding the first pheromone score and the second pheromone score to obtain the new pheromone score.
Through the steps, the moving characteristics of the actual ant colony, the actual geographic conditions of the candidate ATM addresses and the actual geographic conditions of the selected ATM addresses corresponding to the middle optimal vertex sets corresponding to the middle optimal total weights can be further and comprehensively considered, the pheromone values of the vertexes of the weighted graph are further and more accurately updated based on the principle of the ant colony algorithm, and therefore the accuracy of the whole ATM address selection step is facilitated.
In a preferred embodiment, before the new pheromone score is taken as the pheromone value, for each vertex in the weighted graph, judging whether the vertex is included in the middle optimal vertex set, and if so, taking the new pheromone score as the pheromone value of the vertex; if not, the first pheromone score is taken as the pheromone value of the vertex.
Through the steps, the extra influence on the pheromone of the vertex when the vertex is drawn into the middle optimal vertex set when the middle optimal vertex set is solved can be further considered, and the vertex is not influenced by the middle optimal vertex set when the middle optimal vertex set is solved when the vertex is not drawn into the middle optimal vertex set, so that the pheromone value of each vertex is further updated based on the ant colony algorithm principle and the actual ant colony movement characteristic, the accuracy of the updated pheromone value of each vertex is improved, and the site selection accuracy of the whole ATM is indirectly improved.
In an optional embodiment, the obtaining heuristic information of each other vertex according to the other vertex degrees and other vertex weights includes:
Dividing other vertex degrees of each other vertex by other vertex weights to obtain heuristic information of the other vertices.
Illustratively, the other vertex is directly connected to the starting vertex by an edge or is not directly connected to the starting vertex by an edge.
Illustratively, the other vertex degrees are degrees of other vertices after deleting the edge connected to the starting vertex.
According to the method, heuristic information is obtained through the steps, besides the principle of an ant colony algorithm and the movement rule of a real ant colony, the influence of the vertex weight on the ant access tendency (if a user is convenient to arrive at a corresponding real ATM address, the user tends to start towards the ATM address when the user needs to perform accounting operation, otherwise the user does not tend to start towards the ATM address) is additionally combined, so that the heuristic information is closer to the attraction degree of the actual ATM address to the user, the accuracy of the obtained heuristic information is improved, and the accuracy of the whole ATM address selecting process is indirectly improved.
In an alternative embodiment, as shown in fig. 4, the obtaining a target vertex according to the heuristic information and the pheromone value includes the following steps:
S401: and obtaining the state transition probability of each other vertex according to the heuristic information and the pheromone value.
S402: and selecting the target vertex from the other vertices according to the state transition probability.
Illustratively, the obtaining the state transition probability of each other vertex according to the heuristic information and the pheromone value may be implemented by, but not limited to, the following formula:
wherein,representing the state transition probability of other current vertexes, j representing the vertex number, allowed k Representing other vertex sets τ j Representing the pheromone value, eta of the current other vertexes j Said heuristic information, τ, representing the current other vertices u A pheromone value, eta representing a vertex when the vertex is selected from other vertex sets u Represents heuristic information of a vertex when the vertex is selected from other vertex sets, alpha represents pheromone heuristic factors, and beta represents heuristic information heuristic factors. Wherein the values of alpha and beta are preset constants which can be determined by the person skilled in the art according to the actual situation, but the values of alpha and beta are preferably in the range of [0,1 ]]The larger α represents the larger influence degree of the pheromone on the state transition probability, and the smaller the opposite is, the larger β represents the larger influence degree of the heuristic information on the state transition probability, and the smaller the opposite is. For example, when α=1 and β=0, the state transition probability is expressed by considering only the influence of pheromone; α=1 and β=0 means that the state transition probability considers only the influence of heuristic information.
It should be noted that, for the specific implementation of step S401, it can be determined by those skilled in the art according to the actual situation, and the above description is merely exemplary, and the present invention is not limited thereto.
Illustratively, selecting the target vertex from the other vertices according to the state transition probabilities may be implemented by, but is not limited to, a function, program, software, or the like that implements roulette rules. For example, if the three vertices of the first, second and third are currently selected, the state transition probability of the first is 20%, the state transition probability of the second is 30% and the state transition probability of the third is 50%, when the target vertex is selected, all three vertices may be selected as the target vertex, but the selected states are consistent with the respective state transition probabilities.
Through step S401 and step S402, the target vertex can be selected based on the attractive condition of the optional vertex to the ant (the attractive force of the corresponding ATM address to the user) by using the related probability principle, so that the accuracy of the selected target vertex is improved, and the accuracy of the whole ATM address selecting step is indirectly improved.
An exemplary process of selecting vertices from the weighted graph by a single ant to obtain an initial optimal vertex set in the ant colony algorithm-based ATM addressing method in the embodiment of the present invention is as follows.
The weighting chart shown in FIG. 5, which includes V 1 、V 2 、V 3 、V 4 、V 5 、V 6 、V 7 And V 8 These 8 vertices and several edges as shown. Wherein the vertex V 1 The weight of (2) is 1, and the vertex V 2 The weight of (2) is that of vertex V 3 The weight of (2) is that of vertex V 4 The weight of (2) is that of vertex V 5 The weight of (2) is that of vertex V 6 The weight of (2) is 3, and the vertex V 7 The weight of (2) is 1, and the vertex V 8 The weight of (2).
Wherein the initial pheromone value of each vertex is 2.
An ant randomly selects the initial vertex V 4 Then V is taken 4 Added to the initial optimal vertex set to be combined with V 4 The connected edges are deleted, resulting in an intermediate weighting graph as shown in fig. 6. At this time, in addition to V 4 Also V 1 、V 2 、V 3 、V 5 、V 6 、V 7 And V 8 The 7 other vertices are not accessed, heuristic information is computed for each of the 7 other vertices, e.g., vertex V 5 The heuristic of (2) divided by its weight is 1.5. Then, the state transition probabilities of the 7 other vertexes are calculated respectively, and V is selected based on the state transition probabilities and the roulette rule 5 As a target vertex and takes the vertex asAnd the next initial vertex in the weighted graph is obtained.
Will V 5 Added to the initial optimal vertex set to be combined with V 5 The connected edges are deleted, resulting in an intermediate weighting graph as shown in fig. 7. At this time, there is also V 1 、V 2 、V 3 、V 6 、V 7 And V 8 The 6 other vertices are not accessed, and heuristic information is computed for the 6 other vertices, respectively. Then, the state transition probabilities of the 6 other vertexes are calculated respectively, and V is selected based on the state transition probabilities and the roulette rule 2 As a target vertex and using the vertex as the next initial vertex in the weighted graph.
Will V 2 Added to the initial optimal vertex set to be combined with V 2 The connected edges are deleted, resulting in an intermediate weighting graph as shown in fig. 8. At this time, there is also V 1 、V 3 、V 6 、V 7 And V 8 The 5 other vertices are not accessed, and heuristic information is computed for the 5 other vertices, respectively. Then, the state transition probabilities of the 5 other vertexes are calculated respectively, and V is selected based on the state transition probabilities and the roulette rule 7 As a target vertex and using the vertex as the next initial vertex in the weighted graph.
Will V 7 Added to the initial optimal vertex set to be combined with V 7 The connected edges are deleted, resulting in an intermediate weighting graph as shown in fig. 9. At this time, there is also V 1 、V 3 、V 6 And V 8 The 4 other vertices are not accessed, and heuristic information is computed for the 4 other vertices, respectively. Then, the state transition probabilities of the 4 other vertexes are calculated respectively, and V is selected based on the state transition probabilities and the roulette rule 8 As a target vertex and using the vertex as the next initial vertex in the weighted graph.
Will V 8 Added to the initial optimal vertex set to be combined with V 8 The connected edges are deleted, resulting in an intermediate weighting graph as shown in fig. 10. At this time, there is also V 1 、V 3 And V 6 These 3 other vertices are not accessed and,however, as can be seen from FIG. 10, there is no edge in the weighted graph, and so far, the step of obtaining an initial optimal vertex set, which is { V } 4 ,V 5 ,V 2 ,V 7 ,V 8 }。
Based on the same principle, the embodiment of the invention discloses an ATM addressing device 1100 based on an ant colony algorithm, as shown in FIG. 11, the ATM addressing device 1100 based on the ant colony algorithm comprises:
an initial pheromone determining module 1101, configured to obtain pheromone values of each vertex of a weighting chart according to a preset ant number and a shortest loop length obtained based on the preset ATM address weighting chart;
the middle optimal vertex set determining module 1102 is configured to repeatedly perform the step of solving a middle optimal vertex set until the number of times of execution is equal to a preset number of iterations, where the step of solving the middle optimal vertex set includes:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
Selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value;
the final optimal vertex set determining module 1103 is configured to obtain a final optimal vertex set according to the plurality of intermediate optimal vertex sets, so as to perform ATM machine site selection according to the final optimal vertex set.
In an optional implementation manner, the middle optimal vertex set determining module 1102 includes an initial optimal vertex set determining unit, where the initial optimal vertex set determining unit is configured to select an initial vertex in the weighted graph, and perform steps according to initial vertex information of the initial vertex and the pheromone value of the initial optimal vertex set until the number of execution times is equal to the number of ants, and specifically configured to:
deleting the edge connected with the initial vertex in the weighted graph;
obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertex in the weighted graph;
Obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices;
obtaining a target vertex according to the heuristic information and the pheromone value, and taking the target vertex as the next initial vertex in the weighted graph;
repeatedly deleting the edges connected with the initial vertexes in the weighted graph, and obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertexes and the non-edge vertexes in the weighted graph; obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices; obtaining a next target vertex according to the heuristic information and the pheromone value, and taking the target vertex as a next initial vertex in the weighted graph until no edge exists in the weighted graph;
and obtaining an initial optimal vertex set according to the initial vertex of the weighted graph and all the target vertices.
In an alternative embodiment, the initial pheromone determining module 1101 is configured to:
dividing the ant number by the shortest loop length to obtain the pheromone value.
In an alternative embodiment, the method further comprises a shortest loop length determining module for:
obtaining the side lengths of all sides in the weighting diagram according to the ATM address weighting diagram before obtaining the pheromone value of each vertex of the weighting diagram according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting diagram;
and obtaining the shortest loop length according to the side length and all vertexes in the ATM address weighting graph.
In an alternative embodiment, the method further comprises a weighted graph generating module for:
generating an ATM address weighting map according to a preset alternative ATM address before obtaining the pheromone value of each vertex of the weighting map according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting map.
In an alternative embodiment, the middle optimal vertex set determining module 1102 is configured to:
multiplying a preset pheromone volatilization coefficient by the pheromone value to obtain a first pheromone score;
multiplying the preset pheromone residual coefficient by the middle optimal total weight to obtain a second pheromone score;
And obtaining a new pheromone score according to the first pheromone score and the second pheromone score, and taking the new pheromone score as the pheromone value.
In an alternative embodiment, the middle optimal vertex set determining module 1102 is configured to:
and adding the first pheromone score and the second pheromone score to obtain the new pheromone score.
In an alternative embodiment, the initial optimal vertex set determining unit is configured to:
dividing other vertex degrees of each other vertex by other vertex weights to obtain heuristic information of the other vertices.
In an alternative embodiment, the initial optimal vertex set determining unit is configured to:
obtaining the state transition probability of each other vertex according to the heuristic information and the pheromone value;
and selecting the target vertex from the other vertices according to the state transition probability.
Since the principle of the ant colony algorithm-based ATM addressing device 1100 for solving the problem is similar to the above method, the implementation of the ant colony algorithm-based ATM addressing device 1100 for solving the problem can be referred to the implementation of the above method, and will not be described herein.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer device, which may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
In a typical example the computer apparatus comprises in particular a memory, a processor and a computer program stored on the memory and executable on the processor, said processor implementing the method as described above when said program is executed.
Referring now to FIG. 12, there is illustrated a schematic diagram of a computer device 1200 suitable for use in implementing embodiments of the present application.
As shown in fig. 12, the computer apparatus 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate works and processes according to a program stored in a Read Only Memory (ROM) 1202 or a program loaded from a storage section 1208 into a Random Access Memory (RAM) 1203. In the RAM1203, various programs and data required for the operation of the system 1200 are also stored. The CPU1201, ROM1202, and RAM1203 are connected to each other through a bus 1204. An input/output (I/O) interface 1205 is also connected to the bus 1204.
The following components are connected to the I/O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output portion 1207 including a Cathode Ray Tube (CRT), a liquid crystal feedback device (LCD), and the like, and a speaker, and the like; a storage section 1208 including a hard disk or the like; and a communication section 1209 including a network interface card such as a LAN card, a modem, or the like. The communication section 1209 performs communication processing via a network such as the internet. The drive 1210 is also connected to the I/O interface 1205 as needed. A removable medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 1210, so that a computer program read out therefrom is installed as needed in the storage section 1208.
In particular, according to embodiments of the present invention, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication portion 1209, and/or installed from the removable media 1211.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.
Claims (12)
1. An ATM machine site selection method based on an ant colony algorithm is characterized by comprising the following steps:
obtaining the pheromone value of each vertex of the weighting map according to the preset ant number of an ant colony algorithm and the shortest loop length obtained based on the preset ATM address weighting map;
repeating the step of solving the middle optimal vertex set until the execution times are equal to the preset iteration times of the ant colony algorithm, wherein the step of solving the middle optimal vertex set comprises the following steps:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value;
obtaining a final optimal vertex set according to the plurality of intermediate optimal vertex sets, and performing ATM address selection according to the final optimal vertex set;
The step of obtaining the initial optimal vertex set according to the initial vertex information of the initial vertex and the pheromone value comprises the following steps:
deleting the edge connected with the initial vertex in the weighted graph;
obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertex in the weighted graph;
obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices;
obtaining a target vertex according to the heuristic information and the pheromone value, and taking the target vertex as the next initial vertex in the weighted graph;
repeatedly deleting the edges connected with the initial vertexes in the weighted graph, and obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertexes and the non-edge vertexes in the weighted graph; obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices; obtaining a next target vertex according to the heuristic information and the pheromone value, and taking the target vertex as a next initial vertex in the weighted graph until no edge exists in the weighted graph;
And obtaining an initial optimal vertex set according to the initial vertex of the weighted graph and all the target vertices.
2. The method according to claim 1, wherein the obtaining the pheromone value of each vertex of the weighting map according to the preset number of ants and the shortest loop length obtained based on the preset ATM address weighting map comprises:
dividing the ant number by the shortest loop length to obtain the pheromone value.
3. The method as recited in claim 1, further comprising:
obtaining the side lengths of all sides in the weighting diagram according to the ATM address weighting diagram before obtaining the pheromone value of each vertex of the weighting diagram according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting diagram;
and obtaining the shortest loop length according to the side length and all vertexes in the ATM address weighting graph.
4. The method as recited in claim 1, further comprising:
generating an ATM address weighting map according to a preset alternative ATM address before obtaining the pheromone value of each vertex of the weighting map according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting map.
5. The method of claim 1, wherein updating the pheromone values of the vertices of the weighted graph based on the intermediate optimal total weight and the pheromone values comprises:
multiplying a preset pheromone volatilization coefficient by the pheromone value to obtain a first pheromone score;
multiplying the preset pheromone residual coefficient by the middle optimal total weight to obtain a second pheromone score;
and obtaining a new pheromone score according to the first pheromone score and the second pheromone score, and taking the new pheromone score as the pheromone value.
6. The method of claim 5, wherein the obtaining a new pheromone score based on the first pheromone score and the second pheromone score comprises:
and adding the first pheromone score and the second pheromone score to obtain the new pheromone score.
7. The method of claim 1, wherein obtaining heuristic information for each other vertex based on the other vertex degrees and other vertex weights comprises:
dividing other vertex degrees of each other vertex by other vertex weights to obtain heuristic information of the other vertices.
8. The method of claim 1, wherein said deriving a target vertex from said heuristic information and said pheromone values comprises:
obtaining the state transition probability of each other vertex according to the heuristic information and the pheromone value;
and selecting the target vertex from the other vertices according to the state transition probability.
9. An ATM machine site selection device based on an ant colony algorithm is characterized by comprising:
the initial pheromone determining module is used for obtaining the pheromone value of each vertex of the weighting chart according to the preset ant number and the shortest loop length obtained based on the preset ATM address weighting chart;
the middle optimal vertex set determining module is configured to repeatedly perform the step of solving the middle optimal vertex set until the number of times of execution is equal to a preset number of iterations, where the step of solving the middle optimal vertex set includes:
repeatedly executing the steps of selecting an initial vertex from the weighted graph, and obtaining an initial optimal vertex set according to initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the number of ants;
Selecting the middle optimal vertex set from a plurality of initial optimal vertex sets, obtaining a middle optimal total weight of the middle optimal vertex set according to the middle optimal vertex set, and updating the pheromone value of each vertex of the weighted graph according to the middle optimal total weight and the pheromone value;
the final optimal vertex set determining module is used for obtaining a final optimal vertex set according to a plurality of the intermediate optimal vertex sets so as to perform ATM address selection according to the final optimal vertex set;
the middle optimal vertex set determining module comprises an initial optimal vertex set determining unit, wherein the initial optimal vertex set determining unit is used for selecting an initial vertex in the weighted graph, the step of starting the initial optimal vertex set according to the initial vertex information of the initial vertex and the pheromone value until the execution times are equal to the ant number, and the method is specifically used for:
deleting the edge connected with the initial vertex in the weighted graph;
obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertex in the weighted graph;
Obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices;
obtaining a target vertex according to the heuristic information and the pheromone value, and taking the target vertex as the next initial vertex in the weighted graph;
repeatedly deleting the edges connected with the initial vertexes in the weighted graph, and obtaining other vertex degrees and other vertex weights of other vertexes according to other vertex information of other vertexes except the initial vertexes and the non-edge vertexes in the weighted graph; obtaining heuristic information of each other vertex according to the degrees of the other vertices and the weights of the other vertices; obtaining a next target vertex according to the heuristic information and the pheromone value, and taking the target vertex as a next initial vertex in the weighted graph until no edge exists in the weighted graph;
and obtaining an initial optimal vertex set according to the initial vertex of the weighted graph and all the target vertices.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-8 when the program is executed by the processor.
11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-8.
12. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by a processor, implements the method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210767054.5A CN115150315B (en) | 2022-07-01 | 2022-07-01 | ATM (automatic teller machine) site selection method and device based on ant colony algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210767054.5A CN115150315B (en) | 2022-07-01 | 2022-07-01 | ATM (automatic teller machine) site selection method and device based on ant colony algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115150315A CN115150315A (en) | 2022-10-04 |
CN115150315B true CN115150315B (en) | 2024-04-16 |
Family
ID=83409866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210767054.5A Active CN115150315B (en) | 2022-07-01 | 2022-07-01 | ATM (automatic teller machine) site selection method and device based on ant colony algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115150315B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116128014B (en) * | 2023-04-17 | 2023-08-04 | 深圳市明源云科技有限公司 | Hydrant layout method, device, electronic equipment and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111523698A (en) * | 2020-03-20 | 2020-08-11 | 全球能源互联网集团有限公司 | Ant colony site selection method and device for macroscopically site selection of clean energy base |
CN111768030A (en) * | 2020-06-24 | 2020-10-13 | 中国工商银行股份有限公司 | Bank transportation distribution line planning method and device, equipment and medium |
CN114022069A (en) * | 2021-10-29 | 2022-02-08 | 中山大学 | Rural E-business logistics oriented distribution center site selection method |
CN114510988A (en) * | 2021-12-21 | 2022-05-17 | 中国建设银行股份有限公司 | Site selection model construction method and device, computer equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11838036B2 (en) * | 2016-05-09 | 2023-12-05 | Strong Force Iot Portfolio 2016, Llc | Methods and systems for detection in an industrial internet of things data collection environment |
-
2022
- 2022-07-01 CN CN202210767054.5A patent/CN115150315B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111523698A (en) * | 2020-03-20 | 2020-08-11 | 全球能源互联网集团有限公司 | Ant colony site selection method and device for macroscopically site selection of clean energy base |
CN111768030A (en) * | 2020-06-24 | 2020-10-13 | 中国工商银行股份有限公司 | Bank transportation distribution line planning method and device, equipment and medium |
CN114022069A (en) * | 2021-10-29 | 2022-02-08 | 中山大学 | Rural E-business logistics oriented distribution center site selection method |
CN114510988A (en) * | 2021-12-21 | 2022-05-17 | 中国建设银行股份有限公司 | Site selection model construction method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN115150315A (en) | 2022-10-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110832509B (en) | Black box optimization using neural networks | |
CN113574325B (en) | Method and system for controlling an environment by selecting a control setting | |
JP2003505746A (en) | Improve utility and diversify model risk within the framework of portfolio optimization | |
EP3552156B1 (en) | Neural episodic control | |
CN109815419B (en) | Interest point indexing method, device, medium and electronic equipment based on geographic position | |
US20240177469A1 (en) | Method and apparatus for encoding geographic location region as well as method and apparatus for establishing encoding model | |
CN115150315B (en) | ATM (automatic teller machine) site selection method and device based on ant colony algorithm | |
CN112292701A (en) | Conducting policy search in multi-party policy interaction | |
CN110784883B (en) | Base station construction evaluation method, device, equipment and storage medium | |
CN114429195B (en) | Performance optimization method and device for training mixed expert model | |
KR102288785B1 (en) | Sampling Schemes for Strategic Search in Strategic Interactions Between Parties | |
CN111957053B (en) | Game player matching method and device, storage medium and electronic equipment | |
CN112001786A (en) | Client credit card limit configuration method and device based on knowledge graph | |
WO2014020076A1 (en) | A method and appararus for providing a response to a query | |
CN114036388A (en) | Data processing method and device, electronic equipment and storage medium | |
US11668581B2 (en) | Generating positions of map items for placement on a virtual map | |
CN114528992A (en) | Block chain-based e-commerce business analysis model training method | |
CN113626721B (en) | Regrettful exploration-based recommendation method and device, electronic equipment and storage medium | |
CN117556967B (en) | Scheduling method, device, equipment and storage medium | |
CN116089063B (en) | Northern hawk optimization WNGO algorithm and similar integer code service combination optimization method based on guidance of prey generation by using whale optimization algorithm | |
CN115935027B (en) | Data processing method of target object topological graph and training method of graph classification model | |
CN113435653B (en) | Method and system for predicting saturated power consumption based on logistic model | |
CN113688197A (en) | Resident point label determination method, device, equipment and storage medium | |
CN115205049A (en) | Insurance product pushing method and device | |
CN116645208A (en) | Abnormal transaction data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |