martinsw01 / vitber-bio

0 stars 0 forks source link

2 f) Is broken polymer #15

Closed martinsw01 closed 2 years ago

martinsw01 commented 2 years ago

If the medium flexibility move is used, there is a chance that the polymers breaks. A broken polymer is defined using our definitions of clusters in exercise 1g): If the path (fulfilling the same requirements as in exercise 1 g) (#8)) between any two monomers belonging to the polymer is broken, so is the polymer. An illustration of this is given in Figure 2.

Write a function that checks if a polymer is broken. Hint: This function will be almost identical to the one you wrote in exercise 1 g) (#8). Improve your implementation of the medium flexibility move, such that it checks if the polymer is broken after the move is completed. If it is broken, the function should instead return the original grid (i.e. the grid where the polymer is not moved).