A family composition method based on improved hungarian algorithm

CN117476105BActive Publication Date: 2026-08-18BEIJING HUADU YUKOU POULTRY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311412370.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2026-08-18
Estimated Expiration
2043-10-27

AI Technical Summary

Technical Problem

[0007]为了克服上述缺陷,提出了本发明,以提供解决或至少部分地解决现有技术对于家禽母鸡家系组配方法具有逻辑简单、效率低的技术问题

Benefits of technology

[0045] In implementing the technical solution of this invention, by defining the kinship value between live males and live females, and using the kinship value to define weighted marker values ​​and difference values, the variable initialization process uses the overlap rate of the two parents as the weight for pairing, so that all selected excellent individuals have the opportunity to participate in pairing, and can ultimately achieve the greatest overall kinship of all pairing combinations, thereby maximizing the utilization of excellent traits, preventing the population size from shrinking, and ensuring the genetic characteristics and stability of each hen family.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117476105B_ABST
    Figure CN117476105B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of poultry breeding, and specifically provides a family composition method based on an improved Hungarian algorithm, aiming to solve the technical problems of the prior art that the hen grouping method in poultry breeding has simple logic and low efficiency. To this end, the present application comprises the following steps: S1: defining listA, listB, and a relationship value relationAB; S2: initializing the array listA, the array listB, and the relationship value relationAB; S3: for each male living body in listA, constructing a used list, and initializing the values in the used list to False; S4: starting from the first male living body in listA, traversing the female living bodies in listB to perform first grouping; S5: if the first grouping is successful, performing the first grouping on the next male living body, and if the first grouping is not successful, performing second grouping; S6: repeating S4-S5 until all male living bodies in listA are successfully grouped; and S7: constructing a grouping list matchPairs according to the grouping result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of poultry breeding technology, specifically providing a pedigree composition method based on an improved Hungarian algorithm. Background Technology

[0002] In poultry breeding, especially in the process of establishing hen pedigrees, selecting the optimal rooster and hen pairing is a crucial and complex issue. Specialized poultry breeds typically undergo a selection phase before mating. Based on various traits such as growth rate, disease resistance, and body size, a subset of superior individuals are chosen. Then, the optimal rooster and hen are precisely selected from these superior individuals to maximize the offspring's production performance and other desirable traits. Improper mating can lead to close kinship between the rooster and hen, resulting in increased inbreeding levels in the offspring, reduced production performance, and wasted genetic potential from these superior parents. This results in an unsatisfactory hen pedigree establishment. Such outcomes not only lead to poor breeding results but also waste resources and increase production costs.

[0003] In existing technologies, there are two common methods for selecting roosters and hens in poultry breeding: manual calculation and analysis, and program loop iteration.

[0004] Manual calculation and analysis involves professional breeders collecting and analyzing various information about roosters and hens, including their traits, genetic background, and growth status. Then, based on this information and the breeder's expertise or experience, calculations and analysis are performed to determine which rooster and hen are most likely to produce superior offspring. However, this method has some drawbacks. First, the manual calculation and analysis process is both time-consuming and labor-intensive, and errors can be introduced due to human factors. Second, this method relies heavily on the breeder's experience and does not systematically consider all possible genetic factors, potentially leading to suboptimal selection results. Therefore, manual calculation and analysis cannot meet the needs of large-scale hen family breeding.

[0005] The program uses a loop to traverse and pair roosters and hens. This method involves iterating through all possible combinations and selecting the optimal one. However, this method has drawbacks. The program uses a loop to brute-force all possible combinations, then iterates through them to find the optimal pair. While logically simple, this approach is very inefficient. When faced with large-scale breeding needs, the increased number of individuals leads to an exponential increase in computation time, making it impossible to effectively complete hen family formation within the pairing window in breeding practice.

[0006] In conclusion, existing poultry hen pedigree composition techniques, whether using manual calculation and analysis or computer program traversal, have significant shortcomings. Summary of the Invention

[0007] In order to overcome the above-mentioned defects, the present invention is proposed to provide a solution or at least a partial solution to the technical problem that the existing methods for breeding poultry hens are logically simple and inefficient.

[0008] This invention proposes a pedigree composition method based on an improved Hungarian algorithm, comprising the following steps:

[0009] S1: Define an array listA representing the set of live males, an array listB representing the set of live females, and a relationAB value between each live male in listA and each live female in listB.

[0010] S2: Initialize arrays listA and listB, and the relation values ​​relationAB;

[0011] S3: For each male live animal in listA, construct a used list and initialize the values ​​in the used list to False. Each value in the used list represents whether each female live animal in listB has been considered in the current pairing of male live animals.

[0012] S4: Starting with the first live male in listA, traverse the live females in listB to perform the first mating;

[0013] S5: If the first mating is successful, the next live male will be mated for the first time. If the first mating is unsuccessful, the second mating will be performed.

[0014] S6: Repeat S4-S5 until all male live animals in listA successfully mate;

[0015] S7: Based on the matching results, construct a list of matching pairs.

[0016] Furthermore, step S1 includes:

[0017] S11: Define a set of instances for each live subject, the instances including live subject ID id, matched object matched, and weight tag value;

[0018] S12: Based on the sex of the living beings, all instances of the living beings are assigned to arrays listA and listB respectively;

[0019] S13: Define the kinship value relationAB between each male living organism in listA and each female living organism in listB.

[0020] Furthermore, step S2 includes:

[0021] Sort the live instances in the array in descending order of performance. The array with fewer instances is filled from the first instance in the array to the end of the array, until the number of instances in the two arrays is the same.

[0022] Configure the liveness ID for each instance in listA and listB sequentially, starting from 0.

[0023] Set the matched object for each instance to -1;

[0024] Calculate the probability that each male living parent in listA and each female living parent in listB have different parents, and obtain the kinship value relationAB.

[0025] For each male, find the female with the highest kinship value maxRelationAB, set the weight value of the male to the highest kinship value maxRelationAB, and set the weight value of the female to 0.

[0026] Furthermore, for a specific male live animal with ID id i, the first mating process includes the following steps:

[0027] S41: Initialize j = 0, where j represents the female live animal ID in the current pairing;

[0028] S42: Determine whether the live animal ID id of the instance in listB includes j. If yes, execute S43. If no, the first mating of the current male live animal is unsuccessful.

[0029] S43: Calculate the gap value between the male live animal with ID i in listA and the female live animal with ID j in listB: gap = listA[i].value + listB[j].value - relationAB[i][j], where i represents the ID of the male live animal in the current pairing;

