A graph-theoretic method to define any Boolean operation on partitions