def to_json(self):
        """Return a JSON-serializable representation."""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }
Return a JSON-serializable representation.