[0030] S44: Determine whether the difference value is 0. If it is, update the considered status used[j] of the female live animal with ID j in listB to True. If not, update j = j + 1 and return to S42.

[0031] S45: Determine whether the female live animal with ID j in listB can be paired with the male live animal with ID i in listA. If yes, execute S46; otherwise, update j = j + 1 and return to S42.

[0032] S46: Update the matched object of the female live animal with ID j in listB to i. The first pairing of the current male live animal is successful.

[0033] Furthermore, step S45 includes:

[0034] S451: Determine if the matched object of the female live animal with ID j in listB is -1. If yes, execute S46; otherwise, execute S452.

[0035] S452: Re-match the matched object of the female live body with ID j in listB, and try to find another female live body other than the female live body with ID j so that the gap value between the two can be 0.

[0036] S453: Determine whether S452 was successfully assembled. If yes, execute S46. If no, update j = j + 1 and return to S42.

[0037] Furthermore, the second assembly includes the following steps:

[0038] S51: Calculate the gap between the currently unsuccessfully mated male and all females in listB whose used value is False;

[0039] S52: Obtain the minimum gap value. min ;

[0040] S53: Update the weight marker value of all male live animals participating in the first mating of the current male live animals in listA. 新 =value 旧 -gap min ;

[0041] S54: Update the weight flag value of female live animals in listB whose used value is True. 新 =value 旧 +gap min ;

[0042] S55: For the male live animals that failed to mate successfully in the current process, mate them again in the manner described in steps S41-S47;

[0043] S56: Repeat S51-S55 until the assembly is successful.

[0044] The working principle and beneficial effects of this invention are as follows:

[0045] In implementing the technical solution of this invention, by defining the kinship value between live males and live females, and using the kinship value to define weighted marker values ​​and difference values, the variable initialization process uses the overlap rate of the two parents as the weight for pairing, so that all selected excellent individuals have the opportunity to participate in pairing, and can ultimately achieve the greatest overall kinship of all pairing combinations, thereby maximizing the utilization of excellent traits, preventing the population size from shrinking, and ensuring the genetic characteristics and stability of each hen family. Attached Figure Description

[0046] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Furthermore, similar numbers in the drawings are used to denote similar components, wherein:

[0047] Figure 1 This is a schematic flowchart of the main steps of the family composition method based on the improved Hungarian algorithm according to the present invention;

[0048] Figure 2 This is a schematic diagram illustrating the probability of parental overlap in the third generation in the family composition method based on the improved Hungarian algorithm according to the present invention.

[0049] Figure 3 This is a flowchart illustrating the main steps of the init function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention.

[0050] Figure 4 This is a flowchart illustrating the main steps of the findMate function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention.

[0051] Figure 5 This is a schematic diagram of the main steps of the mateMine function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention. Detailed Implementation

[0052] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0053] In hen pedigree formation, the pairing of roosters and hens is crucial for improving breeding outcomes. Since the number of roosters and hens is usually inconsistent, a single rooster typically needs to be paired with multiple hens. During the pairing process, it is essential to ensure that all selected superior roosters and hens are fully utilized to maximize their excellent traits and avoid wasting these valuable genetic resources. Furthermore, it is necessary to maintain population size and preserve the genetic characteristics of each hen pedigree. In addition, to prevent genetic defects and infectious diseases caused by inbreeding, this invention optimizes pairing combinations, selecting roosters and hens with the most distant kinship possible for pairing.

[0054] This invention proposes a pedigree composition method based on an improved Hungarian algorithm. This method ensures that all selected superior individuals have the opportunity to participate in pairing, and maximizes the overall kinship of all pairings, thereby maximizing the utilization of superior traits, preventing population shrinkage, and guaranteeing the genetic characteristics and stability of each hen pedigree. The embodiments of this invention use broiler breeding as an example to illustrate the above-mentioned hen pedigree composition method based on the improved Hungarian algorithm.

[0055] Example 1

[0056] Figure 1 This is a schematic flowchart illustrating the main steps of the family composition method based on the improved Hungarian algorithm according to the present invention. Figure 1 As shown, the pedigree composition method based on the improved Hungarian algorithm in this embodiment of the invention mainly includes the following steps S1-S7.

[0057] Step S1: Define an array listA representing the set of live males, an array listB representing the set of live females, and a kinship value relationAB between each live male in listA and each live female in listB.

[0058] Furthermore, step S1 specifically includes:

[0059] Step S11: Taking broiler breeding as an example, to implement the pairing of hens and roosters, first define a class named Chicken. Each Chicken instance represents one rooster or one hen. This class has the following attributes:

[0060] id: Represents the chicken's ID number;

[0061] `matched`: The matching object, representing the ID of the chicken that matched it. Initialized to -1, indicating no match. For example, `listA[i].matched = j` means that the element with ID `i` in `listA` is matched with the element with ID `j` in `listB`.

[0062] value: Weighting marker. This value is dynamically adjusted during the algorithm's execution. It represents the weighting marker for each chicken during the pairing process, with the goal of ensuring that the sum of the values ​​of all paired roosters and hens equals their pairing weight, i.e., their kinship value.

[0063] Step S12: Create two arrays, listA and listB, whose elements are instances of the Chicken class. Based on the sex of the live animals, listA contains instances of roosters, and listB contains instances of hens.

[0064] Step S13: Define a two-dimensional array relationAB, which represents the kinship value between roosters in listA and hens in listB. For example, relationAB[i][j] represents the kinship value between the i-th rooster in listA and the j-th hen in listB.

[0065] Step S2: Initialize arrays listA and listB, and the relationship values ​​relationAB.

[0066] In this embodiment, assume there are p roosters and q hens. First, sort the p roosters according to their performance from highest to lowest, forming a set A = {a1, a2, a3, ..., a...}. p Similarly, we define q hens as a set B = {b1, b2, b3, ..., b}. q}. Usually, there are more hens than roosters, i.e., q > p. To maintain the same number of elements in set A (roosters) as in set B (hens), elements from set A are sequentially added to set A so that the number of elements in set A equals the number in set B, i.e., A = {a1, a2, a3, ..., a...} n If the elements in set A are not expanded, the number of elements in set A and set B will not be equal. Therefore, when executing this scheme to match the elements in set A in sequence, after all the elements in set A are matched, there will inevitably be a situation where there are still some unmatched hens in set B.

