A method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm
The method of calculating the equivalent resistance of large-scale resistor networks by means of random walk algorithm solves the problems of memory and computational complexity in the existing technology, and provides an efficient and low-memory approximate calculation method that is suitable for resistor network calculation in circuit simulation.
Patent Information
- Application Number
- CN202311343030.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-10-17
AI Technical Summary
In circuit simulation, when calculating the equivalent resistance of a large-scale resistive network, existing techniques require solving sparse matrices, resulting in large memory requirements and computational complexity, making it difficult to meet the needs of efficient calculation when accuracy requirements are not high.
The random walk algorithm is adopted. By establishing a list of adjacent resistors and a probability density distribution table, the arrived and unarrived sets are updated by random jumps, and the equivalent resistance of the resistor nodes is calculated, thus avoiding the solution of sparse matrices.
It enables the approximate calculation of the equivalent resistance of a resistive network with limited memory. The calculation accuracy improves with the number of walks, making it suitable for scenarios with limited memory and low accuracy requirements. It is also easy to accelerate in parallel.
Smart Images

Figure CN117371381B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of integrated circuit layout design technology, and in particular to a method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm. Background Technology
[0002] In circuit simulation, it is common to calculate the equivalent resistance of large-scale resistive networks. This is especially true in the extraction of parasitic parameters from integrated circuit layouts, where other tools generate the equivalent resistance network. Typically, to accurately describe the parasitic effects of the layout, the generated resistive network is extremely large. In electromigration and current-resistance-voltage drop analysis (EMIR) techniques, the number of resistors contained in the resistive network can reach tens or even hundreds of millions.
[0003] In a resistive network, calculating the equivalent resistance between points i and j involves applying a 1V voltage to these two points. By solving the circuit equations, the current flowing through these two points can be obtained. Therefore, the equivalent resistance between points i and j can be calculated as follows:
[0004]
[0005] Here, R ij I is the equivalent resistance between points i and j. ij It is the current flowing between points i and j.
[0006] As can be seen, the equivalent resistance at any two points can only be obtained by applying voltages to the two points of the original resistive network and solving the circuit equations.
[0007] In practical applications, we also encounter the problem of solving for equivalent resistance in many-to-one relationships, which requires calculating the equivalent resistance of all nodes in a resistor network to a specific node (such as ground). Clearly, this computational cost increases rapidly with the size of the resistor network. In particular, implementing algorithms for solving large-scale sparse matrices typically requires a significant amount of memory.
[0008] In some applications, the equivalent resistance does not need to be particularly precise. For example, in EMIR, the error of the equivalent resistance is usually required to be relaxed to 10%-20%. In this case, an approximate calculation method for the equivalent resistance can be used. Summary of the Invention
[0009] To address the shortcomings of existing technologies, the present invention aims to provide a method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm. This method approximates the equivalent resistance, avoids the process of solving a large sparse matrix, uses less memory, and obtains the equivalent resistance of all nodes in the resistive network to a specific node.
[0010] To achieve the above objectives, this invention provides a method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm, comprising the following steps:
[0011] Based on the given reference resistor node to be calculated, a list of adjacent resistors is established for all nodes, the probability of each resistor node jumping to each of its nearest neighbor resistor nodes is calculated, and a probability density distribution table of jumping to the nearest neighbor resistor node is generated.
[0012] The given reference resistance node to be calculated is used as the starting point and the ending point of each random walk, and an arrived set and an unarrived set are established.
[0013] Starting from the starting point, randomly jump between resistor nodes in the resistor network to update the arrived set and the unarrived set;
[0014] The equivalent resistance of the resistance node is calculated based on the updated arrived set and the unarrived set.
[0015] Furthermore, the probability of each starting resistor node jumping to each of its nearest neighboring ending resistor nodes is calculated using a node-hopping model. This jumping probability is equal to the conductance between the starting and ending points divided by the sum of the conductances between the starting point and all its nearest neighbors. The node-hopping model is as follows:
[0016]
[0017]
[0018]
[0019] Among them, P i For the node hopping model, R represents the probability that the starting resistor node will hop to its nearest neighbor, the ending resistor node. i Let g be the resistance value of the i-th resistance node adjacent to the starting resistance node. i Let g0 be the conductance of the i-th resistor adjacent to the starting resistor node, where the conductance is the reciprocal of the resistance value, M is the number of the nearest neighbor nodes of the starting resistor node, and g0 represents the sum of the conductances among all the nearest neighbor nodes of the starting resistor node.
[0020] Furthermore, the initial parameters for the random walk also include a threshold for the number of random walks, a list of node states for the random walk, and the number of random walks.
[0021] Furthermore, the arriving set and the non-arriving set are determined by the number of adjacent nodes of the starting point and the total number of nodes in the resistor network. The arriving set and the non-arriving set are respectively: the number of nodes in the entire resistor network × the number of adjacent nodes of the reference node.
[0022] The list of node states for random walks is a 1-dimensional vector consisting of the number of nodes in the entire resistor network.
[0023] Furthermore, the step of making random jumps between resistor nodes from the starting point and updating the arrived set and the unarrived set includes the following steps:
[0024] a) Set the initial value of the node state list for random walks to 0;
[0025] b) Start jumping from the reference node, and assign a value to the starting point of each random step. Let the starting point of the first random step in each step be the reference node, and the reference node be denoted as p0.
[0026] c) Select the endpoint resistor node for each jump based on the starting point of each random walk: Based on the probability density distribution function of the jumps of the nearest neighbor nodes of the starting point of each random jump, randomly select the endpoint node from the list of adjacent resistors: If the starting resistor node is a reference node, record the position number of the endpoint resistor node in the list of nearest neighbor nodes of the starting resistor node, and let p1 = the position number; if the starting resistor node is equal to other resistor nodes, no recording is required, and update the node state list T of the random walk. rw At the position of the end resistor node, the value is 1;
[0027] d) Compare the endpoint resistor node with the reference node. If they are equal, the random walk ends and proceed directly to step e); if the endpoint resistor node of the jump is not equal to the reference node, set the starting point of each jump to the endpoint resistor node, jump to step c), and continue to execute the subsequent steps.
[0028] e) Update the arrived set and the not arrived set, where,
[0029] T g (:,p1)=T g (:,p1)+T rw
[0030] T0(:,p1)=T0(:,p1)+(1-T rw )
[0031] Among them, T g To reach the set, T0 is the set not yet reached, and p1 is the position of the destination resistor node obtained by the first jump from the reference node in the list of nearest neighbors of the reference node. rw This is the updated list of node states for the random walk.
[0032] f) Update the number of random walks and determine if the random walk has ended.
[0033] Further, step c) of randomly selecting a jumping node from the list of adjacent resistors based on the probability density distribution function of the nearest neighbor nodes at the starting point of each jump specifically includes the following steps:
[0034] Generate a random number between [0, 1].
[0035] The random number is compared with each number in the probability density distribution function array of the nearest neighbor nodes of the starting point in ascending order. If the random number is less than or equal to the number corresponding to a certain position in the probability density distribution function array of the nearest neighbor nodes of the starting point, the comparison is interrupted, and the node to be randomly selected for jumping is set to the node corresponding to that position in the list of nearest neighbor nodes of the starting point.
[0036] Furthermore, the steps of updating the number of random walks and determining whether the random walk has ended include:
[0037] Increment the number of random walks by 1;
[0038] Determine if the random walk has ended: If the number of random walks is equal to the threshold number of random walks, the random walk ends and returns to the reached set and the unreached set; if the number of random walks is not equal to the threshold number of random walks, return to step a) to perform the next random walk.
[0039] Furthermore, the formula for calculating the equivalent resistance of a resistance node based on the updated arrived set and the unarrived set is as follows:
[0040]
[0041] Where p0 is the reference node. It is node p0 and its kth nearest neighbor p 0k The resistance between them, M is the number of p0 nearest neighbors, p 0k This represents the k-th nearest neighbor of node p0.
[0042] To achieve the above objectives, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a program that runs on the processor, and the processor executes the steps of the method described above for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm when running the program.
[0043] To achieve the above objectives, the present invention also provides a computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions, when executed, perform the steps of the method described above for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm.
[0044] The method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm, as proposed in this invention, has the following advantages compared to existing technologies:
[0045] (1) The algorithm of this invention is simple to implement. It equates the process of calculating resistance to a random walk in the resistance network. The whole process only involves the random walk process, does not require solving the original resistance network equation, and does not involve complex sparse matrix solution methods.
[0046] (2) This invention is an approximate solution of equivalent resistance, which avoids the process of solving a large sparse matrix and can use less memory to obtain the equivalent resistance of all nodes in the resistor network to a specific node.
[0047] (3) The calculation accuracy can be continuously improved as the number of random walks increases;
[0048] (4) The entire algorithm of the present invention is easy to be parallelized and accelerated, and is suitable for situations where memory overhead is relatively tight and the requirements for the accuracy of equivalent resistance are not high.
[0049] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. Attached Figure Description
[0050] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0051] Figure 1 The flowchart below illustrates the method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to the present invention.
[0052] Figure 2 This is a schematic diagram showing the relationship between a resistor node and its neighboring nodes.
[0053] Figure 3 This is a schematic diagram of a 4×4 random resistor network according to Embodiment 2 of the present invention;
[0054] Figure 4 This is a schematic diagram comparing the equivalent resistance and precise value obtained from 500 and 2000 random walks. Detailed Implementation
[0055] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the invention. It should be understood that the accompanying drawings and embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the invention.
[0056] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0057] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0058] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless explicitly stated otherwise in the context, they should be understood as "one or more". "A plurality of" should be understood as two or more.
[0059] In a resistive grid, the potential of a node can be uniquely determined by the potentials of its neighboring nodes. This inspires us to use a random walk method to solve for the potential at each point.
[0060] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0061] Example 1
[0062] Figure 1 The following is a flowchart of the method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to the present invention. Figure 1 The present invention provides a detailed description of the method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm.
[0063] The method of the present invention for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm includes:
[0064] Step S1: Establish a jump model for random walks between resistor nodes.
[0065] In embodiments of the present invention, such as Figure 2As shown, assume that a resistor node 0 is surrounded by M resistor nodes 1, 2, ..., i, ..., M, and the connection resistances between resistor node 0 and its adjacent resistor nodes are R1, R2, ..., R... i , ..., R M The probability of jumping from resistor node 0 to a surrounding resistor node is:
[0066]
[0067]
[0068]
[0069] Among them, P i For the node hopping model, R represents the probability that a resistor node will hop to its nearest neighbor resistor node. i Let g be the resistance value of the i-th resistor adjacent to the starting resistor node 0. i Let g0 be the conductance of the i-th resistor adjacent to the starting resistor node 0. The conductance is the reciprocal of the resistance value. M is the number of the nearest neighbor nodes of the starting resistor node 0. g0 represents the summation of the reciprocals of the resistance values between the starting resistor node 0 and all its nearest neighbor nodes, which is the sum of the conductances between all its nearest neighbor nodes.
[0070] The above model is the basic jump model of random walk. Based on this, the present invention constructs a method for calculating the equivalent resistance in a resistive grid based on random walk.
[0071] Step S2: Determine the reference resistor node to be calculated and create a list T of adjacent resistors for all resistor nodes. adj And the probability density distribution table T of each resistor node jumping to its nearest neighbor resistor node. hop .
[0072] In an embodiment of the invention, the reference resistance node to be calculated is provided by the user and designated as p0. In subsequent calculations, the equivalent resistance values between all other resistance nodes and this reference node will be calculated.
[0073] Then, a list T of adjacent resistors is created for all resistor nodes, including the reference resistor node. adj .
[0074] In embodiments of the present invention, the method further includes calculating the probability of each resistor node jumping to each of its nearest neighbor resistor nodes according to formulas (1)-(3), thereby forming a probability density distribution table T of each resistor node jumping to its nearest neighbor resistor node. hop .
[0075] Step S3: Determine the initial parameters for the random walk.
[0076] In embodiments of the present invention, the initial parameters of the random walk include a threshold for the number of random walks, the starting point and ending point of the random walk, and the destination set T. g The list of resistor node states not yet reached (T0), the number of random walks, and the number of random walks are as follows:
[0077] The threshold for the number of random walks is determined by the required accuracy of the equivalent resistance to be solved, and is denoted as N. rw .
[0078] The starting point for the random walk is set to the reference resistance node p0 to be calculated.
[0079] The endpoint of the random walk is set to the reference resistance node p0 to be calculated.
[0080] Determine the adjacent resistor nodes at the starting point and the number of adjacent resistor nodes. Represent the number of adjacent resistor nodes as M, and the number of resistor nodes in the entire resistor network as N. Create two N×M arrays, representing the arrival sets T and N respectively. g The set T0 is not yet reached, and its initial value is 0.
[0081] The number of random walks is set to the number of times the current random walk has been performed, denoted as n, where n is initially 0.
[0082] Set up a list of resistor node states for random walks, which is an N×1 dimensional vector, denoted as T. rw .
[0083] Step S4: Start from the starting point and randomly walk around, updating the arrival set T. g And the set T0 that has not yet arrived.
[0084] In embodiments of the present invention, this step specifically includes the following steps:
[0085] a) List the states of the resistor nodes in the random walk T rw The initial value is set to 0;
[0086] b) Start walking from the reference node p0, that is, p is the starting point for each random walk. start Assign a value to p, the starting point of each random walk. start =p0;
[0087] c) Based on the starting point p of each jump in each random row start Selecting the jump resistor node: based on p start The probability density distribution function T of the nearest neighbor resistor node jump hop (p start ,:), from T adj (p start Randomly select the endpoint node p for the jump in ,:)next If p start =p0, then record p next In T adj (p start Let m be the position number in ,:), and let p1 = m, p start If the value is equal to any other value, no record is needed. Update T. rw (p next ) = 1. Here T hop (p start ,:) represents a two-dimensional array T hop p start A vector consisting of all column elements in a row;
[0088] d) Jump the endpoint resistor node p next Compare with the reference node. If they are equal, the random walk ends, and proceed directly to step e). If the endpoint resistor node is not equal to the starting point, set the starting point of each jump to the endpoint resistor node, i.e., P. start =P next Skip to step c) and continue with the subsequent steps;
[0089] e) Update T g and T0, where,
[0090] T g (:,p1)=T g (:,p1)+T rw
[0091] T0(:,p1)=T0(:,p1)+(1-T rw )
[0092] Note that T g To reach the set, T0 is the set not yet reached, and p1 is the position of the destination resistor node obtained by the first jump from the reference node in the list of nearest neighbors of the reference node. rw This is the updated list of node states for the random walk. Generally speaking, the node number of the jump endpoint resistor may be very large, but the number of its neighboring nodes is very small. Replacing its actual number with the position of the neighboring node can effectively save storage space.
[0093] f) Update the number of random walks and determine if the random walk has ended.
[0094] The number of random walks is n = n + 1. If n equals the threshold number of random walks, the random walk ends and returns T. g If T0 is reached, otherwise return to step a) to perform the next random walk.
[0095] Step S5: Based on the array T obtained from the random walk... gCalculate the equivalent resistance of the resistive node using T0.
[0096] In this embodiment of the invention, two arrays T are returned. g And T0, according to T g The equivalent resistance is calculated using T0, and the equivalent resistance is expressed as... The calculation formula is as follows:
[0097]
[0098] Where p0 is the reference node. It is node p0 and its kth nearest neighbor p 0k The resistance between them, M is the number of p0 nearest neighbors, p 0k This represents the k-th nearest neighbor of node p0.
[0099] The method of this invention uses very little memory, requiring only the storage of T. g And the T0 matrix, the adjacent resistor nodes T of each resistor node adj and probability density function matrix T hop and T during the random walk process rw If each resistor node has an average of K neighboring resistor nodes, the total storage requirement is approximately 5NK. Typically, in a resistor network, each resistor has 3-4 nearest neighbors.
[0100] Furthermore, the single-walk calculation of this invention can simultaneously calculate the equivalent resistance of all resistance nodes and the reference resistance node. However, to reduce statistical fluctuations, the number of random walks can be increased, i.e., the accuracy is controllable.
[0101] Moreover, since each random walk is independent, it can be parallelized based on the number of random walks.
[0102] Example 2
[0103] The following detailed description of the method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm, with reference to a specific embodiment, illustrates the present invention.
[0104] Figure 3 It is a 4×4 random resistor network with 16 resistor nodes, i.e., N=16. We set the reference resistor node number as 1, i.e., p0=1. Furthermore, we assume that all resistors are 1 ohm.
[0105] This embodiment is also based on the jump model for random walks between resistor nodes established in step S1 of embodiment 1. That is, step S1' in this embodiment is the same as step S1.
[0106] Then, in step S2', the reference resistor node p0 is determined, and a list of adjacent resistors is created for all resistor nodes.
[0107] At this point, set p0 = 1.
[0108] Build a nearest neighbor list T for all resistor nodes. adj Since there are 16 resistor nodes, and each resistor node has 2-4 neighboring resistor nodes, we create a 16×4 array to store the nearest neighbor resistor nodes for each resistor node. For example, for resistor node 1, we store resistor nodes 2 and 5; for resistor node 2, we store 1, 6, and 3; for resistor node 11, we store 7, 10, 12, and 15, and so on.
[0109] Establish a jump probability density distribution table T for all resistor nodes. hop Similarly, there are 16 resistor nodes, each with 2-4 adjacent resistor nodes. We construct a 16×4 array and calculate the probability density distribution function of jumping to an adjacent resistor node. Taking resistor node 1 as an example, according to formulas (1)-(3), its probability of jumping to 2 and 5 is 0.5 respectively, so the probability distribution function is 0.5,1. That is, T hop (1,1)=0.5,T hop (1,2)=1; For resistor node 2, the probability of it jumping to 1, 3, or 6 is 1 / 3 each, so its probability distribution function is 1 / 3, 2 / 3, and 1. That is, T hop (2,1)=1 / 3,T hop (2,2)=2 / 3,T hop (2,3) = 1; similarly for resistor node 11, we can fill with T. hop (11,1)=1 / 4,T hop (11,2)=1 / 2,T hop (11,3)=3 / 4,T hop (11,4)=1.
[0110] In step S3', the initial parameters for the random walk are determined.
[0111] Set the threshold N for the number of random walks. rw Set it to 500.
[0112] Starting point p0 is set to 1, and it has two nearest neighbor resistor nodes 1 and 5, i.e., M = 2. The total number of resistor nodes in the entire resistor network is 16, i.e., N = 16. Two N×M arrays are created, denoted as T. g Both array T and array T0 are initialized to 0. In this example, array T... g The size of T0 is 16×2. Initialize the number of random walks n=0.
[0113] Establish a list of resistor node states T during the random walk process. rw In this embodiment, Trw It is a 16×1 dimensional vector.
[0114] Step S4': Start from the starting point and walk randomly while updating array T g And T0.
[0115] In embodiments of the present invention, this step specifically includes the following steps:
[0116] a') List the states of the resistor nodes in the random walk T rw The initial value is set to 0;
[0117] b') Starting from p0 = 1, that is, let p start =1.
[0118] c') According to p start The probability density distribution function T of the nearest neighbor resistor node jump hop (p start ,:), from T adj (p start The endpoint resistor node p is randomly selected from the jumps in ,:) next The specific calculation method is as follows:
[0119] First, generate a random number r between [0, 1].
[0120] Compare T in ascending order. hop (p start For each number in ,:) and the value of r, if r ≦ T hop (p start If m), then the comparison is interrupted and p is set to p. next =T adj (p start ,m).
[0121] For example, for resistor node 1, its nearest neighbor resistor node is T. adj (1,:)=[2,5], the jump probability density distribution function is T hop (1,:) = [0.5,1].
[0122] If r = 0.6, then we can find that r <T hop (1,2)=1, that is, m=2, then p next =T adj (1,2)=5; if r=0.4, we find r <T hop (1,1)=0.5, that is, m=1, then p next =T adj (1,1)=2.
[0123] Update T rw (p next ) = 1. If pstart =p0, at this time p1 should be one of the adjacent resistor nodes of p0, and record the index of the nearest resistor node in the nearest neighbor array.
[0124] In this embodiment, if p start =1,p next =2, at this time resistor node 2 is at T adj If the index in (1,:) = [2,5] is 1, record p1 = 1; if p start =1,p next =5, at this time resistor node 5 is at T adj The index in (1,:) is 2, and the record is p1 = 2.
[0125] d') Compare the jump endpoint resistor node with the reference node. If they are equal, the random walk ends. In this embodiment, since p0 = 1, once p0 is exceeded... next If the value is 1, it means the random walk has ended.
[0126] Otherwise let p start =p next Return to step c' and continue with the subsequent steps.
[0127] e') Update array T g and T0, where,
[0128] T g (:,p1)=T g (:,p1)+T rw
[0129] T0(:,p1)=T0(:,p1)+(1-T rw )
[0130] In this embodiment, since the reference resistor node 1 has only two adjacent resistor nodes, the value of p1 is either 1 or 2.
[0131] f') Update the number of random walks and determine if the random walk has ended.
[0132] Update the number of random walks, n = n + 1. If n is greater than or equal to N rw Then the random walk ends and returns to T. g And T0. Otherwise, return to step a') to begin the next random walk. Since N rw The value is set to 500, so 500 random walks need to be performed. At this point, T... g A lot of accumulation has already been done with T0.
[0133] Step S5': Based on the array T obtained from the random walk g Calculate the equivalent resistance with T0.
[0134] The algorithm returns two arrays T. g And T0, according to T g The equivalent resistance is calculated using T0, and the equivalent resistance is expressed as... The calculation formula is as follows:
[0135]
[0136] Where p0 is the reference node. It is node p0 and its kth nearest neighbor p 0k The resistance between them, M is the number of p0 nearest neighbors, p 0k This represents the k-th nearest neighbor of node p0.
[0137] In this embodiment, we need to calculate the equivalent resistance of 15 resistor nodes (2 to 16) and resistor node 1.
[0138] For example, to calculate the equivalent resistance between resistor node 15 and resistor node 1, we would use T0(15,1) and T g Calculate in (15,1)
[0139]
[0140] Here, v2 and v5 represent the voltages across resistor nodes 2 and 5, which are the two nearest neighbors of resistor node 1, respectively. The total current flowing through resistor node 1 is equal to...
[0141]
[0142] Therefore, the equivalent resistance between resistor node 15 and resistor node 1 is finally calculated as follows:
[0143]
[0144] The equivalent resistance calculations for other resistance nodes and resistance node 1 are performed similarly.
[0145] verify
[0146] To verify the accuracy of the equivalent resistance obtained from the random walk, we define the error as...
[0147]
[0148] Here R rw and R acc These represent vectors composed of the equivalent resistances of each resistance node obtained using the random walk and the exact method, respectively. In this example, the vector contains 15 equivalent resistances.
[0149] Table 1 compares the accuracy of the many-to-one equivalent resistance obtained from different numbers of random walks in Example 2 with that obtained through precise calculation. It can be seen that the error decreases continuously as the number of random walks increases. Even if the error from 200 random walks is large, this number of walks is acceptable if it meets the needs of practical engineering.
[0150] Table 1 compares the equivalent resistance and exact value calculated for different random walks of a 4×4 resistor network.
[0151] <![CDATA[N rw ]]> 200 500 1000 5000 10000 error 19% 8% 4.3% 2.6% 1.6%
[0152] Figure 4 A comparison of the equivalent resistance and precise values obtained from 500 and 2000 random walks is presented. It can be seen that the equivalent resistance obtained from both 500 and 2000 random walks accurately reflects the trend of resistance change. The result from 2000 random walks is more accurate.
[0153] We also tested the calculation of equivalent resistance for different resistor network sizes of 100×100 and 200×200. In this test, all resistors were randomly generated. Table 2 shows the test results.
[0154] Table 2 Comparison of equivalent resistance and exact values calculated using different random walks for resistor networks of different sizes.
[0155]
[0156]
[0157] Similarly, it can be seen that the accuracy of the equivalent resistance calculated by random walks continuously improves with the number of random walks. Furthermore, for 200 random walks, the accuracy is between 10% and 20%, which basically meets the needs of EMIR calculations.
[0158] Example 3
[0159] This invention also provides an electronic device, including a memory and a processor. The memory stores a program that runs on the processor. When the processor runs the program, it executes the steps of the method described above for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm. The method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm is described in the foregoing section and will not be repeated here.
[0160] Example 4
[0161] This invention also provides a computer-readable storage medium storing computer instructions that, when executed, perform the steps of the method described above for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm. The method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm is described in the foregoing section and will not be repeated here.
[0162] It will be understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm, comprising the following steps: Based on the given reference resistor node to be calculated, a list of adjacent resistors is established for all nodes, the probability of each resistor node jumping to each of its nearest neighbor resistor nodes is calculated, and a probability density distribution table of jumping to the nearest neighbor resistor node is generated. The given reference resistance node to be calculated is used as the starting point and the ending point of each random walk, and an arrived set and an unarrived set are established. Starting from the starting point, randomly jump between resistor nodes in the resistor network to update the arrived set and the unarrived set; The equivalent resistance of the resistance node is calculated based on the updated arrived set and the unarrived set, using the following formula: Where p0 is the reference node, and p is the distance between node p0 and its kth nearest neighbor node p. 0k The resistance between them, M is the number of p0 nearest neighbors, p 0k This represents the k-th nearest neighbor of node p0.
2. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 1, characterized in that, The probability of each starting resistor node jumping to each of its nearest neighboring ending resistor nodes is calculated using a node-hopping model. This probability is equal to the conductance between the starting and ending points divided by the sum of the conductances between the starting point and all its nearest neighbors. The node-hopping model is as follows: Among them, P i For the node hopping model, R represents the probability that the starting resistor node will hop to its nearest neighbor ending resistor node. i Let g be the resistance value of the i-th resistance node adjacent to the starting resistance node. i Let g0 be the conductance of the i-th resistor adjacent to the starting resistor node, where the conductance is the reciprocal of the resistance value, M is the number of the nearest neighbor nodes of the starting resistor node, and g0 represents the sum of the conductances between the starting resistor node and all its nearest neighbor nodes.
3. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 2, characterized in that, The initial parameters for the random walk also include a threshold for the number of random walks, a list of node states for the random walk, and the number of random walks.
4. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 3, characterized in that, The arrival set and the non-arrival set are determined by the number of adjacent nodes of the starting point and the total number of nodes in the resistor network. The arrival set and the non-arrival set are respectively: the number of nodes in the entire resistor network × the number of adjacent nodes of the reference node. The list of node states for random walks is a 1-dimensional vector consisting of the number of nodes in the entire resistor network.
5. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 1, characterized in that, The step of making random jumps between resistor nodes from the starting point and updating the arrived set and the unarrived set includes the following steps: a) Set the initial value of the node state list for random walks to 0; b) Start jumping from the reference node, and assign a value to the starting point of each random step. Let the starting point of the first random step in each step be the reference node, and the reference node be denoted as p0. c) Select the endpoint resistor node for each jump based on the starting point of each random walk: Based on the probability density distribution function of the jumps of the nearest neighbor nodes of the starting point of each random jump, randomly select the endpoint node from the list of adjacent resistors: If the starting resistor node is a reference node, record the position number of the endpoint resistor node in the list of nearest neighbor nodes of the starting resistor node, and let p1 = the position number; if the starting resistor node is equal to other resistor nodes, no recording is required, and update the node state list T of the random walk. rw At the position of the end resistor node, the value is 1; d) Compare the endpoint resistor node with the reference node. If they are equal, the random walk ends and proceed directly to step e); if the endpoint resistor node of the jump is not equal to the reference node, set the starting point of each jump to the endpoint resistor node, jump to step c), and continue to execute the subsequent steps. e) Update the arrived set and the not arrived set, where, T g (:,p1)=T g (:,p1)+T rw T0(:,p1)=T0(:,p1)+(1-T rw ) Among them, T g To reach the set, T0 is the set not yet reached, and p1 is the position of the destination resistor node obtained by the first jump from the reference node in the list of nearest neighbors of the reference node. rw This is the updated list of node states for the random walk. f) Update the number of random walks and determine if the random walk has ended.
6. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 5, characterized in that, Step c) involves randomly selecting a node to jump from the list of adjacent resistors based on the probability density distribution function of the nearest neighbor nodes at the starting point of each jump. This specifically includes the following steps: Generate a random number between [0, 1]. The random number is compared with each number in the probability density distribution function array of the nearest neighbor nodes of the starting point in ascending order. If the random number is less than or equal to the number corresponding to a certain position in the probability density distribution function array of the nearest neighbor nodes of the starting point, the comparison is interrupted, and the node to be randomly selected for jumping is set to the node corresponding to that position in the list of nearest neighbor nodes of the starting point.
7. The method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm according to claim 5, characterized in that, The steps for updating the number of random walks and determining whether the random walk has ended include incrementing the number of random walks by 1; Determine if the random walk has ended: If the number of random walks is equal to the threshold number of random walks, the random walk ends and returns to the reached set and the unreached set; if the number of random walks is less than the threshold number of random walks, return to step a) to perform the next random walk.
8. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a program that runs on the processor, and the processor, when running the program, performs the steps of the method for calculating the equivalent resistance of a large-scale resistive network using a random walk algorithm as described in any one of claims 1-7.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed, they perform the steps of the method for calculating the equivalent resistance of a large-scale resistive network using the random walk algorithm as described in any one of claims 1-7.
Citation Information
Patent Citations
Mixing random walking method for chip thermal analysis
CN103793561A
Chip three-dimensional thermal analysis method
CN105718638A