# Surrogate Models for Estimating Failure in Brittle and Quasi-Brittle Materials
## 3 An Algorithm to Estimate Failure Paths
These are determined as follows:
6:for\(i=1,2,\dots,10\): do
7:if The Euclidean distance of an \(i^{\text{th}}\)-nearest neighbor \(\leq\) Length of FPZ: then
8: Mark and store the \(i^{\text{th}}\)-crack tip and the corresponding Euclidean distance. 9:endif
10:endfor
11:endfor
12:Form new edges by joining the crack tips that fall within the fracture process zone. 13:for\(i=1,2,\dots,\) NumZones: do
14: Get and store the connected components in \(i^{\text{th}}\)-zone. 15: Get the total number of connected components, size of each connected component, and its length. 16: Identify and store the 0-degree cracks present in these connected components. 17:endfor
18:Identify the failure zone. This is accomplished as follows:

* First, we get the largest/maximal connected component in each zone using the Depth First Search algorithm. * Second, if two or more zones contain connected components that are of same size, then we choose a connected component which has maximum number of 0-degree cracks. * Third, if the above set of connected components contain same number of 0-degree cracks, then we choose the one which has the largest length. Length of a connected component is defined as the sum of edge weights. * Finally, if they have the same length, then we choose the connected component which is closest to the loading side of the domain. 19: The goal is to detect failure paths along the length of sample, we introduce boundary nodes in the failure zone. Their location is given as follows:

* If the index of the failure zone is \(i^{\prime}\), width of the domain is \(L\), and \(H\) is the height of the domain; then the boundary nodes are located at \((0,\frac{(i-0.5)\times H}{\text{NumZones}})\) and \((L,\frac{(i-0.5)\times H}{\text{NumZones}})\)
20:Create a weighted graph within the failure zone. To achieve this we do the following:

* We search for two nearest neighbors for each crack tip. Then, we connect these two nearest neighbors with the corresponding crack tip to form new edges. * The weights for these newly formed edges are equal to Euclidean distance. Initial cracks within the failure zone are given small edge weights \(=10^{-4}\). This is because, physically, there is a strong possibility for the failure path to traverse through the pre-existing cracks. * Once we construct the edges and their weights, we form a weighted graph. 21: Next, we compute shortest paths within this weighted graph using [PERSON]'s method. The weighted shortest paths are calculated in two ways, both with and without the constraint that the path has to traverse through the identified connected component in the failure zone. In the final step of the proposed method, we look for weighted shortest paths connecting the sides of the domain which are parallel to the tensile loading direction. First, we introduce boundary nodes in the failure zone and create a weighted undirected graph within this zone. New edges are constructed by connecting a given node to two of its nearest neighbors. As mentioned previously, the weights for these newly formed edges are equal to the Euclidean distance and initial cracks are given relatively small edge weights. Once a weighted graph is formed, we compute shortest paths from one boundary node to another boundary node. Analysis is performed with and without the constraint that the path has to traverse through the identified maximal connected component. Relaxing the above constraint gives more flexibility in identifying other possible paths (Section 5 discusses more on this aspect). [PERSON]'s algorithm [PERSON] (1986) (Chapter-3) is used to compute the weighted shortest paths. We note that Algorithm 1 is generic as there are no hard-coded values on the length of the cracks, specimen size, etc. In addition, the algorithm is not limited to only three crack orientations, and could consider continuously generated orientations. The only condition that the algorithm (see step-2) assumes is that the cracks are at a 0-degree angle.