[0067] The strategy of "pairing roosters and hens with the most distant kinship" is transformed into a "pairing weight" in the pairing algorithm. In this embodiment, the more distant the kinship between a pair, the greater its pairing weight. Substituting the obtained listsA and B as parameters into the pairing algorithm of this embodiment calculates and outputs the optimal pairing result that satisfies the conditions. This result should ensure that all roosters and hens are paired and maximize the overall pairing weight, that is, the overall kinship of all pairs is maximized.

[0068] In this embodiment, n=3, that is, the probability of overlap of the third-generation parents is selected as the basis for calculating the kinship value relationAB. Figure 2 This is a schematic diagram illustrating the probability of parental overlap in the third generation in the pedigree composition method based on the improved Hungarian algorithm according to the present invention. Figure 2 As shown in the figure, assuming a is the rooster with ID 0 and b is the hen with ID 0, it can be seen from the figure that only 109 and 110 are the overlapping parents in the third generation. Therefore, the proportion of different parents is 3 / 4, that is, relationAB[0][0] = 3 / 4.

[0069] Step S3: For each live male in listA, construct a used list and initialize the values ​​in the used list to False. Each value in the used list represents whether each live female in listB has been considered in the mating process.

[0070] Step S4: Find feasible pairings. Starting with the first live male in listA, iterate through the live females in listB to perform the first pairing.

[0071] Furthermore, for a specific male live animal with ID id i, its first mating specifically includes:

[0072] S41: Initialize j = 0, where j represents the female live animal ID in the current pairing.

[0073] S42: Determine whether the live animal ID id of the instance in listB includes j. If yes, execute S43. If no, the first mating of the current male live animal will fail.

[0074] S43: Calculate the gap value gap between the male live animal with ID i in listA and the female live animal with ID j in listB = listA[i].value + listB[j].value - relationAB[i][j], where i represents the ID of the male live animal in the current pairing.

[0075] In this embodiment, `gap` represents the sum of the value of the rooster and hen's tags, which should be close to their kinship weight. If `gap` equals 0, it means the sum of the rooster and hen's values ​​equals their kinship weight, indicating a good pairing. In this case, the rooster and hen are marked as paired. If `gap` is not equal to 0, it means there is a gap between the sum of the rooster and hen's values ​​and their kinship weight. In this case, the algorithm will try to find other possible pairings. The purpose of calculating `gap` is to make the sum of the values ​​of the paired rooster and hen as close as possible to their kinship weight, thereby maximizing the overall value of the pairing and achieving the optimization objective.

[0076] S44: Determine whether the difference value is 0. If it is, update the considered status used[j] of the female live animal with ID j in listB to True. If not, update j++ and return to S42.

[0077] S451: Determine if the matched object of the female live animal with ID j in listB is -1. If yes, execute S46; otherwise, execute S452.

[0078] S452: Re-match the matched object of the female live body with ID j in listB, and try to find another female live body other than the female live body with ID j so that the gap value between the two can be 0.

[0079] S453: Determine whether S452 was successfully assembled. If yes, execute S46; otherwise, update j++ and return to S42.

[0080] S46: Update the matched object of the female live animal with ID j in listB to i. The first pairing of the current male live animal is successful.

[0081] S5: If the first mating is successful, the next live male will be mated for the first time. If the first mating is unsuccessful, the second mating will be performed.

[0082] Furthermore, the second assembly specifically includes:

[0083] Step S51: Calculate the gap value between the currently unsuccessfully mated male and all the females in listB whose used value is False;

[0084] Step S52: Obtain the minimum gap value. min ;

[0085] Step S53: Update the weight flag values ​​of all male live animals participating in the first mating of the current male live animals in listA. 新 =value 旧 -gap min The phrase "all males participating in the first mating of the current male" means that, for the best female calculated during the current mating process that has a GAP value of 0, if the best female already has males participating in the mating, the weight values ​​of the males already mated with the best female will also be changed.

[0086] Step S54: Update the weight flag value of female live animals in listB whose used value is True. 新 =value 旧 +gap min ;

[0087] Step S55: For the male live animals that failed to mate successfully in the current process, mate them again in the manner described in steps S41-S47;

[0088] Step S56: Repeat steps S51-S55 until the assembly is successful.

[0089] In this embodiment, the second pairing involves re-performing the first pairing after modifying the weighted marker values ​​(values) of the rooster and hen. The reason for modifying the weighted marker values ​​of the females (hens that were paired) with a used value of True for roosters that failed to pair is to ensure that the gap value (gap) between paired roosters and hens remains 0. In other words, if the difference between the kinship value of a rooster and a hen and the sum of their values ​​is zero during pairing, then they can be paired. If no pair is found, the values ​​of all roosters and hens participating in the pairing search are adjusted to increase the probability of finding a pair in the next search.

[0090] For roosters that failed to mate, a new hen needs to be found. At this point, the search can only be conducted among hens with a `used` value of `False`, because hens with a `used` value of `True` have already been identified as unsuitable for mating in the `findMate` function. If the original weighted value `value` is used to calculate the gap, the final result will be the same as before, where the kinship value `relation` remains unchanged. To enable the currently unmated rooster to find a hen that can mate, the weighted value `value` must be adjusted so that the current rooster can mate with a new hen (one whose gap value calculated in the first mating is not 0, i.e., a hen with a `used` value of `False`). The calculated gap value will change from a non-zero value to 0, which requires subtracting the original gap value from the rooster's `value`.

[0091] This invention modifies the values ​​of all roosters participating in the first mating of the current male live animals and the values ​​of all hens marked as True because, after adjusting the values, when the current rooster is re-mated using the findMate function, in order not to affect the used values ​​of the hens originally marked as True (i.e., to ensure that the gap value calculated between the current rooster and the hens originally marked as True remains 0), it is necessary to change the values ​​of all hens marked as True. Consequently, since the hens originally marked as True all have original mating partners, step S462 needs to be executed. In order not to affect the gap result of this step, the values ​​of all other roosters participating in the first mating of the current male live animals also need to be adjusted.

[0092] Step S6: Repeat S4-S5 until all male live animals in listA are successfully mated.

[0093] Regarding step S6, it should be noted that after the second pairing, that is, after adjusting the VALUE value, the male live animals that failed to pair in the first pairing may still fail to pair. In this case, the VALUE value needs to be adjusted again and the pairing is performed again. In other words, the "first pairing" and "second pairing" in the so-called "first pairing" and "second pairing" do not refer to the order of the steps, but to the principle of pairing. It can be understood that the first pairing is direct pairing, and the second pairing is pairing after adjusting the VALUE.

