def is_top(self) -> bool: return all([isinf(b) for k, b in self.dbm.items() if k[0] != k[1]]) # check all inf, ignore diagonal for check