CN113539511B - Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization - Google Patents
Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization Download PDFInfo
- Publication number
- CN113539511B CN113539511B CN202110663148.3A CN202110663148A CN113539511B CN 113539511 B CN113539511 B CN 113539511B CN 202110663148 A CN202110663148 A CN 202110663148A CN 113539511 B CN113539511 B CN 113539511B
- Authority
- CN
- China
- Prior art keywords
- constraint
- local
- solution
- neighbor
- optimization
- 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
Images
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/80—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for detecting, monitoring or modelling epidemics or pandemics, e.g. flu
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Public Health (AREA)
- Biophysics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Biomedical Technology (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computing Systems (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Genetics & Genomics (AREA)
- Computational Linguistics (AREA)
- Physiology (AREA)
- Molecular Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Databases & Information Systems (AREA)
- Pathology (AREA)
- Epidemiology (AREA)
- Primary Health Care (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses an infectious disease transmission treatment model optimization method based on K neighbor constraint optimization, which comprises the following steps: establishing a structural diagram aiming at the transmission treatment of infectious diseases, and acquiring the treatment cost of each node in the structural diagram and the data of the probability of infecting other nodes; establishing an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints; and solving the optimization model by using a constraint optimization algorithm to obtain the cure rate of all nodes. According to the invention, K is adaptively adjusted based on the proportion of feasible solutions in the population and the evolution algebra, each individual defines the K neighbor of the model, the individual with the least degree of violation in the K neighbor is compared with the feasible solution, and the new degree of violation of the constraint is defined according to the neighbor.
Description
Technical Field
The invention relates to the technical field of algorithm optimization and public health, in particular to an infectious disease transmission treatment model optimization method based on K neighbor constraint optimization.
Background
Among the problems related to resource scheduling and resource allocation, such as public health and network security, it is an important issue to formulate a policy for reasonably controlling and suppressing the spread of infectious diseases or viruses when resources are limited. This class of problems can be modeled generally as a constraint optimization problem. Therefore, there is an urgent need for an efficient constraint processing technique to solve constraint optimization problems, thereby customizing optimal infectious disease transmission treatment strategies. The formulation of treatment strategies for the transmission of infectious diseases is mainly divided into the following parts:
(1) Mathematical modeling of infectious disease transmission treatment: the infectious disease transmission treatment is a complex network, the modeling of an epidemic model can simulate the transmission and treatment of complex network viruses, the complex network is modeled as a constrained target optimization problem, and an effective control transmission and treatment strategy is formulated by solving the optimal solution of the problem.
(2) The constraint processing method comprises the following steps: to solve the constraint optimization problem, constraint processing technology is particularly important, and efficient and accurate constraint processing technology is the core of formulating infectious disease transmission treatment strategies.
At present, constraint processing technologies mainly include the following four types: (1) method of penalty function. This type of approach forces the search process to the feasible region by adding a penalty factor or penalty function to the non-feasible solution. The choice of penalty factors or penalty functions in this class of methods is a very difficult problem; (2) A method for treating objective function and violation degree separately. The method treats the objective function value and the degree of violation of the constraint separately, and selects an individual by taking one of the objective function value and the degree of violation of the constraint as a priority principle with a certain probability. The feasible solutions stored by the method are random, and have no guiding effect on searching of the non-feasible solutions; (3) a method of constrained dominant ordering. The method is excellent in selecting a solution with a better target value in feasible solutions, and selecting a solution with a smaller degree of violation of constraint. The main disadvantage of the algorithm is that the algorithm is essentially a dead penalty function method, namely, the condition that the penalty factor in the penalty function method is very large, so that the constraint dominant ordering algorithm is easy to trap into local optimization; (4) constraint optimization method based on multi-objective technology. This class of methods converts the single-objective constraint problem into a double-objective unconstrained optimization problem by taking the constraint as a new objective, and solves the problem by a double-objective unconstrained optimization algorithm. This class of algorithms does not require balancing objective functions and violating constraint levels, and their main disadvantage is that when there are more feasible solutions, the diversity of the non-feasible solutions is not guaranteed, and thus the full search capability for space is lost.
Disclosure of Invention
The invention aims to provide an infectious disease transmission treatment model optimization method based on K neighbor constraint optimization, which is used for efficiently solving the constraint optimization problem of infectious disease transmission treatment and obtaining the cure rate of nodes, thereby providing support for formulating an effective infectious disease transmission treatment strategy.
In order to realize the tasks, the invention adopts the following technical scheme:
an infectious disease transmission treatment model optimization method based on K neighbor constraint optimization comprises the following steps:
s1, establishing a structural diagram aiming at the transmission treatment of infectious diseases, and acquiring the treatment cost c of each node i in the structural diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram is recorded as N;
s2, establishing an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints;
s3, solving the optimization model by using a constraint optimization algorithm to obtain cure rates x of all nodes, wherein the method comprises the following steps:
s3.1, initializing population and parameters
Uniformly randomly generating M initial solutions as an initial population P 1 Wherein the jth individual in the population Representing the cure rate of each node in a solution;
setting maximum evolution algebra G max ;
Setting a ratio R of a feasible solution to a local feasible solution ratio which changes along with evolution algebra t ;
Randomly initializing a K value of a K neighbor;
setting a current evolution algebra t=1;
s3.2, configuring a genetic algorithm
Generating M offspring by using genetic variation to form a population Q;
group P of t generation t And the population Q are combined;
s3.3, constructing K neighbor local constraint sequencing
According to R t Adaptively calculating a K value;
each individual X i ∈P t The U Q searches K nearest neighbors;
each individual X i ∈P t Calculating the degree of violation of the local constraint of the K nearest neighbor based on the K nearest neighbor of the U and sequencing the local constraint of the K nearest neighbor;
s3.4, selection mechanism based on neighbor constraint
Based on K neighbor local constraint and ordering, each time from P t Two individuals are selected for Q, if itOne of the solutions is the solution that is optimal for the target value among the feasible solutions, it is saved, and if none is, the winner is selected to save to the next generation based on the following rules:
the K local feasible solution is superior to the K local non-feasible solution;
selecting a solution with a better objective function value when two K local feasible solutions compete;
selecting a solution with K local constraint sequencing at the front when two K local non-feasible solutions compete;
from P by the method of S3.4 t After all individuals are selected by the U Q, the stored offspring is marked as P t+1 And the evolution algebra t=t+1, returning to S3.2 until the maximum evolution algebra G is reached max And then outputting the optimal solution to obtain the cure rate of all nodes, and providing data support for formulating the prevention and control strategy of infectious diseases.
Further, the optimization model is expressed as follows:
s.t.g 1 =λ max (A-diag(x))≤0
wherein f (x) is an objective function, g 1 Representing constraints, lambda max () For the eigenvalue maximum of the matrix in brackets,is an infection matrix; x is x i Cure rate for the ith node; x= (x 1 ,x 2 ,…,x N ) The cure rate for all nodes is a solution that needs to be optimized.
Further, the calculating process of violating the local constraint degree of the K neighbor comprises the following steps:
for individuals X in a population that need to be optimized j Which violates the ith constraint extent G i (X j ) The definition is as follows:
wherein g i (X j ) For the i (i=1.,. P) th inequality constraint, where p is the number of inequality constraints, h i (X j ) Constraint for the i (i=p+1,.., q) th equation, where q is the total number of constraints and δ is a tolerance factor, so that for one individual it violates the degree of constraint G (X j ) The method comprises the following steps:
further, the K-nearest neighbor local constraint is:
set the group as { X ] 1 ,X 2 ,...,X N -initializing the value of K, constructing a local constraint based on the value of K, for each individual X j Its K neighbor isThe definition of the K neighbor local constraint is as follows:
then feasible solutionMust be 0, those individuals whose K neighbors violate the constraint to the least extent +.>Also the number of times of the,is referred to as a K locally feasible solution, such that the solution with the least degree of local violation of the constraint is treated as a feasible solution.
Further, the ratio R of the feasible solution to the local feasible solution is made by adjusting the number K of neighbors new The ratio R of the near feasible solution to the local feasible solution changes along with the evolution algebra t So that the populationPreserving a proportion of non-viable solutions, wheret,t max R is the current iteration number and the maximum iteration number respectively 0 Is the ratio of the initial desired feasible solution.
Further, according to R t Adaptively calculating a K value, comprising:
initializing a K value and a current locally feasible solution duty cycle calculation value R old Definition of local constraint based on K nearest neighbor calculates local constraint of each individual in population, and calculates ratio R of feasible solution based on K value to local feasible solution new The method comprises the steps of carrying out a first treatment on the surface of the Judging whether or not |R new -R t |>|R old -R t I, if yes, output R new A corresponding K value; if not, compare R new And R is t If R is new <R t Let k=k+1, otherwise let k=k-1, repeat the above steps until a K value is output.
Further, the K-nearest neighbor local ordering includes:
the K neighbor individuals are compared pairwise based on the following rules:
individuals with smaller local violations are preferred over individuals with greater local violations;
when the local violation constraint degrees are the same, the individuals with better target values are better;
finding out all the locally optimal solutions, assigning ranks to the solutions, and deleting the solutions from the population at the same time;
update Rank rank=rank+1;
and judging whether the population is empty, if not, repeatedly finding out a local optimal solution in the population, updating the ordering, until the population is empty, and outputting the ranking.
An infectious disease transmission treatment model optimizing device based on K-nearest neighbor constraint optimization, comprising:
a mapping module for creating a structure diagram for the transmission treatment of infectious diseases and obtaining the treatment cost c of each node i in the structure diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram is recorded as N;
the optimization model building module is used for building an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints;
the model solving module is used for solving the optimizing model by using a constraint optimizing algorithm to obtain cure rates x of all nodes, and comprises the following steps:
s3.1, initializing population and parameters
Uniformly randomly generating M initial solutions as an initial population P 1 Wherein the jth individual in the population Representing the cure rate of each node in a solution;
setting maximum evolution algebra G max ;
Setting a ratio R of a feasible solution to a local feasible solution ratio which changes along with evolution algebra t ;
Randomly initializing a K value of a K neighbor;
setting a current evolution algebra t=1;
s3.2, configuring a genetic algorithm
Generating M offspring by using genetic variation to form a population Q;
group P of t generation t And the population Q are combined;
s3.3, constructing K neighbor local constraint sequencing
According to R t Adaptively calculating a K value;
each individual X i ∈P t The U Q searches K nearest neighbors;
each individual X i ∈P t Calculating the degree of violation of the local constraint of the K nearest neighbor based on the K nearest neighbor of the U and sequencing the local constraint of the K nearest neighbor;
s3.4, selection mechanism based on neighbor constraint
Based on K nearest neighbor local constraint and ordering, each timeFrom P t And selecting two individuals, if one of the two individuals is the solution with the optimal target value in the feasible solutions, storing the solution, and if the two individuals are not, selecting a winner to store to the next generation based on the following rule:
the K local feasible solution is superior to the K local non-feasible solution;
selecting a solution with a better objective function value when two K local feasible solutions compete;
selecting a solution with K local constraint sequencing at the front when two K local non-feasible solutions compete;
from P by the method of S3.4 t After all individuals are selected by the U Q, the stored offspring is marked as P t+1 And the evolution algebra t=t+1, returning to S3.2 until the maximum evolution algebra G is reached max And outputting the optimal solution to obtain the cure rate of all the nodes.
A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor executing the computer program implementing the steps of the foregoing method for optimizing a model of treatment for spread of infectious disease based on K-nearest neighbor constraint optimization.
A computer readable storage medium storing a computer program which when executed by a processor performs the steps of the method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization.
Compared with the prior art, the invention has the following technical characteristics:
the invention adaptively adjusts K based on the proportion of feasible solutions in the population and the evolution algebra, each individual defines the K neighbor thereof, compares the individual with the least degree of violation of the constraint in the K neighbor as the feasible solution, and defines the new degree of violation of the constraint according to the neighbor. By designing a new principle based on local constraint comparison, individuals with local representativeness, light violation constraint degree and good objective function value can be saved, and the algorithm can effectively process the constraint optimization problem, so that an optimal solution of an infectious disease transmission treatment model can be obtained efficiently and accurately, and a corresponding strategy is formulated. The method is based on a simple constraint dominance principle algorithm, and some representative non-feasible solutions with low constraint violation degree are saved by constructing local constraints and new constraint dominance principles. The method is simple and easy to realize, and meanwhile, the efficiency and the robustness are obviously improved.
Drawings
FIG. 1 is a flow diagram of a constraint optimization algorithm;
FIG. 2 is a flow chart of K-value adaptive adjustment;
FIG. 3 is a schematic diagram of K nearest neighbor local ordering;
FIG. 4 is a graph comparing the objective function value decrease curves for CDP and TPA on test question 1;
FIG. 5 is a graph comparing the objective function value decrease curves for CDP and TPA on test question 2;
FIG. 6 is a graph comparing the objective function value decrease curves for CDP and TPA over test question 3;
FIG. 7 is a graph comparing the objective function value decrease curves for CDP and TPA on test question 4;
FIG. 8 is a graph of objective function value decrease for CDP and TPA over test question 5;
FIG. 9 is a graph of objective function value decrease for CDP and TPA over test question 6;
FIG. 10 is a graph of objective function value decrease for CDP and TPA over test question 7;
fig. 11 is a graph of the objective function value decrease for CDP and TPA on test problem 8.
Detailed Description
The key to current constraint optimization algorithms is how to preserve some of the non-viable solutions that are advantageous for spatial searching, while not wasting the resources of the algorithm solution. In view of the above, the invention provides a self-adaptive constraint processing technology based on K-nearest neighbor, and the individuals in the population are divided into feasible solutions according to the proportion of the feasible solutions of the population and the evolution algebra; the least local violation based on K-nearest neighbor is a non-feasible solution; and comparing the individual with the least local violation degree as a feasible solution, thereby saving the solution with a representative target value and a smaller violation degree.
According to the scheme, based on K neighbor violation constraint measurement, through K neighbor local constraint construction, representative non-feasible points with low violation constraint degree are enabled to be feasible points, and the individuals are effectively protected. Based on the selection mechanism of the K neighbor, when the individual with the least local violation constraint degree is compared with a feasible point, the individual with the better objective function value is reserved. Based on the proportion of feasible solutions in the current population and the strategy of adaptively adjusting the K value by the evolution algebra, the effective balance algorithm calculates the allocation of resources in the feasible domain and the non-feasible domain.
An infectious disease transmission treatment model optimization method based on K neighbor constraint optimization comprises the following steps:
s1, establishing a structural diagram aiming at the transmission treatment of infectious diseases, and acquiring the treatment cost c of each node i in the structural diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram, namely the number of people in the crowd, is N.
S2, modeling a structure diagram with N nodes as the following optimization model:
s.t.g 1 =λ max (A-diag(x))≤0
wherein f (x) is an objective function, g 1 Representing constraints, lambda max () For the eigenvalue maximum of the matrix in brackets,is an infection matrix; x is x i Cure rate for the ith node; x= (x 1 ,x 2 ,…,x N ) The cure rate for all nodes is a solution that needs to be optimized. />
The modeling process may also employ, among other things, an approximate non-uniform N-interlace average approximation (NIMFA) model using, for example, SIS diffusion dependent processes.
And S3, solving the optimization model by using a constraint optimization algorithm to obtain cure rates x of all nodes.
Wherein, the optimization constraint algorithm is specifically as follows:
s3.1, initializing population and parameters
Uniformly randomly generating M initial solutions as initial population P in decision space 1 Wherein the jth individual in the populationRepresenting the cure rate of each node in a solution;
setting maximum evolution algebra G max ;
Setting a ratio R of a feasible solution to a local feasible solution ratio which changes along with evolution algebra t ;
Randomly initializing a K value of a K neighbor;
the current evolution algebra t=1 is set.
S3.2, configuring a genetic algorithm (t generation)
Generating M offspring by using genetic variation to form a population Q;
group P of t generation t And population Q.
S3.3, constructing K neighbor local constraint sequencing
According to R t Adaptively calculating a K value;
each individual X i ∈P t The U Q searches K nearest neighbors;
each individual X i ∈P t And calculating the degree of violation of the local constraint of the K neighbor based on the K neighbor of the U and sequencing the local constraint of the K neighbor.
S3.4, selection mechanism based on neighbor constraint
Based on K neighbor local constraint and ordering, each time from P t And selecting two individuals, if one of the two individuals is the solution with the optimal target value in the feasible solutions, storing the solution, and if the two individuals are not, selecting a winner to store to the next generation based on the following rule:
the K local feasible solution is superior to the K local non-feasible solution;
selecting a solution with a better objective function value when two K local feasible solutions compete;
and selecting a solution with the K local constraint ordering at the front when two K local non-feasible solutions compete.
From P by the method of S3.4 t After all individuals are selected by the U Q, the stored offspring is marked as P t+1 And the algebra t=t+1, return to S3.2 until the set abort condition is met (maximum algebra G is reached max ) Then, outputting an optimal solution to obtain cure rates of all nodes; after the cure rate of all nodes in the structure diagram is obtained, the range, the influence and the like of the transmission of the infectious disease can be analyzed on the basis, so that data support is provided for formulating a prevention and control strategy of the infectious disease.
Referring to fig. 1, a schematic diagram of a specific flow of the constraint optimization algorithm of the present invention; the adaptive calculation of the K value and the calculation and ordering of the degree of violation of the local constraints of the K neighbors will be further described below.
(1) Calculation of degree of violation of K nearest neighbor local constraint
For individuals X in a population that need to be optimized j Which violates the ith constraint extent G i (X j ) The definition is as follows:
wherein g i (X j ) For i (i=1.,), p) inequality constraints, commonly denoted g i (X j ) Less than or equal to 0, wherein p is the number of inequality constraints, h i (X j ) For i (i=p+1.,), q) equality constraints, commonly denoted as h i (X j ) =0, where q is the total number of constraints, δ is a tolerance factor, typically a small positive real number, such as 1e-6. Thus, for an individual, it violates the constraint degree G (X j ) The method comprises the following steps:
set the group as { X ] 1 ,X 2 ,...,X N -initializing the value k=0.2n, constructing a local constraint based on the value K, X for each individual j Its K neighbor isThe definition of the K neighbor local constraint is as follows:
from this, it can be seen thatMust be 0, those individuals whose K neighbors violate the constraint to the least extentAlso 0->Is referred to as a K locally feasible solution, such that the solution with the least degree of local violation of the constraint is treated as a feasible solution.
(2) Adaptively calculating K value
The ratio R of the feasible solution to the local feasible solution by adjusting the number K of neighbors new The ratio R of the near feasible solution to the local feasible solution changes along with the evolution algebra t So that the population maintains a certain proportion of non-feasible solutions, whereint,t max R is the current iteration number and the maximum iteration number respectively 0 =0.5 is the ratio of the initial desired feasible solution; r is R t With the increase of evolution algebra, more non-feasible solutions are saved in the early stage of the algorithm, so that the global optimal solution can be searched; at the later stage of the algorithm, fewer non-feasible solutions are reserved, which is beneficial to improving the searching efficiency of the algorithm.
Initializing a K value and enabling a calculated value of a current local feasible solution duty ratio to be R old =inf, inf is a preset value; definition of local constraint based on K nearest neighbor calculates local constraint of each individual in population, and calculates ratio R of feasible solution based on K value to local feasible solution new . Judging to beNo |R new -R t |>|R old -R t I, if yes, output R new A corresponding K value; if not, compare R new And R is t If R is new <R t Let k=k+1, otherwise let k=k-1, repeat the above steps until a K value is output. Fig. 2 shows a flow chart for the adaptive adjustment of the number K of neighbors.
(3) K nearest neighbor local ordering
Initializing a ranking rank=1;
the K neighbor individuals are compared pairwise based on the following rules:
individuals with smaller local violations are preferred over individuals with greater local violations;
when the local violation constraint degrees are the same, the individuals with better target values are better;
finding out all the locally optimal solutions, assigning ranks to the solutions, and deleting the solutions from the population at the same time;
update Rank rank=rank+1;
and judging whether the population is empty, if not, repeatedly finding out a local optimal solution in the population, updating the ordering, until the population is empty, and outputting the ranking.
Comparison test:
we compared the proposed algorithm with a representative constraint optimization algorithm, constraint Dominant Principle (CDP) algorithm: an efficient constraint handling method for genetic algorithms, an effective constraint processing method for genetic algorithms, uses constraint-dominated ordering principles to guide binary tournaments to preserve viable solutions. The binary tournament can preserve the diversity of the population, further improving the performance of the algorithm. The test questions used in this experiment are eight questions presented in An efficient constraint handling method for genetic algorithms and Bell South network infectious disease transmission and treatment questions:
1. test problem one is a problem with 2 independent variables and 2 inequality constraints, the minimum value of the problem is 0 when the problem is unconstrained, and the optimal value of the problem is 13.59085 under the action of two inequality constraints;
2. test problem two is a problem with 5 independent variables and 38 inequality constraints, which is used to test the efficiency of algorithm when there are a large number of constraints, and its optimal value is-1.91460 under the action of the constraints;
3. the test problem III is a problem with 13 independent variables and 9 inequality constraints, and the problem is used for testing the efficiency of an algorithm when an objective function and the constraint are linear or quadratic terms, and the optimal value of the problem is-15 under the constraint action;
4. the fourth test problem is a problem with 3 independent variables and 6 inequality constraints, and is used for testing the efficiency of an algorithm when the objective function presents multiple modes, and the optimal value of the problem is 7049.330923 under the constraint action;
5. test problem five is a problem with 7 independent variables and 4 inequality constraints, which are nonlinear constraints, and is used for testing the efficiency of the algorithm when the algorithm converges to near an optimal value, and the optimal value is 680.6300573 under the constraint action;
6. test problem six is a problem with 5 independent variables and 6 inequality constraints, which is used for testing the efficiency of an objective function and an algorithm when the constraints present multiple modes, and the optimal value of the problem is-30665.5 under the action of the constraints;
7. the test problem seven is a problem with 5 independent variables and 3 equality constraints, the feasible region is very small, the storage of diversity is a difficult problem when searching for a feasible solution, and the problem is used for testing the storage of population diversity of an algorithm in the solving process and the solving efficiency of the algorithm, and the optimal value of the problem is 0.053950 under the constraint action;
8. test problem eight is a problem with 10 independent variables and 8 inequality constraints, which is very demanding for the population to remain diverse in the feasible domain, with an optimal value of 24.3062091 under constraint.
The bell South network consists of 51 nodes and 66 connection lines, all with an infection rate of 1 and a treatment cost of 1 for all nodes.
Fig. 4-11 show the decreasing curves of objective function values of the optimization algorithm (TPA) and the optimization algorithm (CDP) based on the constraint dominance principle of the K-nearest neighbor based constraint processing technique according to the present invention with evolution algebra. Table 1 shows the average value of the objective function values of the optimal solution obtained by the algorithm proposed in the present scheme and the constraint governance principle algorithm running 30 times on the test problem. Experiments show that the algorithm provided by the project has good performance.
Table 2 shows the average value of the optimal solution of the infectious disease transmission treatment of the Bell South network under 20 runs, which is solved by the optimization algorithm (TPA) of the K-nearest neighbor based constraint treatment technology and the optimization algorithm (CDP) of the constraint dominance principle. Experiments show that the K-nearest neighbor-based adaptive constraint processing technology has good performance in formulating an infectious disease transmission treatment strategy.
Table 1. The algorithm (TPA) and constraint governing principle algorithm (CDP) presented in this scheme run 30 times on the test problem presented in CDP text to obtain the average value of the objective function values of the optimal solution.
Instance | TPA | CDP |
TestProblem1 | 13.6089 | 13.6162 |
TestProblem2 | -1.9036 | -1.9029 |
TestProblem3 | -14.9025 | -14.4892 |
TestProblem4 | 8028.1211 | 8057.7488 |
TestProblem5 | 680.9922 | 681.2044 |
TestProblem6 | -30664 | -30662.4 |
TestProblem7 | 0.6313 | 0.7709 |
TestProblem8 | 25.9232 | 26.3125 |
Table 2. Mean of objective function values of the optimal solution obtained by running the present scheme (TPA) and constraint governance principle algorithm (CDP) 20 times on Bell South network infectious disease transmission treatment problem.
Instance | TPA | CDP |
Bell South | 0.0390 | 0.0838 |
When solving the constraint optimization problem of infectious disease transmission treatment, the invention creatively provides definition and calculation of the local constraint of the K neighbor, and defines some representative non-feasible solutions with low violation degree as local feasible solutions, which are favorable for saving the representative non-feasible solutions with low violation degree, and points on the boundary of a feasible domain are favorable and searched by the assistance of the non-feasible solutions, so that the efficiency of an algorithm is improved. The method is based on the proportion of feasible solutions in the current population and evolution algebra, and the size of the neighborhood is adaptively adjusted, so that the purpose of adjusting the proportion of the feasible solutions is achieved, and the adaptive balance algorithm searches in the feasible domain and the non-feasible domain.
According to another aspect of the present application, there is provided an infectious disease transmission therapy model optimizing apparatus based on K-nearest neighbor constraint optimization, including:
a mapping module for creating a structure diagram for the transmission treatment of infectious diseases and obtaining the treatment cost c of each node i in the structure diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram is recorded as N;
the optimization model building module is used for building an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints;
and the model solving module is used for solving the optimizing model by using a constraint optimizing algorithm to obtain the cure rate x of all the nodes.
It should be noted that, the specific functions and the relevant explanations of the above respective modules refer to the corresponding steps S1 to S3 in the foregoing method embodiments, which are not described herein.
The embodiment of the application further provides a terminal device, which can be a computer or a server; comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-described method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization, e.g. S1 to S3 as described above, when executing the computer program.
Implementations of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization, e.g., S1 to S3 described above.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.
Claims (7)
1. An infectious disease transmission treatment model optimization method based on K neighbor constraint optimization is characterized by comprising the following steps:
s1, establishing a structural diagram aiming at the transmission treatment of infectious diseases, and acquiring the treatment cost c of each node i in the structural diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram is recorded as N;
s2, establishing an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints;
the optimization model is expressed as follows:
s.t.g 1 =λ max (A-diag(x))≤0
wherein f (x) is an objective function, g 1 Representing constraints, lambda max () For the maximum eigenvalue of the matrix in brackets, a=Is an infection matrix; x is x i Cure rate for the ith node; x= (x 1 ,x 2 ,…,x N ) The cure rate of all nodes is a solution which needs to be optimized;
s3, solving the optimization model by using a constraint optimization algorithm to obtain cure rates x of all nodes, wherein the method comprises the following steps:
s3.1, initializing population and parameters
Uniformly randomly generating M initial solutions as an initial population P 1 Wherein the jth individual in the populationRepresenting the cure rate of each node in a solution;
setting maximum evolution algebra G max ;
Setting a ratio R of a feasible solution to a local feasible solution ratio which changes along with evolution algebra t ;
Randomly initializing a K value of a K neighbor;
setting a current evolution algebra t=1;
s3.2, configuring a genetic algorithm
Generating M offspring by using genetic variation to form a population Q;
group P of t generation t And the population Q are combined;
s3.3, constructing K neighbor local constraint sequencing
According to R t Adaptively calculating a K value;
each individual X i ∈P t The U Q searches K nearest neighbors;
each individual X i ∈P t Calculating the degree of violation of the local constraint of the K nearest neighbor based on the K nearest neighbor of the U and sequencing the local constraint of the K nearest neighbor;
the K nearest neighbor local constraint is:
set the group as { X ] 1 ,X 2 ,...,X N -initializing the value of K, constructing a local constraint based on the value of K, for each individual X j Its K neighbor isThe definition of the K neighbor local constraint is as follows:
then feasible solutionMust be 0, those individuals whose K neighbors violate the constraint to the least extent +.>Also 0->The solution with the least degree of local violation constraint is treated as a feasible solution;
s3.4, selection mechanism based on neighbor constraint
Based on K neighbor local constraint and ordering, each time from P t And selecting two individuals, if one of the two individuals is the solution with the optimal target value in the feasible solutions, storing the solution, and if the two individuals are not, selecting a winner to store to the next generation based on the following rule:
the K local feasible solution is superior to the K local non-feasible solution;
selecting a solution with a better objective function value when two K local feasible solutions compete;
selecting a solution with K local constraint sequencing at the front when two K local non-feasible solutions compete;
from P by the method of S3.4 t After all individuals are selected by the U Q, the stored offspring is marked as P t+1 And the evolution algebra t=t+1, returning to S3.2 until the maximum evolution algebra G is reached max Then, outputting an optimal solution to obtain the cure rate of all nodes, and providing data support for formulating a prevention and control strategy of infectious diseases;
the calculation process for violating the local constraint degree of the K neighbor comprises the following steps:
for individuals X in a population that need to be optimized j Which violates the ith constraint extent G i (X j ) The definition is as follows:
wherein g i (X j ) For the i (i=1.,. P) th inequality constraint, where p is the number of inequality constraints, h i (X j ) Constraint for the i (i=p+1,., q) equation, where q is the total number of constraints and δ is toleranceFactor, therefore, for an individual, it violates the degree of constraint G (X j ) The method comprises the following steps:
2. the method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization according to claim 1, wherein the ratio R of feasible solution to locally feasible solution is made by adjusting the nearest neighbor number K new The ratio R of the near feasible solution to the local feasible solution changes along with the evolution algebra t So that the population maintains a certain proportion of non-feasible solutions, whereint,t max R is the current iteration number and the maximum iteration number respectively 0 Is the ratio of the initial desired feasible solution.
3. The method for optimizing an infectious disease transmission therapy model based on K-nearest neighbor constraint optimization according to claim 1, wherein the method is characterized by t Adaptively calculating a K value, comprising:
initializing a K value and a current locally feasible solution duty cycle calculation value R old Definition of local constraint based on K nearest neighbor calculates local constraint of each individual in population, and calculates ratio R of feasible solution based on K value to local feasible solution new The method comprises the steps of carrying out a first treatment on the surface of the Judging whether or not |R new -R t |>|R old -R t I, if yes, output R new A corresponding K value; if not, compare R new And R is t If R is new <R t Let k=k+1, otherwise let k=k-1, repeat the above steps until a K value is output.
4. The method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization of claim 1, wherein the K-nearest neighbor local ordering comprises:
the K neighbor individuals are compared pairwise based on the following rules:
individuals with smaller local violations are preferred over individuals with greater local violations;
when the local violation constraint degrees are the same, the individuals with better target values are better;
finding out all the locally optimal solutions, assigning ranks to the solutions, and deleting the solutions from the population at the same time;
update Rank rank=rank+1;
and judging whether the population is empty, if not, repeatedly finding out a local optimal solution in the population, updating the ordering, until the population is empty, and outputting the ranking.
5. An optimizing apparatus for performing the K-nearest neighbor constraint optimization-based infectious disease propagation treatment model optimizing method as set forth in any one of claims 1 to 4, comprising:
a mapping module for creating a structure diagram for the transmission treatment of infectious diseases and obtaining the treatment cost c of each node i in the structure diagram i And probability a of infecting other nodes j ij Data of (2); the number of nodes in the structure diagram is recorded as N;
the optimization model building module is used for building an optimization model aiming at the structure diagram, wherein the optimization model comprises an objective function and corresponding constraints;
the model solving module is used for solving the optimizing model by using a constraint optimizing algorithm to obtain cure rates x of all nodes, and comprises the following steps:
s3.1, initializing population and parameters
Uniformly randomly generating M initial solutions as an initial population P 1 Wherein the jth individual in the populationRepresenting the cure rate of each node in a solution;
setting maximum evolution algebra G max ;
Setting a ratio R of a feasible solution to a local feasible solution ratio which changes along with evolution algebra t ;
Randomly initializing a K value of a K neighbor;
setting a current evolution algebra t=1;
s3.2, configuring a genetic algorithm
Generating M offspring by using genetic variation to form a population Q;
group P of t generation t And the population Q are combined;
s3.3, constructing K neighbor local constraint sequencing
According to R t Adaptively calculating a K value;
each individual X i ∈P t The U Q searches K nearest neighbors;
each individual X i ∈P t Calculating the degree of violation of the local constraint of the K nearest neighbor based on the K nearest neighbor of the U and sequencing the local constraint of the K nearest neighbor;
s3.4, selection mechanism based on neighbor constraint
Based on K neighbor local constraint and ordering, each time from P t And selecting two individuals, if one of the two individuals is the solution with the optimal target value in the feasible solutions, storing the solution, and if the two individuals are not, selecting a winner to store to the next generation based on the following rule:
the K local feasible solution is superior to the K local non-feasible solution;
selecting a solution with a better objective function value when two K local feasible solutions compete;
selecting a solution with K local constraint sequencing at the front when two K local non-feasible solutions compete;
from P by the method of S3.4 t After all individuals are selected by the U Q, the stored offspring is marked as P t+1 And the evolution algebra t=t+1, returning to S3.2 until the maximum evolution algebra G is reached max And outputting the optimal solution to obtain the cure rate of all the nodes.
6. A terminal device according to any one of claims 1 to 4, comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that the steps of the foregoing method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization are implemented by the processor when executing the computer program.
7. A computer readable storage medium based on any one of claims 1 to 4, the computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the foregoing method for optimizing an infectious disease propagation treatment model based on K-nearest neighbor constraint optimization.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110663148.3A CN113539511B (en) | 2021-06-15 | 2021-06-15 | Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110663148.3A CN113539511B (en) | 2021-06-15 | 2021-06-15 | Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113539511A CN113539511A (en) | 2021-10-22 |
CN113539511B true CN113539511B (en) | 2023-06-06 |
Family
ID=78124969
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110663148.3A Active CN113539511B (en) | 2021-06-15 | 2021-06-15 | Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113539511B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102663514A (en) * | 2012-03-22 | 2012-09-12 | 长沙理工大学 | Constrained optimization evolution algorithm based on feasible equilibrium mechanism |
CN103699720A (en) * | 2013-12-09 | 2014-04-02 | 浙江大学 | High-speed press slider mechanism size optimization method based on interval constraint violation degrees |
CN104778513A (en) * | 2015-04-13 | 2015-07-15 | 哈尔滨工程大学 | Multi-population evolution method for constrained multi-objective optimization |
-
2021
- 2021-06-15 CN CN202110663148.3A patent/CN113539511B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102663514A (en) * | 2012-03-22 | 2012-09-12 | 长沙理工大学 | Constrained optimization evolution algorithm based on feasible equilibrium mechanism |
CN103699720A (en) * | 2013-12-09 | 2014-04-02 | 浙江大学 | High-speed press slider mechanism size optimization method based on interval constraint violation degrees |
CN104778513A (en) * | 2015-04-13 | 2015-07-15 | 哈尔滨工程大学 | Multi-population evolution method for constrained multi-objective optimization |
Non-Patent Citations (1)
Title |
---|
基于改进粒子群优化算法的约束多目标优化;阳春华;莫志勋;李勇刚;;计算机工程(第20期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113539511A (en) | 2021-10-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Xia et al. | An expanded particle swarm optimization based on multi-exemplar and forgetting ability | |
CN110728401B (en) | Short-term power load prediction method of neural network based on squirrel and weed hybrid algorithm | |
Zhou et al. | Randomization in particle swarm optimization for global search ability | |
CN112346839B (en) | Associated task scheduling method based on evolutionary algorithm | |
Liu et al. | An adaptive online parameter control algorithm for particle swarm optimization based on reinforcement learning | |
Luo et al. | Novel grey wolf optimization based on modified differential evolution for numerical function optimization | |
CN111709511A (en) | Harris eagle optimization algorithm based on random unscented Sigma point variation | |
Zhang et al. | A complex-valued encoding satin bowerbird optimization algorithm for global optimization | |
CN108448659B (en) | Method for solving reactive power optimization of power system based on HACS algorithm | |
CN110738362A (en) | method for constructing prediction model based on improved multivariate cosmic algorithm | |
CN114741955A (en) | Multi-objective optimization task scheduling method based on security cloud | |
CN116760047A (en) | Power distribution network voltage reactive power control method and system based on safety reinforcement learning algorithm | |
Żychowski et al. | Addressing expensive multi-objective games with postponed preference articulation via memetic co-evolution | |
CN114997261A (en) | Resident electric power data clustering method and system | |
CN114662638A (en) | Mobile robot path planning method based on improved artificial bee colony algorithm | |
CN113539511B (en) | Infectious disease transmission treatment model optimization method based on K nearest neighbor constraint optimization | |
US6910192B2 (en) | Method of robust technology design using rational robust optimization | |
Xie et al. | Cloud computing resource scheduling based on improved differential evolution ant colony algorithm | |
Wen et al. | A multi-objective optimization method for emergency medical resources allocation | |
CN109378036A (en) | A kind of Heuristic Method based on two-line hybrid rice breeding mechanism | |
CN115393108A (en) | Financial risk control method, device and equipment | |
Kuliev et al. | Mechanisms of swarm intelligence and evolutionary adaptation for solving PCB design tasks | |
CN108805254A (en) | Parameter Optimization System for time series forecasting | |
Madureira et al. | Ant colony system based approach to single machine scheduling problems: weighted tardiness scheduling problem | |
CN117251280B (en) | Cloud resource load balancing scheduling method, device, equipment and medium |
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 |