Sort the values in-place based on the connectors in the network.
(self, values)
| 57 | return True |
| 58 | |
| 59 | def sort(self, values): |
| 60 | """Sort the values in-place based on the connectors in the network.""" |
| 61 | for level in self: |
| 62 | for wire1, wire2 in level: |
| 63 | if values[wire1] > values[wire2]: |
| 64 | values[wire1], values[wire2] = values[wire2], values[wire1] |
| 65 | |
| 66 | def assess(self, cases=None): |
| 67 | """Try to sort the **cases** using the network, return the number of |