[0094] Step S7: Based on the matching results, construct the matching list matchPairs.

[0095] In this embodiment, after all roosters in listA have been paired, a pairing list matchPairs is created, where each pairing consists of the rooster's ID and the hen's ID.

[0096] Based on the above steps S1-S7, by defining the kinship value between live males and live females, and using the kinship value to define weighted marker values ​​and difference values, the variable initialization process uses the overlap rate of the two parents as the weight for pairing, so that all selected excellent individuals have the opportunity to participate in pairing, and can ultimately achieve the greatest overall kinship of all pairing combinations, thereby maximizing the utilization of excellent traits, preventing the population size from shrinking, and ensuring the genetic characteristics and stability of each hen family.

[0097] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0098] Example 2

[0099] This embodiment proposes an init function, which is used in the computer to handle the initialization of the above step S2. Figure 3 This is a flowchart illustrating the main steps of the `init` function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention. Here, `listA.size` and `listB.size` represent the number of instances in array `listA` and array `listB`, respectively, i.e., the actual number of roosters and hens. Assuming there are initially 4 roosters (numbered A0, A1, A2, A3) and 7 hens (numbered B0, B1, B2, B3, B4, B5, B6), then `listA.size` in the diagram is 4, and `listB.size` is 7. Figure 3 As shown, the init function includes the following steps:

[0100] Step a: Initialize i = 0, where i represents the rooster number id in the current group.

[0101] Step b: Determine if i < listB.size is true, that is, determine if the hen number id in listB includes i. If not true, the init function ends (meaning the traversal cycle has ended and initialization has been completed). If true, proceed to step c.

[0102] Step c: Determine if i ≥ listA.size is true, that is, determine if the rooster ID in listA does not include i. If not true, execute step e (meaning the current number of roosters can satisfy the current traversal cycle). If true (meaning the current number of roosters has been traversed, and in the next traversal cycle, an additional rooster instance needs to be added), execute step d.

[0103] Step d: Add the number of rooster instances to the listA array, corresponding to listA.add(listA.get(1%A.size)) in the diagram. For example, for the 5th traversal cycle, since i=4 equals the number of roosters, the fifth rooster instance will loop back to the first rooster A0, with A0 as the fifth rooster instance. That is, A0 and A4 are actually the same rooster. Then execute the following steps.

[0104] Steps b-d aim to replenish the number of instances in array listA to match the number of instances in array listB. Since the number of hens is generally greater than the number of roosters, to achieve pairing all hens, there will inevitably be situations where one rooster is paired with two or more hens. This invention allows for pairing elements from two sets with the same number of hens one-to-one. Therefore, high-performing roosters are added sequentially to the end of set A, meaning that high-performing roosters are paired with two or more hens.

[0105] Step e: Query all parents of the rooster numbered i in listA up to the third generation and all parents of the hens in listB up to the third generation.

[0106] Step f: Initialize j = 0, where j represents the hen number id in the current group.

[0107] Step g: Determine if j < listB.size is true. If not, proceed to step k. If true, proceed to step h.

[0108] Step h: Calculate the kinship value relationAB[i][j].

[0109] Step i: Update the maximum kinship value maxRelationAB.

[0110] Step j: Update j++ and return to step g;

[0111] Step k: Set the weight label value of the rooster with the current number i to the maximum kinship value maxRelationAB.

[0112] Step 1: Update i++ and return to step b.

[0113] Step m: Set the value of all hens in listB to 0.

[0114] Example 3

[0115] This embodiment proposes a findMate function, which is used in a computer to process the first mating step for a live male (numbered i) in step S4 described above. Figure 4 This is a schematic diagram illustrating the main steps of the findMate function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention. Figure 4 As shown, the findMate function includes the following steps:

[0116] Step i: Initialize j = 0, where j represents the hen number id in the current group.

[0117] Step ii: Determine if j < listB.size is true, that is, determine if the hen's ID in listB includes j. If yes, proceed to step iii; otherwise, the first mating of the current rooster will fail.

[0118] Step iii: Calculate the difference between the rooster with id i in listA and the hen with id j in listB.

[0119] gap=listA[i].value+listB[j].value-relationAB[i][j].

[0120] Step iv: Determine if the difference value is 0. If it is, update the considered status used[j] of the hen with ID j in listB to True. If not, update j++ and return to step ii.

[0121] Step v: Determine if the matched object of the hen with ID j in listB is -1. If yes, the pairing is successful, update the matched object of the hen with ID j in listB to i, and the first pairing of the current rooster is successful. If not, proceed to step vi.

[0122] Step ⅵ: Re-match the matched object (hereinafter referred to as the prior rooster) of the hen with ID j in listB and see if it can find other hens besides the hen with ID j.

[0123] Step 17: Determine whether Step 15 was successfully assembled;

[0124] If so, the rooster will be paired with all hens except the one with ID j, the hen with ID j will be paired with the rooster i that is currently being paired, and the pairing process of the current rooster will end.

[0125] If not, update j++ and return to step ii.

[0126] Steps v and vi correspond to Figure 4 The function `listB[j].matched == -1 or findMate(listB[j].matched)` is used in steps v-vii. Steps v-vii address the possibility that, even if a hen has already been paired, the Hungarian algorithm allows it to re-pair with another rooster if a match is found for that rooster. This is why `findPath` checks not only whether a hen is unpaired but also whether its currently paired rooster can pair with another hen. For example, suppose rooster A is paired with hen X, and rooster B is trying to find a match. During a re-call of the `findMate` function, it might be discovered that rooster B has a closer kinship with hen X. In this case, it will try to find another hen, such as hen Y, as a match for rooster A. If successful, rooster B will pair with hen X, and rooster A will pair with hen Y.

[0127] If the first combination fails, the VALUE value needs to be adjusted for a second combination.

[0128] Example 4

[0129] This embodiment proposes a mateMine function, which is used in a computer to process and implement the above steps S1-S7. Figure 5 This is a schematic diagram illustrating the main steps of the mateMine function in the pedigree composition method based on the improved Hungarian algorithm according to the present invention. Figure 5 As shown, the mateMine function includes the following steps:

[0130] Step A: Call the init function to initialize.

[0131] Step B: Initialize i = 0, where i represents the rooster ID in the current group.

[0132] Step C: Determine if i < listA.size is true, that is, determine if the rooster ID in listA includes i. If not true (meaning all roosters have been paired), proceed to step V. If true, proceed to step D.

[0133] Step D: Construct a used list and initialize the values ​​in the used list to False. The values ​​in the used list represent whether each female live animal in listB has been considered in the mating process.

[0134] Step E: Call the findMate function to perform the first mating of the rooster with ID i. If the first mating fails (i.e. Figure 5 If findMate(i) == False, proceed to step F. If the first pairing is successful, proceed to step U.

[0135] Step F: Define variable d.

[0136] Step G: Initialize j = 0, where j represents the hen number id in the current group.

[0137] Step H: Determine whether j < listB.size is true, that is, determine whether the hen number id in listB includes j. If not true, proceed to step L; if true, proceed to step I.

[0138] Step I: Determine if the used value of the hen with ID j is False. If yes, proceed to step J; otherwise, proceed to step K.

[0139] Step J: Calculate the gap value gap between the rooster with ID i and the hen with ID j, and update d to the minimum gap value.

[0140] Step K: Update j++, then return to step H.

[0141] Step L: Initialize x = 0, where x represents the rooster's ID.

[0142] Step M: Determine whether x < listA.size is true, that is, determine whether the rooster's ID in listA includes x. If not, proceed to step P; if true, proceed to step N.

[0143] Step N: Update the weight tag value of the rooster with ID x in listA. 新 =value 旧 -gap min .

[0144] Step O: Update x++, return to step M.

[0145] Step P: Initialize y = 0, where y represents the hen's ID.

[0146] Step Q: Determine if y < listB.size is true, that is, determine if the hen ID in listB includes y. If not, proceed to step D (that is, the VALUE value has been completely updated, and the rooster i is re-paired). If true, proceed to step R.

[0147] Step R: Determine if the used value of the hen with ID y is True. If yes, proceed to step S; otherwise, proceed to step T.

[0148] Step S: Update the weight tag value of the hen with ID y in listB. 新 =value 旧 +gap min

[0149] Step T: Update y++, return to step Q.

[0150] Step U: Update i++, return to step C.

[0151] Step V: Based on the matching results, construct the matching list matchPairs.

[0152] Step W: Return the list of matchPairs.

[0153] Example 5

[0154] To further clarify the family formation method described in this invention, this embodiment provides a specific implementation scenario for a grouping scenario. In this embodiment, the live animals to be grouped include 4 roosters (A0, A1, A2, A3) and 7 hens (B0, B1, B2, B3, B4, B5, B6), which are presumably sorted by performance from best to worst.

[0155] 1. To facilitate computer program calculations, first define a separate set of instances for each rooster and each hen, placing the rooster instances in array `listA` and the hen instances in array `listB`. Since the number of roosters is less than the number of hens, we need to add the instances of the better-performing roosters from `listA` back to `listA` until both sets of hens have the same number, ultimately resulting in:

[0156] listA includes instances: listA[0], listA[1], listA[2], listA[3], listA[4], listA[5], listA[6], (corresponding to roosters A0, A1, A2, A3, A0, A1, A2 respectively);

[0157] ListB includes instances: listB[0], listB[1], listB[2], listB[3], listB[4], listB[5], listB[6], (corresponding to hens B0, B1, B2, B3, B4, B5, B6 respectively).

[0158] 2. Calculate the relationship value (relationAB) between each group of instances in listA and each group of instances in listB, and obtain the following Table 1.

[0159] Table 1: Kinship values ​​between roosters and hens

[0160]

[0161]

[0162] The weighted values ​​of the rooster and hen at the initialization can be calculated using the above kinship values.

[0163] The initialization of the rooster array listA yields the following Table 2.

[0164] Table 2: Initialize a rooster instance

[0165] listA[0] 0 1 -1 listA[1] 1 7 / 8 -1 listA[2] 2 7 / 8 -1 listA[3] 3 1 -1 listA[4] 4 1 -1 listA[5] 5 7 / 8 -1 listA[6] 6 7 / 8 -1

[0166] The initialization of the rooster array listA yields the following Table 3.

[0167] Table 3: Initializing Hen Instances

[0168] listB[0] 0 0 -1 listB[1] 1 0 -1 listB[2] 2 0 -1 listB[3] 3 0 -1 listB[4] 4 0 -1 listB[5] 5 0 -1 listB[6] 6 0 -1

[0169] 3. Starting with the first rooster, execute the findmate function to perform the first pairing.

[0170] 3.1 listA[0]

[0171] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0172] Calculate the gap between listA[0] and listB[0] = 1 + 0 - (1 / 8) = 7 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0173] Calculate the gap between listA[0] and listB[1] = 1 + 0 - (1 / 4) = 3 / 4. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0174] Calculate the gap between listA[0] and listB[2] = 1 + 0 - (1 / 8) = 7 / 8. Since gap ≠ 0, the used value of the mother listB[2] is still False.

[0175] Calculate the gap between listA[0] and listB[3]: 1 + 0 - 1 = 0. Since gap = 0, modify the used value of the current hen listB[3] to True. Also, since the matched value of the current hen listB[3] is -1, we can directly pair the hen listB[3] with the rooster listA[0], and modify the matched value of the current hen listB[3] to 0. (Here, 0 represents the ID of the matched rooster.)

[0176] The current rooster listA[0] has been successfully assembled. Proceed to assemble the next rooster.

[0177] 3.2listA[1]

[0178] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0179] Calculate the gap between listA[1] and listB[0] = (7 / 8) + 0 - (1 / 2) = 3 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0180] Calculate the gap between listA[1] and listB[1] = (7 / 8) + 0 - (3 / 8) = 1 / 2. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0181] Calculate the gap between listA[1] and listB[2] = (7 / 8) + 0 - (7 / 8) = 0. Since gap = 0, modify the used value of the current female chicken listB[2] to True. And since the matched value of the current female chicken listB[2] is -1, the female chicken listB[2] can be directly paired with the male chicken listA[1]. Modify the matched value of the current female chicken listB[2] to 1. (Here, 1 represents the ID of the matched male chicken.)

[0182] The current rooster listA[1] has been successfully assembled. Proceed to assemble the next rooster.

[0183] 3.3listA[2]

[0184] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0185] Calculate the gap between listA[2] and listB[0] = (7 / 8) + 0 - (3 / 4) = 1 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0186] Calculate the gap between listA[2] and listB[1] = (7 / 8) + 0 - (1 / 8) = 3 / 4. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0187] Calculate the gap between listA[2] and listB[2] = (7 / 8) + 0 - (5 / 8) = 1 / 4. Since gap ≠ 0, the used value of the mother listB[2] is still False.

[0188] Calculate the gap between listA[2] and listB[3] = (7 / 8) + 0 - (1 / 2) = 3 / 8. Since gap ≠ 0, the used value of the mother listB[3] is still False.

[0189] Calculate the gap between listA[2] and listB[4] = (7 / 8) + 0 - (3 / 8) = 1 / 2. Since gap ≠ 0, the used value of the mother listB[4] is still False.

[0190] Calculate the gap between listA[2] and listB[5] = (7 / 8) + 0 - (7 / 8) = 0. Since gap = 0, modify the used value of the current female chicken listB[5] to True. And since the matched value of the current female chicken listB[5] is -1, we can directly pair the female chicken listB[5] with the male chicken listA[2]. Modify the matched value of the current female chicken listB[5] to 2. (Here, 2 represents the ID of the matched male chicken.)

[0191] The current rooster listA[2] has been successfully assembled. Proceed to assemble the next rooster.

[0192] 3.4listA[3]

[0193] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0194] Calculate the gap between listA[3] and listB[0] = 1 + 0 - (3 / 8) = 5 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0195] Calculate the gap between listA[3] and listB[1] = 1 + 0 - 1 = 0. Since gap = 0, modify the used value of the current female chicken listB[1] to True. And since the matched value of the current female chicken listB[1] is -1, the female chicken listB[1] can be directly paired with the male chicken listA[3]. Modify the matched value of the current female chicken listB[1] to 3. (Here, 1 represents the ID of the matched male chicken.)

[0196] The current rooster listA[3] has been successfully assembled. Proceed to assemble the next rooster.

[0197] 3.5listA[4]

[0198] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0199] Calculate the gap between listA[4] and listB[0] = 1 + 0 - (1 / 8) = 7 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0200] Calculate the gap between listA[4] and listB[1] = 1 + 0 - (1 / 4) = 3 / 4. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0201] Calculate the gap between listA[4] and listB[2] = 1 + 0 - (1 / 8) = 7 / 8. Since gap ≠ 0, the used value of the mother listB[2] is still False.

[0202] Calculate the gap between listA[4] and listB[3] = 1 + 0 - 1 = 0. Since gap = 0, modify the used value of the current hen listB[3] to True. However, since the matched value of the current hen listB[3] is 0, try to find another hen for the rooster listA[0] to mate.

[0203] Calculate the gap between listA[0] and listB[4] as 1 + 0 - (7 / 8) = 1 / 8, where gap ≠ 0;

[0204] Calculate the gap between listA[0] and listB[5] as 1 + 0 - (1 / 2) = 1 / 2, where gap ≠ 0;

[0205] Calculate the gap between listA[0] and listB[6] = 1 + 0 - (3 / 8) = 5 / 8, gap ≠ 0;

[0206] Therefore, it is impossible to find another hen for rooster listA[0] to mate with, and at this time we return to the process of rooster listA[4] and hen mating;

[0207] Calculate the gap between listA[4] and listB[4] = 1 + 0 - (7 / 8) = 1 / 8. Since gap ≠ 0, the used value of the mother listB[4] is still False.

[0208] Calculate the gap between listA[4] and listB[5] = 1 + 0 - (1 / 2) = 1 / 2. Since gap ≠ 0, the used value of the mother listB[5] is still False.

[0209] Calculate the gap between listA[4] and listB[6] = 1 + 0 - (3 / 8) = 5 / 8. Since gap ≠ 0, the used value of the hen listB[5] is still False.

[0210] Therefore, the first mating of the rooster listA[4] was unsuccessful. In this mating, the male individuals involved in the mating are listA[4] and listA[0]. The weight label value is adjusted and a second mating is carried out.

[0211] Based on the above calculations, the smallest gap between the rooster listA[4] and the hen marked as False is 1 / 8. Therefore, the weight marking values ​​of the roosters (listA[4] and listA[0]) participating in this matching are reduced by 1 / 8 (the weights of the roosters not participating in this matching remain unchanged), and the weight marking values ​​of the hen with a used value of True (listB[3]) are increased by 1 / 8, resulting in Table 4.

[0212] Table 4 Weight Label Value Update Table

[0213] listA[0] 7 / 8 listA[1] 7 / 8 listA[2] 7 / 8 listA[3] 1 listA[4] 7 / 8 listA[5] 7 / 8 listA[6] 7 / 8 listB[0] 0 listB[1] 0 listB[2] 0 listB[3] 1 / 8 listB[4] 0 listB[5] 0 listB[6] 0

[0214] After modification, the findmate function is re-executed on the rooster list[4] for the first pairing;

[0215] Calculate the gap between listA[4] and listB[0] = (7 / 8) + 0 - (1 / 8) = 3 / 4. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0216] Calculate the gap between listA[4] and listB[1] = (7 / 8) + 0 - (1 / 4) = 5 / 8. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0217] Calculate the gap between listA[4] and listB[2] = (7 / 8) + 0 - (1 / 8) = 3 / 4. Since gap ≠ 0, the used value of the hen listB[2] is still False.

[0218] Calculate the gap between listA[4] and listB[3] = (7 / 8) + (1 / 8) - 1 = 0. Since gap = 0, modify the used value of the current hen listB[3] to True. However, since the matched value of the current hen listB[3] is 0, try to find another hen for the rooster listA[0] to pair.

[0219] Calculate the gap between listA[0] and listB[4]: (7 / 8) + 0 - (7 / 8) = 0, gap = 0; because gap = 0, and the matched value of hen listB[4] is -1, hen listB[4] can be paired with rooster listA[0], modify the current matched value of hen listB[4] to 0 (where 0 represents the ID of the matched rooster), and update the matched value of hen listB[3] to 4. (where 4 represents the ID of the matched rooster)

[0220] Since the above steps are executed by a computer program, this scheme requires a gap value of 0 for successful pairing. For roosters that cannot be successfully paired, i.e., those that cannot be given the best rooster, the value is adjusted to essentially sacrifice a certain rooster (usually a rooster that conflicts with the hen with the largest kinship resource). This sacrificed rooster is then paired with a hen with the smallest gap value, so that every rooster can be paired. At the same time, from the perspective of the overall pairing effect, the best pairing is obtained.

[0221] The current rooster listA[4] has been successfully assembled. Proceed to assemble the next rooster.

[0222] 3.6listA[5]

[0223] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0224] Calculate the gap between listA[5] and listB[0] = (7 / 8) + 0 - (1 / 2) = 3 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0225] Calculate the gap between listA[5] and listB[1] = (7 / 8) + 0 - (3 / 8) = 3 / 8. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0226] Calculate the gap between listA[5] and listB[2] = (7 / 8) + 0 - (7 / 8) = 0. Since gap = 0, modify the used value of the current hen listB[2] to True. However, since the matched value of the current hen listB[2] is 1, try to find another hen for the rooster listA[1] to pair up.

[0227] Calculate the gap between listA[1] and listB[3] = (7 / 8) + (1 / 8) - (1 / 8) = 7 / 8, gap ≠ 0;

[0228] Calculate the gap between listA[1] and listB[4] = (7 / 8) + 0 - (1 / 4) = 5 / 8, gap ≠ 0;

[0229] Calculate the gap between listA[1] and listB[5] = (7 / 8) + 0 - (5 / 8) = 1 / 4, gap ≠ 0;

[0230] Calculate the gap between listA[1] and listB[6] = (7 / 8) + 0 - (7 / 8) = 0, gap = 0; because gap = 0, and the matched value of hen listB[6] is -1, hen listB[6] can be paired with rooster listA[1], modify the matched value of the current hen listB[6] to 1 (here 1 represents the ID of the rooster that is matched with it), and update the matched value of hen listB[2] to 5.

[0231] The current rooster listA[5] has been successfully assembled. Proceed to assemble the next rooster.

[0232] 3.7listA[6]

[0233] Create a used list for each hen, the same number as the number of hens, and mark whether each hen has been considered. The default value for each hen is False.

[0234] Calculate the gap between listA[6] and listB[0] = (7 / 8) + 0 - (3 / 4) = 1 / 8. Since gap ≠ 0, the used value of the mother listB[0] is still False.

[0235] Calculate the gap between listA[6] and listB[1] = (7 / 8) + 0 - (1 / 8) = 3 / 4. Since gap ≠ 0, the used value of the mother listB[1] is still False.

[0236] Calculate the gap between listA[6] and listB[2] = (7 / 8) + 0 - (5 / 8) = 1 / 4. Since gap ≠ 0, the used value of the mother listB[2] is still False.

[0237] Calculate the gap between listA[6] and listB[3] = (7 / 8) + (1 / 8) - (1 / 2) = 1 / 2. Since gap ≠ 0, the used value of the mother listB[3] is still False.

[0238] Calculate the gap between listA[6] and listB[4] = (7 / 8) + 0 - (3 / 8) = 1 / 2. Since gap ≠ 0, the used value of the mother listB[4] is still False.

[0239] Calculate the gap between listA[6] and listB[5] = (7 / 8) + 0 - (7 / 8) = 0. Since gap = 0, modify the used value of the current hen listB[5] to True. However, since the matched value of the current hen listB[5] is 2, try to find another hen for the rooster listA[2] to pair.

[0240] Calculate the gap between listA[2] and listB[6] = (7 / 8) + 0 - (5 / 8) = 1 / 4, gap ≠ 0;

[0241] Therefore, it is impossible to find another hen for rooster listA[2] to mate with, and at this time we return to the process of rooster listA[6] and hen mating;

[0242] Calculate the gap between listA[6] and listB[6] = (7 / 8) + 0 - (5 / 8) = 1 / 4. Since gap ≠ 0, the used value of the hen listB[4] is still False.

[0243] Therefore, the first mating of the rooster listA[6] was unsuccessful. In this mating, the male individuals involved in the mating are listA[6] and listA[2]. The weight label value is adjusted and a second mating is carried out.

[0244] Based on the above calculations, the smallest gap value between the rooster listA[6] and the hen marked as False is 1 / 8. Therefore, the weight flag values ​​of the roosters (listA[6] and listA[2]) participating in this matching are reduced by 1 / 8 (the weights of the roosters not participating in this matching remain unchanged), and the weight flag values ​​of the hen with a used value of True (listB[5]) are increased by 1 / 8, resulting in Table 6.

[0245] Table 6 Weight Label Value Update Table

[0246]

[0247]

[0248] After modifying the weights, the findmate function is re-executed on the rooster list[6] for the first pairing;

[0249] Calculate the gap between listA[6] and listB[0] = (3 / 4) + 0 - (3 / 4) = 0. Since gap = 0, modify the used value of the current hen listB[0] to True and the matched value of the hen listB[0] to -1. This allows the hen listB[0] to be paired with the rooster listA[6]. Modify the matched value of the current hen listB[0] to 6 (where 6 represents the ID of the rooster that is matched with it).

[0250] This completes the pairing of all the roosters.

[0251] 4. Based on the hen's match value, create a pairing list as shown in Table 7.

[0252] Table 7 Pairing List (matchPairs)

[0253]

[0254]

[0255] In this embodiment, modifying the value is limited to only two cases:

[0256] (1) When the i-th rooster cannot find a matching hen, only modify the value of this rooster;

[0257] (2) When the i-th rooster finds one or more potential hens, and the hen already has a matching rooster, and the potential hen's rooster cannot find a replacement, the values ​​of the i-th rooster, the potential hens, and the matching roosters of these potential hens need to be modified.

[0258] The purpose of modifying the value is to make it easier for the i-th rooster and those before the i-th rooster to find a match, because the modified value may have a gap value of 0 calculated with other hens, while not affecting the roosters after the i-th rooster.

[0259] Through the above embodiments 1-5, the family composition method of the present invention is obtained, and the present invention has the following advantages:

[0260] 1. By using an improved Hungarian algorithm, the problem of pairing roosters and hens during the construction of hen pedigrees in poultry breeding was effectively addressed, thus significantly improving breeding results.

[0261] 2. All selected superior individuals have the opportunity to participate in pairing, thereby maximizing the use of these individuals' superior traits and preventing the waste of valuable genetic resources.

[0262] 3. By optimizing the pairing combinations, the population size is maintained and the genetic characteristics and stability of each hen family are ensured, effectively preventing problems caused by inbreeding.

[0263] 4. Compared with traditional methods of manual calculation and analysis and computer program traversal, this invention improves efficiency and accuracy, reduces error rate, and is more suitable for handling the breeding needs of large-scale poultry hen pedigree establishment.

[0264] The following explains some of the terms involved in this invention.

[0265] Laying hens: These are chickens raised specifically to produce eggs. The main purpose of raising laying hens is to improve egg quality and maintain or increase egg production, rather than to improve the quality of chicken meat.

[0266] Broiler chickens: These are young chickens specifically raised for meat production. They are a general term for broiler chickens raised for consumption. The main purpose of raising broiler chickens is to increase their meat production and growth rate, rather than to increase their egg production.

[0267] Breeding: The process of genetically improving livestock and poultry through scientific methods such as selection, mixing, hybridization, and transgenics. The aim is to improve the production efficiency of livestock and poultry, such as meat yield, milk yield, egg production, and disease resistance.

[0268] Purebred: In poultry or pig breeding, a purebred usually refers to a group that has undergone multiple generations of homologous breeding or inbreeding, with basically stable genetic characteristics and a high degree of consistency. They have a high degree of homogeneity in terms of appearance, production performance and disease resistance.

[0269] Hen pedigrees (small pedigrees): A hen pedigree (small pedigree) typically refers to dividing a large population into multiple smaller groups, where individuals within each small group share close genetic relationships. Each hen pedigree (small pedigree) can be considered an independent breeding unit. This approach allows for more detailed management and tracking of the genetic characteristics and production performance of each hen pedigree (small pedigree), enabling more precise breeding selection and optimization. Furthermore, maintaining multiple hen pedigrees (small pedigrees) helps preserve the genetic diversity of the population, preventing genetic diseases and performance decline caused by over-selection.

[0270] Raising: refers to the process of raising and managing chicks from eggs until they gradually grow up and reach sexual maturity through proper feeding and management.

[0271] A group: A group generally refers to a group of animals with similar characteristics or living in a specific environment; in this case, it refers to a flock of chickens. The concept of a group is particularly important in breeding because overall breed improvement can be achieved by studying and manipulating the genetic characteristics of the group. In this invention, the hen (small family) pedigree is a specific group.

[0272] Individual: An individual refers to each chicken in the flock. In the breeding process, the genetic characteristics of each chicken are unique. By studying and selecting individuals, those with superior genetic traits can be identified, and breeding can be based on these individuals, thereby improving the genetic quality of the entire flock.

[0273] Crossbreeding: This refers to the genetic breeding of selected chicken individuals, choosing gene combinations from different individuals in hopes of obtaining better offspring. The process of mating different individuals and producing offspring is called "crossbreeding."

[0274] Looping: refers to an operation in computer programs, namely, the process of iterating through a set of data one by one using a loop structure.

[0275] Optimal pairing: Roosters and hens selected through one or more breeding nodes can all enter the hen (small family) lineage, and the roosters and hens in each hen (small family) lineage have the most distant kinship or no kinship.

[0276] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A pedigree composition method based on an improved Hungarian algorithm, characterized in that, Including the following steps: S1: Define an array listA representing the set of live males, an array listB representing the set of live females, and a relationAB value between each live male in listA and each live female in listB. S2: Initialize arrays listA and listB, and the relation values ​​relationAB; S3: For each male live animal in listA, construct a used list and initialize the values ​​in the used list to False. Each value in the used list represents whether each female live animal in listB has been considered in the current pairing of male live animals. S4: Starting with the first live male in listA, traverse the live females in listB to perform the first mating; S5: If the first mating is successful, the next live male will be mated for the first time. If the first mating is unsuccessful, the second mating will be performed. S6: Repeat S4-S5 until all male live animals in listA successfully mate; S7: Based on the matching results, construct a list of matching pairs; Step S1 includes: S11: Define a set of instances for each live subject, the instances including live subject ID id, matched object matched, and weight tag value; S12: Based on the sex of the living beings, all instances of the living beings are assigned to arrays listA and listB respectively; S13: Define the kinship value relationAB between each live male in listA and each live female in listB; Step S2 includes: Sort the live instances in the array in descending order of performance. The array with fewer instances is filled from the first instance in the array to the end of the array, until the number of instances in the two arrays is the same. Configure the liveness ID for each instance in listA and listB sequentially, starting from 0. Set the matched object for each instance to -1; Calculate the probability that each male living parent in listA and each female living parent in listB have different parents, and obtain the kinship value relationAB. For each male live animal, find the female live animal with the maximum kinship value maxRelationAB, set the weight label value of the male live animal to the maximum kinship value maxRelationAB, and set the weight label value of the female live animal to 0. For a live male with ID i, the first mating process includes the following steps: S41: Initialize j=0, where j represents the female live animal ID in the current pairing; S42: Determine whether the live animal ID id of the instance in listB includes j. If yes, execute S43. If no, the first mating of the current male live animal is unsuccessful. S43: Calculate the gap value between the male live animal with ID i in listA and the female live animal with ID j in listB: gap = listA[i].value + listB[j].value - relationAB[i][j], where i represents the ID of the male live animal in the current pairing; S44: Determine whether the difference value is 0. If it is, update the considered status used[j] of the female live animal with ID j in listB to True. If not, update j=j+1 and return to S42. S45: Determine whether the female live animal with ID j in listB can be paired with the male live animal with ID i in listA. If yes, execute S46; otherwise, update j=j+1 and return to S42. S46: Update the matched object of the female live animal with ID j in listB to i. The first pairing of the current male live animal is successful.

2. The pedigree composition method based on the improved Hungarian algorithm according to claim 1, characterized in that, Step S45 includes: S451: Determine if the matched object of the female live animal with ID j in listB is -1. If yes, execute S46; otherwise, execute S452. S452: Re-match the matched object of the female live body with ID j in listB, and try to find another female live body other than the female live body with ID j so that the gap value between the two can be 0. S453: Determine whether S452 was successfully assembled. If yes, execute S46. If no, update j=j+1 and return to S42.

3. The pedigree composition method based on the improved Hungarian algorithm according to claim 1, characterized in that, The second assembly includes the following steps: S51: Calculate the gap between the currently unsuccessfully mated male and all females in listB whose used value is False; S52: Obtain the minimum gap value. min ; S53: Update the weight marker value of all male live animals participating in the first mating of the current male live animals in listA. 新 =value 旧 -gap min ; S54: Update the weight flag value of female live animals in listB whose used value is True. 新 =value 旧 +gap min ; S55: For the male live animals that failed to mate successfully in the current process, mate them again in the manner described in steps S41-S47; S56: Repeat S51-S55 until the assembly is successful.